Geotubepedia
geotubepediawiki
https://geotubepedia.miraheze.org/wiki/Main_Page
MediaWiki 1.40.1
first-letter
Media
Special
Talk
User
User talk
Geotubepedia
Geotubepedia talk
File
File talk
MediaWiki
MediaWiki talk
Template
Template talk
Help
Help talk
Category
Category talk
Module
Module talk
Template:Collapsible list
10
141
290
2013-11-02T05:07:45Z
wikipedia>Fuhghettaboutit
0
Changed protection level of Template:Collapsible list: Enable access by template editors ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:collapsible list|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
aff61df28bcc6c3457d6aa36ada4fffe68c409a9
Template:Dated maintenance category
10
182
381
2014-01-08T08:14:55Z
wikipedia>John of Reading
0
Second attempt. Those spaces upset inline templates such as {{As of}}. Instead, try an unconditional <nowiki/>
wikitext
text/x-wiki
<nowiki/><!--This nowiki helps to prevent whitespace at the top of articles-->{{#ifeq:{{FULLROOTPAGENAME}}|Wikipedia:Template messages|<!--Do not categorize-->|<!--
-->{{#ifexpr:{{#if:{{NAMESPACE}}|0|1}}+{{#ifeq:{{{onlyarticles|no}}}|yes|0|1}}
|{{#if:{{{3|}}}
|[[Category:{{{1}}} {{{2}}} {{{3}}}]]<!--
-->{{#ifexist:Category:{{{1}}} {{{2}}} {{{3}}}
|<!--
-->|[[Category:Articles with invalid date parameter in template]]<!--
-->}}
|[[Category:{{#if:{{{5|}}}
|{{{5}}}<!--
-->|{{{1}}}<!--
-->}}]]<!--
-->}}{{#if:{{{4|}}}
|[[Category:{{{4}}}]]}}<!--
-->}}<!--
-->}}<noinclude>
{{documentation}}
</noinclude>
41e7d4000124d4f718ddf222af0b72825048c4c4
Module:Namespace detect
828
94
191
2014-04-05T17:01:23Z
wikipedia>Mr. Stradivarius
0
use demopage instead of page as the main "page" parameter
Scribunto
text/plain
--[[
--------------------------------------------------------------------------------
-- --
-- NAMESPACE DETECT --
-- --
-- This module implements the {{namespace detect}} template in Lua, with a --
-- few improvements: all namespaces and all namespace aliases are supported, --
-- and namespace names are detected automatically for the local wiki. The --
-- module can also use the corresponding subject namespace value if it is --
-- used on a talk page. Parameter names can be configured for different wikis --
-- by altering the values in the "cfg" table in --
-- Module:Namespace detect/config. --
-- --
--------------------------------------------------------------------------------
--]]
local data = mw.loadData('Module:Namespace detect/data')
local argKeys = data.argKeys
local cfg = data.cfg
local mappings = data.mappings
local yesno = require('Module:Yesno')
local mArguments -- Lazily initialise Module:Arguments
local mTableTools -- Lazily initilalise Module:TableTools
local ustringLower = mw.ustring.lower
local p = {}
local function fetchValue(t1, t2)
-- Fetches a value from the table t1 for the first key in array t2 where
-- a non-nil value of t1 exists.
for i, key in ipairs(t2) do
local value = t1[key]
if value ~= nil then
return value
end
end
return nil
end
local function equalsArrayValue(t, value)
-- Returns true if value equals a value in the array t. Otherwise
-- returns false.
for i, arrayValue in ipairs(t) do
if value == arrayValue then
return true
end
end
return false
end
function p.getPageObject(page)
-- Get the page object, passing the function through pcall in case of
-- errors, e.g. being over the expensive function count limit.
if page then
local success, pageObject = pcall(mw.title.new, page)
if success then
return pageObject
else
return nil
end
else
return mw.title.getCurrentTitle()
end
end
-- Provided for backward compatibility with other modules
function p.getParamMappings()
return mappings
end
local function getNamespace(args)
-- This function gets the namespace name from the page object.
local page = fetchValue(args, argKeys.demopage)
if page == '' then
page = nil
end
local demospace = fetchValue(args, argKeys.demospace)
if demospace == '' then
demospace = nil
end
local subjectns = fetchValue(args, argKeys.subjectns)
local ret
if demospace then
-- Handle "demospace = main" properly.
if equalsArrayValue(argKeys.main, ustringLower(demospace)) then
ret = mw.site.namespaces[0].name
else
ret = demospace
end
else
local pageObject = p.getPageObject(page)
if pageObject then
if pageObject.isTalkPage then
-- Get the subject namespace if the option is set,
-- otherwise use "talk".
if yesno(subjectns) then
ret = mw.site.namespaces[pageObject.namespace].subject.name
else
ret = 'talk'
end
else
ret = pageObject.nsText
end
else
return nil -- return nil if the page object doesn't exist.
end
end
ret = ret:gsub('_', ' ')
return ustringLower(ret)
end
function p._main(args)
-- Check the parameters stored in the mappings table for any matches.
local namespace = getNamespace(args) or 'other' -- "other" avoids nil table keys
local params = mappings[namespace] or {}
local ret = fetchValue(args, params)
--[[
-- If there were no matches, return parameters for other namespaces.
-- This happens if there was no text specified for the namespace that
-- was detected or if the demospace parameter is not a valid
-- namespace. Note that the parameter for the detected namespace must be
-- completely absent for this to happen, not merely blank.
--]]
if ret == nil then
ret = fetchValue(args, argKeys.other)
end
return ret
end
function p.main(frame)
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {removeBlanks = false})
local ret = p._main(args)
return ret or ''
end
function p.table(frame)
--[[
-- Create a wikitable of all subject namespace parameters, for
-- documentation purposes. The talk parameter is optional, in case it
-- needs to be excluded in the documentation.
--]]
-- Load modules and initialise variables.
mTableTools = require('Module:TableTools')
local namespaces = mw.site.namespaces
local cfg = data.cfg
local useTalk = type(frame) == 'table'
and type(frame.args) == 'table'
and yesno(frame.args.talk) -- Whether to use the talk parameter.
-- Get the header names.
local function checkValue(value, default)
if type(value) == 'string' then
return value
else
return default
end
end
local nsHeader = checkValue(cfg.wikitableNamespaceHeader, 'Namespace')
local aliasesHeader = checkValue(cfg.wikitableAliasesHeader, 'Aliases')
-- Put the namespaces in order.
local mappingsOrdered = {}
for nsname, params in pairs(mappings) do
if useTalk or nsname ~= 'talk' then
local nsid = namespaces[nsname].id
-- Add 1, as the array must start with 1; nsid 0 would be lost otherwise.
nsid = nsid + 1
mappingsOrdered[nsid] = params
end
end
mappingsOrdered = mTableTools.compressSparseArray(mappingsOrdered)
-- Build the table.
local ret = '{| class="wikitable"'
.. '\n|-'
.. '\n! ' .. nsHeader
.. '\n! ' .. aliasesHeader
for i, params in ipairs(mappingsOrdered) do
for j, param in ipairs(params) do
if j == 1 then
ret = ret .. '\n|-'
.. '\n| <code>' .. param .. '</code>'
.. '\n| '
elseif j == 2 then
ret = ret .. '<code>' .. param .. '</code>'
else
ret = ret .. ', <code>' .. param .. '</code>'
end
end
end
ret = ret .. '\n|-'
.. '\n|}'
return ret
end
return p
a4757000273064f151f0f22dc0e139092e5ff443
Template:Pagetype
10
91
185
2014-07-09T08:29:38Z
wikipedia>Callanecc
0
Changed protection level of Template:Pagetype: [[WP:High-risk templates|Highly visible template]]: With more than 5.5 million transclusions and cascade protections this should be full protected as well ([Edit=Allow only administrators] (indefinite) [Move=
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:pagetype|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
b8e6aa66678cd57877ea2c607372a45070f030a7
Template:When on basepage
10
159
326
2014-09-30T08:52:52Z
wikipedia>Sardanaphalus
0
Sardanaphalus moved page [[Template:Basepage subpage]] to [[Template:When on basepage]]: Per move request
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "page" parameter then detect
basepage/subpage/subsubpage-->
{{#if:{{{page|}}}
| {{#if:{{#titleparts:{{{page}}}|0|3}}
| subsubpage <!--Subsubpage or lower-->
| {{#if:{{#titleparts:{{{page}}}|0|2}}
| subpage
| basepage
}}
}}
| {{#if:{{#titleparts:{{FULLPAGENAME}}|0|3}}
| subsubpage <!--Subsubpage or lower-->
| {{#if:{{#titleparts:{{FULLPAGENAME}}|0|2}}
| subpage
| basepage
}}
}}
}}
| basepage = {{{1|}}}
| subpage = {{{2|}}}
| subsubpage = {{{3| {{{2|}}} }}} <!--Respecting empty parameter on purpose-->
}}<!--End switch--><noinclude>
{{Documentation}}
</noinclude>
cf4dc92df647a26ab0ce149772a1fe3ac6c3dfc0
Module:Ns has subpages
828
186
389
2014-12-10T06:37:29Z
wikipedia>Mr. Stradivarius
0
Protected Module:Ns has subpages: [[WP:High-risk templates|High-risk Lua module]] ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))
Scribunto
text/plain
-- This module implements [[Template:Ns has subpages]].
-- While the template is fairly simple, this information is made available to
-- Lua directly, so using a module means that we don't have to update the
-- template as new namespaces are added.
local p = {}
function p._main(ns, frame)
-- Get the current namespace if we were not passed one.
if not ns then
ns = mw.title.getCurrentTitle().namespace
end
-- Look up the namespace table from mw.site.namespaces. This should work
-- for a majority of cases.
local nsTable = mw.site.namespaces[ns]
-- Try using string matching to get the namespace from page names.
-- Do a quick and dirty bad title check to try and make sure we do the same
-- thing as {{NAMESPACE}} in most cases.
if not nsTable and type(ns) == 'string' and not ns:find('[<>|%[%]{}]') then
local nsStripped = ns:gsub('^[_%s]*:', '')
nsStripped = nsStripped:gsub(':.*$', '')
nsTable = mw.site.namespaces[nsStripped]
end
-- If we still have no match then try the {{NAMESPACE}} parser function,
-- which should catch the remainder of cases. Don't use a mw.title object,
-- as this would increment the expensive function count for each new page
-- tested.
if not nsTable then
frame = frame or mw.getCurrentFrame()
local nsProcessed = frame:callParserFunction('NAMESPACE', ns)
nsTable = nsProcessed and mw.site.namespaces[nsProcessed]
end
return nsTable and nsTable.hasSubpages
end
function p.main(frame)
local ns = frame:getParent().args[1]
if ns then
ns = ns:match('^%s*(.-)%s*$') -- trim whitespace
ns = tonumber(ns) or ns
end
local hasSubpages = p._main(ns, frame)
return hasSubpages and 'yes' or ''
end
return p
e133068ba73738b16e1e3eba47735516a461eb5b
Template:Br separated entries
10
121
250
2015-05-26T18:06:33Z
wikipedia>Izkala
0
Switch to using [[Module:Separated entries]]; leading and trailing whitespace and newlines are now trimmed
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:Separated entries|br}}<noinclude>
{{documentation}}
</noinclude>
2019f7fc383259e70d66e43cbd97a43d20889f1b
Template:Nowrap
10
110
228
2015-11-28T10:13:53Z
wikipedia>Edokter
0
Adapt comment; edits inside noinclude blocks should not affect job queue, but won't kill parser either way.
wikitext
text/x-wiki
<span class="nowrap">{{{1}}}</span><noinclude>
{{documentation}}
<!-- Categories go on the /doc page; interwikis go to Wikidata. -->
</noinclude>
5d0dc6b6d89b37f4356242404f46138a4017f015
Template:Category link
10
51
104
2016-09-21T14:41:05Z
wikipedia>Anthony Appleyard
0
Anthony Appleyard moved page [[Template:Cl]] to [[Template:Category link]] over redirect: [[Special:Permalink/740508935|Requested]] by Nyuszika7H at [[WP:RM/TR]]: The template should be located at the natural, unabbreviated title and {{[[Temp...
wikitext
text/x-wiki
{{#ifeq:{{#titleparts:{{PAGENAME}}|1}}|Stub types for deletion |[[:Category:{{{1}}}|Cat:{{{1}}}]] | [[:Category:{{{1}}}|{{{2|Category:{{{1}}}}}}]]{{#ifeq:{{Yesno|{{{count|no}}}}}|yes|<small> {{#ifexpr:{{PAGESINCAT:{{{1}}}|{{UC:{{{count_type|ALL}}}}}|R}}>={{{backlog|{{#expr:{{PAGESINCAT:{{{1}}}|{{UC:{{{count_type|ALL}}}}}|R}}+1}}}}}|<span style="font-weight: bold; color: #DD0000;">}}( {{PAGESINCAT:{{{1}}}|{{UC:{{{count_type|ALL}}}}}}} ){{#ifexpr:{{PAGESINCAT:{{{1}}}|{{UC:{{{count_type|ALL}}}}}|R}}>={{{backlog|{{#expr:{{PAGESINCAT:{{{1}}}|{{UC:{{{count_type|ALL}}}}}|R}}+1}}}}}|</span>}}</small>}}}}<noinclude>
{{Documentation}}
</noinclude>
cb0fcaeb8242d1d37c27a8dcb57f76fe5b5faa36
Template:Str left
10
145
298
2016-09-30T07:01:19Z
wikipedia>Ymblanter
0
Changed protection level of Template:Str left: [[WP:High-risk templates|Highly visible template]]: RFPP request ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
wikitext
text/x-wiki
<includeonly>{{safesubst:padleft:|{{{2|1}}}|{{{1}}}}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
2048b0d7b35e156528655b1d090e8b5ffab3f400
Template:--
10
61
124
2016-10-21T12:17:19Z
wikipedia>Alexiaa
0
Added [[WP:RCAT|rcat]]
wikitext
text/x-wiki
#REDIRECT [[Template:Em dash]]
{{Redirect category shell|
{{R from move}}
{{R from template shortcut}}
}}
b6255351d93197d967d74365cfba31e395df0170
Template:Url
10
148
304
2016-11-21T11:11:29Z
wikipedia>Materialscientist
0
Changed protection level for "[[Template:Url]]": [[WP:High-risk templates|Highly visible template]] ([Edit=Require template editor access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
#REDIRECT [[Template:URL]]
18785dfd06e0aad86a368375896bc1a4a5be1fc4
Template:Cite web
10
127
262
2016-12-05T05:36:52Z
wikipedia>Anthony Appleyard
0
Protected "[[Template:Cite web]]": restore old protection ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
<includeonly>{{#invoke:citation/CS1|citation
|CitationClass=web
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
ea1b0f38afd9728a1cf9f2e3f540887a402fab8e
Template:Section link
10
188
393
2017-01-17T01:29:39Z
wikipedia>Primefac
0
done
wikitext
text/x-wiki
{{#invoke:Section link|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
8d047e5845f8a9b74a4655b5dd79ca7595a8f88b
Template:Pp
10
198
413
2017-01-24T15:07:04Z
wikipedia>Xaosflux
0
Changed protection level for "[[Template:Pp]]": is linked from cascaded main page, moving would be very disruptive ([Edit=Require template editor access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
{{#invoke:Protection banner|main}}<noinclude>
{{documentation}}
</noinclude>
4b195ffc44cfde864ef77b55a54c006333226ced
Template:Basepage subpage
10
160
328
2017-03-12T04:26:29Z
wikipedia>Godsy
0
[[Template:This is a redirect]] has been deprecated, change to [[Template:Redirect category shell]].
wikitext
text/x-wiki
#REDIRECT [[Template:When on basepage]]
{{Redirect category shell|
{{R from move}}
{{R from template shortcut}}
}}
47118a1bed1942b7f143cdff1dec183002fc9f4b
Template:Crossref
10
43
88
2017-10-09T12:24:30Z
wikipedia>Xezbeth
0
Protected "[[Template:Crossref]]": [[Wikipedia:High-risk templates|Highly visible]] template redirect ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
wikitext
text/x-wiki
#REDIRECT [[Template:Crossreference]]
{{Rcat shell|
{{R from template shortcut}}
}}
dc4192593ccb8eaa34c0440c4aa712442a06c329
Template:Rounddown
10
150
308
2017-12-19T04:37:44Z
wikipedia>JJMC89
0
SAFESUBST:<noinclude />
wikitext
text/x-wiki
<includeonly>{{SAFESUBST:<noinclude />#expr:floor(({{{1}}})*10^({{{2|0}}}))/10^({{{2|0}}})}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
b42fa12eaa65e5d614703a4bb3cee65cb2119aa2
Template:WikiProject YouTube/Used Template
10
163
334
2017-12-29T01:22:07Z
wikipedia>This, that and the other
0
remove inappropriate category
wikitext
text/x-wiki
{{ mbox
| image = [[file:YouTube Logo 2017.svg|80x70px|alt=|link=]]
| text = If you plan to make [[backward compatibility|breaking changes]] to this template, move it, or nominate it for deletion, please notify [[Wikipedia:WikiProject YouTube|WikiProject YouTube]] members at [[Wikipedia talk:WikiProject YouTube]] as a courtesy, as this template is heavily used by this WikiProject. Thank you! {{#if:{{{1|}}}|<p>
{{{1}}}}}}}<noinclude>
{{Documentation}}<!-- Add categories and interwikis to the /doc subpage, not here! --></noinclude>
d42e3fd8e627050d08bd311414aec5000e00d9c9
Template:Remove first word
10
147
302
2018-02-13T20:10:27Z
wikipedia>WOSlinker
0
separate pp-template not needed
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:String|replace|source={{{1}}}|pattern=^[^{{{sep|%s}}}]*{{{sep|%s}}}*|replace=|plain=false}}<noinclude>{{Documentation}}</noinclude>
df7a9e692f68be1581be06af5f51eaed5483b4c8
Template:Yesno-no
10
42
86
2018-02-13T20:27:17Z
wikipedia>WOSlinker
0
separate pp-template not needed
wikitext
text/x-wiki
{{safesubst:<noinclude />yesno|{{{1}}}|yes={{{yes|yes}}}|no={{{no|no}}}|blank={{{blank|no}}}|¬={{{¬|no}}}|def={{{def|no}}}}}<noinclude>
{{Documentation|Template:Yesno/doc}}
<!--Categories go in the doc page referenced above; interwikis go in Wikidata.-->
</noinclude>
1ad7b7800da1b867ead8f6ff8cef76e6201b3b56
Template:Param
10
75
152
2018-05-27T03:56:56Z
wikipedia>JJMC89
0
clean subst
wikitext
text/x-wiki
{{SAFESUBST:<noinclude />#ifeq:{{SAFESUBST:<noinclude />Yesno|{{{nested|no}}}}}|yes||<{{{tag|code}}}>}}{{{{{{1<noinclude>|foo</noinclude>}}}{{SAFESUBST:<noinclude />#ifeq:{{{2}}}|{{{2|}}} ||}}{{{2|}}}}}}{{SAFESUBST:<noinclude />#ifeq:{{SAFESUBST:<noinclude />Yesno|{{{nested|no}}}}}|yes||</{{{tag|code}}}>}}<noinclude>
{{Documentation}}
<!--
PLEASE ADD CATEGORIES AND INTERWIKIS
TO THE /doc SUBPAGE, THANKS
-->
</noinclude>
abdb5d7fe0982064ea62ad15e8298d1693ed69e2
Template:Infobox
10
129
266
2018-08-15T18:33:36Z
wikipedia>Primefac
0
Undid revision 855063393 by [[Special:Contributions/Jdlrobson|Jdlrobson]] ([[User talk:Jdlrobson|talk]]) rather problematic change mentioned [[Template_talk:Infobox#Using_template_styles_to_reduce_technical_debt_inside_mobile_skin|on talk page]], reverting until it can be sorted
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
</noinclude>
817a9f5b6524eced06a57bd1d5fd7179f9369bf2
Template:Template other
10
25
52
2018-12-16T22:06:25Z
wikipedia>Amorymeltzer
0
Changed protection level for "[[Template:Template other]]": [[WP:High-risk templates|Highly visible template]]: Transclusion count has increased dramatically ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Template}}
| template
| other
}}
}}
| template = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
06fb13d264df967b5232141067eb7d2b67372d76
Module:Separated entries
828
126
260
2018-12-17T20:54:33Z
wikipedia>Amorymeltzer
0
Changed protection level for "[[Module:Separated entries]]": [[WP:High-risk templates|High-risk Lua module]]: Over 2M transclusions ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
Scribunto
text/plain
-- This module takes positional parameters as input and concatenates them with
-- an optional separator. The final separator (the "conjunction") can be
-- specified independently, enabling natural-language lists like
-- "foo, bar, baz and qux". The starting parameter can also be specified.
local compressSparseArray = require('Module:TableTools').compressSparseArray
local p = {}
function p._main(args)
local separator = args.separator
-- Decode (convert to Unicode) HTML escape sequences, such as " " for space.
and mw.text.decode(args.separator) or ''
local conjunction = args.conjunction and mw.text.decode(args.conjunction) or separator
-- Discard values before the starting parameter.
local start = tonumber(args.start)
if start then
for i = 1, start - 1 do args[i] = nil end
end
-- Discard named parameters.
local values = compressSparseArray(args)
return mw.text.listToText(values, separator, conjunction)
end
local function makeInvokeFunction(separator, conjunction, first)
return function (frame)
local args = require('Module:Arguments').getArgs(frame)
args.separator = separator or args.separator
args.conjunction = conjunction or args.conjunction
args.first = first or args.first
return p._main(args)
end
end
p.main = makeInvokeFunction()
p.br = makeInvokeFunction('<br />')
p.comma = makeInvokeFunction(mw.message.new('comma-separator'):plain())
return p
e80231ff3de01afd7f62a94e0a34dc1e67504085
Module:WikidataIB/nolinks
828
38
78
2019-01-31T16:27:33Z
wikipedia>RexxS
0
add abbreviations UK and USA
Scribunto
text/plain
local p ={}
--[[
The values here are the English sitelinks for items that should not be linked.
These 36 are not definitive and may be altered to suit.
--]]
p.items = {
"Australia",
"Austria",
"Belgium",
"Canada",
"China",
"Denmark",
"England",
"France",
"Germany",
"Greece",
"Hungary",
"Iceland",
"India",
"Republic of Ireland",
"Israel",
"Italy",
"Jamaica",
"Japan",
"Luxembourg",
"Mexico",
"Netherlands",
"New Zealand",
"Northern Ireland",
"Norway",
"Poland",
"Portugal",
"Russia",
"Scotland",
"South Africa",
"Spain",
"Sweden",
"Switzerland",
"Turkey",
"United Kingdom",
"UK",
"United States",
"USA",
"Wales",
}
--[[
This provides a convenient way to create a test whether an item is on the list.
--]]
p.itemsindex = {}
for i, v in ipairs(p.items) do
p.itemsindex[v] = true
end
return p
d42a1e1cb5d411ab1b578dc0d36aa0266f32b2d6
Template:Hr
10
144
296
2019-03-17T18:05:07Z
wikipedia>JJMC89
0
handled by {{documentation}}
wikitext
text/x-wiki
<includeonly>{{#if:{{{1|}}}
|<hr style="height:{{{1}}}px" />
|<hr />
}}</includeonly><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage and interwikis to Wikidata. -->
</noinclude>
c603f73ed9385fb902bbaac80bd15ba89e91f37f
Template:Lua
10
77
156
2019-03-20T22:04:45Z
wikipedia>RMCD bot
0
Removing notice of move discussion
wikitext
text/x-wiki
<includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>
{{Lua|Module:Lua banner}}
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
dba3962144dacd289dbc34f50fbe0a7bf6d7f2f7
Template:Cl
10
52
106
2019-04-24T04:30:48Z
wikipedia>JJMC89
0
actual template is in the category
wikitext
text/x-wiki
#REDIRECT [[Template:Category link]]
{{R from move}}
f79fddc38797fc163b6e6ddeb4377afbea7d0cfc
Template:Clc
10
78
158
2019-04-24T04:30:59Z
wikipedia>JJMC89
0
actual template is in the category
wikitext
text/x-wiki
#REDIRECT [[Template:Category link with count]]
02280e2ab57b544236e11f913e3759c5781ca9d5
Template:Sum
10
151
310
2019-11-05T17:59:58Z
wikipedia>MusikBot II
0
Protected "[[Template:Sum]]": [[Wikipedia:High-risk templates|High-risk template or module]] ([[User:MusikBot II/TemplateProtector|more info]]) ([Edit=Require autoconfirmed or confirmed access] (indefinite))
wikitext
text/x-wiki
<includeonly>{{#invoke:math|sum}}</includeonly><noinclude>
{{documentation}}
</noinclude>
163107e11b86304c79ebed4d9f51fda3611d3f75
Template:URL
10
136
280
2019-11-18T00:50:36Z
wikipedia>Jonesey95
0
Adding unknown parameter tracking through [[:Category:Pages using URL template with unknown parameters]] using [[Module:check for unknown parameters]]
wikitext
text/x-wiki
<includeonly>{{#invoke:URL|url}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using URL template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:URL]] with unknown parameter "_VALUE_"|ignoreblank=y | 1 | 2 }}<noinclude>{{documentation}}</noinclude>
5671474ce4656f07c5bdc47292d1dcbe9c70317e
Template:Unbulleted list
10
122
252
2019-12-09T17:31:16Z
wikipedia>Jonesey95
0
Undid revision 929522913 by [[Special:Contributions/MSGJ|MSGJ]] ([[User talk:MSGJ|talk]]). Reverted, as this change has been shown to have bugs. Discussion continues on talk page.
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:list|unbulleted}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
89815a491d3e05b20af446e34cda13f13c25fb4f
Template:Ombox
10
173
363
2020-04-01T06:12:36Z
wikipedia>MusikAnimal
0
1 revision imported
wikitext
text/x-wiki
{{#invoke:Message box|ombox}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
0e54065432d540737b9e56c4e3a8e7f74d4534ea
Module:Arguments
828
8
18
2020-04-01T06:12:40Z
wikipedia>MusikAnimal
0
1 revision imported
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
Module:Namespace detect/config
828
96
195
2020-04-01T06:12:44Z
wikipedia>MusikAnimal
0
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect configuration data --
-- --
-- This module stores configuration data for Module:Namespace detect. Here --
-- you can localise the module to your wiki's language. --
-- --
-- To activate a configuration item, you need to uncomment it. This means --
-- that you need to remove the text "-- " at the start of the line. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Parameter names --
-- These configuration items specify custom parameter names. Values added --
-- here will work in addition to the default English parameter names. --
-- To add one extra name, you can use this format: --
-- --
-- cfg.foo = 'parameter name' --
-- --
-- To add multiple names, you can use this format: --
-- --
-- cfg.foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'} --
--------------------------------------------------------------------------------
---- This parameter displays content for the main namespace:
-- cfg.main = 'main'
---- This parameter displays in talk namespaces:
-- cfg.talk = 'talk'
---- This parameter displays content for "other" namespaces (namespaces for which
---- parameters have not been specified):
-- cfg.other = 'other'
---- This parameter makes talk pages behave as though they are the corresponding
---- subject namespace. Note that this parameter is used with [[Module:Yesno]].
---- Edit that module to change the default values of "yes", "no", etc.
-- cfg.subjectns = 'subjectns'
---- This parameter sets a demonstration namespace:
-- cfg.demospace = 'demospace'
---- This parameter sets a specific page to compare:
cfg.demopage = 'page'
--------------------------------------------------------------------------------
-- Table configuration --
-- These configuration items allow customisation of the "table" function, --
-- used to generate a table of possible parameters in the module --
-- documentation. --
--------------------------------------------------------------------------------
---- The header for the namespace column in the wikitable containing the list of
---- possible subject-space parameters.
-- cfg.wikitableNamespaceHeader = 'Namespace'
---- The header for the wikitable containing the list of possible subject-space
---- parameters.
-- cfg.wikitableAliasesHeader = 'Aliases'
--------------------------------------------------------------------------------
-- End of configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line.
0e4ff08d13c4b664d66b32c232deb129b77c1a56
Module:Namespace detect/data
828
95
193
2020-04-01T06:12:45Z
wikipedia>MusikAnimal
0
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect data --
-- This module holds data for [[Module:Namespace detect]] to be loaded per --
-- page, rather than per #invoke, for performance reasons. --
--------------------------------------------------------------------------------
local cfg = require('Module:Namespace detect/config')
local function addKey(t, key, defaultKey)
if key ~= defaultKey then
t[#t + 1] = key
end
end
-- Get a table of parameters to query for each default parameter name.
-- This allows wikis to customise parameter names in the cfg table while
-- ensuring that default parameter names will always work. The cfg table
-- values can be added as a string, or as an array of strings.
local defaultKeys = {
'main',
'talk',
'other',
'subjectns',
'demospace',
'demopage'
}
local argKeys = {}
for i, defaultKey in ipairs(defaultKeys) do
argKeys[defaultKey] = {defaultKey}
end
for defaultKey, t in pairs(argKeys) do
local cfgValue = cfg[defaultKey]
local cfgValueType = type(cfgValue)
if cfgValueType == 'string' then
addKey(t, cfgValue, defaultKey)
elseif cfgValueType == 'table' then
for i, key in ipairs(cfgValue) do
addKey(t, key, defaultKey)
end
end
cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more.
end
local function getParamMappings()
--[[
-- Returns a table of how parameter names map to namespace names. The keys
-- are the actual namespace names, in lower case, and the values are the
-- possible parameter names for that namespace, also in lower case. The
-- table entries are structured like this:
-- {
-- [''] = {'main'},
-- ['wikipedia'] = {'wikipedia', 'project', 'wp'},
-- ...
-- }
--]]
local mappings = {}
local mainNsName = mw.site.subjectNamespaces[0].name
mainNsName = mw.ustring.lower(mainNsName)
mappings[mainNsName] = mw.clone(argKeys.main)
mappings['talk'] = mw.clone(argKeys.talk)
for nsid, ns in pairs(mw.site.subjectNamespaces) do
if nsid ~= 0 then -- Exclude main namespace.
local nsname = mw.ustring.lower(ns.name)
local canonicalName = mw.ustring.lower(ns.canonicalName)
mappings[nsname] = {nsname}
if canonicalName ~= nsname then
table.insert(mappings[nsname], canonicalName)
end
for _, alias in ipairs(ns.aliases) do
table.insert(mappings[nsname], mw.ustring.lower(alias))
end
end
end
return mappings
end
return {
argKeys = argKeys,
cfg = cfg,
mappings = getParamMappings()
}
d224f42a258bc308ef3ad8cc8686cd7a4f47d005
Module:Yesno
828
7
16
2020-04-01T06:27:55Z
wikipedia>MusikAnimal
0
Undid revision 948472533 by [[Special:Contributions/w>Vogone|w>Vogone]] ([[User talk:w>Vogone|talk]])
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
f767643e7d12126d020d88d662a3dd057817b9dc
Module:File link
828
28
58
2020-04-01T06:31:54Z
wikipedia>MusikAnimal
0
Undid revision 948472508 by [[Special:Contributions/w>IPad365|w>IPad365]] ([[User talk:w>IPad365|talk]])
Scribunto
text/plain
-- This module provides a library for formatting file wikilinks.
local yesno = require('Module:Yesno')
local checkType = require('libraryUtil').checkType
local p = {}
function p._main(args)
checkType('_main', 1, args, 'table')
-- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our
-- own function to get the right error level.
local function checkArg(key, val, level)
if type(val) ~= 'string' then
error(string.format(
"type error in '%s' parameter of '_main' (expected string, got %s)",
key, type(val)
), level)
end
end
local ret = {}
-- Adds a positional parameter to the buffer.
local function addPositional(key)
local val = args[key]
if not val then
return nil
end
checkArg(key, val, 4)
ret[#ret + 1] = val
end
-- Adds a named parameter to the buffer. We assume that the parameter name
-- is the same as the argument key.
local function addNamed(key)
local val = args[key]
if not val then
return nil
end
checkArg(key, val, 4)
ret[#ret + 1] = key .. '=' .. val
end
-- Filename
checkArg('file', args.file, 3)
ret[#ret + 1] = 'File:' .. args.file
-- Format
if args.format then
checkArg('format', args.format)
if args.formatfile then
checkArg('formatfile', args.formatfile)
ret[#ret + 1] = args.format .. '=' .. args.formatfile
else
ret[#ret + 1] = args.format
end
end
-- Border
if yesno(args.border) then
ret[#ret + 1] = 'border'
end
addPositional('location')
addPositional('alignment')
addPositional('size')
addNamed('upright')
addNamed('link')
addNamed('alt')
addNamed('page')
addNamed('class')
addNamed('lang')
addNamed('start')
addNamed('end')
addNamed('thumbtime')
addPositional('caption')
return string.format('[[%s]]', table.concat(ret, '|'))
end
function p.main(frame)
local origArgs = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:File link'
})
if not origArgs.file then
error("'file' parameter missing from [[Template:File link]]", 0)
end
-- Copy the arguments that were passed to a new table to avoid looking up
-- every possible parameter in the frame object.
local args = {}
for k, v in pairs(origArgs) do
-- Make _BLANK a special argument to add a blank parameter. For use in
-- conditional templates etc. it is useful for blank arguments to be
-- ignored, but we still need a way to specify them so that we can do
-- things like [[File:Example.png|link=]].
if v == '_BLANK' then
v = ''
end
args[k] = v
end
return p._main(args)
end
return p
66925f088d11530f2482f04181a3baaaa0ad3d0c
Template:Sandbox other
10
59
120
2020-04-03T00:08:09Z
wikipedia>Evad37
0
Also match subpage names beginning with "sandbox", per [[Template_talk:Sandbox_other#Template-protected_edit_request_on_28_March_2020|edit request]]
wikitext
text/x-wiki
{{#if:{{#ifeq:{{#invoke:String|sublength|s={{SUBPAGENAME}}|i=0|len=7}}|sandbox|1}}{{#ifeq:{{SUBPAGENAME}}|doc|1}}{{#invoke:String|match|{{PAGENAME}}|/sandbox/styles.css$|plain=false|nomatch=}}|{{{1|}}}|{{{2|}}}}}<!--
--><noinclude>{{documentation}}</noinclude>
91e4ae891d6b791615152c1fbc971414961ba872
Module:WikidataIB/titleformats
828
39
80
2020-04-30T16:11:19Z
wikipedia>RexxS
0
add magazine
Scribunto
text/plain
--[[
To satisfy Wikipedia:Manual of Style/Titles, certain types of items are italicised,
and others are quoted.
This submodule lists the entity-ids used in 'instance of' (P31),
which allows a module to identify the values that should be formatted.
The table p.formats is indexed by entity-id, and contains the value " or ''
--]]
local p = {}
p.italics = {
"Q571", -- book
"Q13593966", -- literary trilogy
"Q277759", -- book series
"Q2188189", -- musical work
"Q11424", -- film
"Q13593818", -- film trilogy
"Q24856", -- film series
"Q5398426", -- television series
"Q482994", -- album
"Q169930", -- extended play
"Q1760610", -- comic book
"Q7889", -- video game
"Q7058673", -- video game series
"Q25379", -- play
"Q2743", -- musical
"Q37484", -- epic poem
"Q41298", -- magazine
}
p.quotes = {
"Q207628", -- musical composition
}
p.size = 0
p.formats = {}
for i, v in ipairs(p.italics) do
p.formats[v] = "''"
p.size = p.size + 1
end
for i, v in ipairs(p.quotes) do
p.formats[v] = '"'
p.size = p.size + 1
end
return p
aecc52ff69e56d315f5b60dc21d02dd94a63dfea
Template:Birth date and age
10
143
294
2020-06-07T01:32:39Z
wikipedia>Uzume
0
update tracking to use [[Module:Wd]] instead of the unmaintained and deprecated [[Module:Wikidata]]
wikitext
text/x-wiki
<includeonly>{{{{{♥|safesubst:}}}#invoke:age|birth_date_and_age}}{{#invoke:Check for unknown parameters|check|ignoreblank=y|preview=Page using [[Template:Birth date and age]] with unknown parameter "_VALUE_"|unknown={{main other|[[Category:Pages using birth date and age template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|1|2|3|day|month|year|df|mf}}{{#ifeq: {{NAMESPACENUMBER}} | 0
| {{#if: {{#invoke:wd|label|raw}}
| {{#if: {{#invoke:String|match|{{#invoke:wd|properties|raw|P31}},|Q5,|1|1|true|}}
| {{#if: {{#invoke:wd|properties|raw|P569}}
|
| [[Category:Date of birth not in Wikidata]]
}}
}}
| [[Category:Articles without Wikidata item]]
}}
}}</includeonly><noinclude>{{documentation}}</noinclude>
55c7a1b79d4b09cf1b1c81565ac2bd7da422612e
Module:Pagetype
828
92
187
2020-06-18T21:22:08Z
wikipedia>RexxS
0
add caps parameter per talk request
Scribunto
text/plain
--------------------------------------------------------------------------------
-- --
-- PAGETYPE --
-- --
-- This is a meta-module intended to replace {{pagetype}} and similar --
-- templates. It automatically detects namespaces, and allows for a --
-- great deal of customisation. It can easily be ported to other --
-- wikis by changing the values in the [[Module:Pagetype/config]]. --
-- --
--------------------------------------------------------------------------------
-- Load config.
local cfg = mw.loadData('Module:Pagetype/config')
-- Load required modules.
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local nsDetectModule = require('Module:Namespace detect')
local nsDetect = nsDetectModule._main
local getParamMappings = nsDetectModule.getParamMappings
local getPageObject = nsDetectModule.getPageObject
local p = {}
local function shallowCopy(t)
-- Makes a shallow copy of a table.
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
local function checkPagetypeInput(namespace, val)
-- Checks to see whether we need the default value for the given namespace,
-- and if so gets it from the pagetypes table.
-- The yesno function returns true/false for "yes", "no", etc., and returns
-- val for other input.
local ret = yesno(val, val)
if ret and type(ret) ~= 'string' then
ret = cfg.pagetypes[namespace]
end
return ret
end
local function getPagetypeFromClass(class, param, aliasTable, default)
-- Gets the pagetype from a class specified from the first positional
-- parameter.
param = yesno(param, param)
if param ~= false then -- No check if specifically disallowed.
for _, alias in ipairs(aliasTable) do
if class == alias then
if type(param) == 'string' then
return param
else
return default
end
end
end
end
end
local function getNsDetectValue(args)
-- Builds the arguments to pass to [[Module:Namespace detect]] and returns
-- the result.
-- Get the default values.
local ndArgs = {}
local defaultns = args[cfg.defaultns]
if defaultns == cfg.defaultnsAll then
ndArgs = shallowCopy(cfg.pagetypes)
else
local defaultnsArray
if defaultns == cfg.defaultnsExtended then
defaultnsArray = cfg.extendedNamespaces
elseif defaultns == cfg.defaultnsNone then
defaultnsArray = {}
else
defaultnsArray = cfg.defaultNamespaces
end
for _, namespace in ipairs(defaultnsArray) do
ndArgs[namespace] = cfg.pagetypes[namespace]
end
end
--[[
-- Add custom values passed in from the arguments. These overwrite the
-- defaults. The possible argument names are fetched from
-- Module:Namespace detect automatically in case new namespaces are
-- added. Although we accept namespace aliases as parameters, we only pass
-- the local namespace name as a parameter to Module:Namespace detect.
-- This means that the "image" parameter can overwrite defaults for the
-- File: namespace, which wouldn't work if we passed the parameters through
-- separately.
--]]
local mappings = getParamMappings()
for ns, paramAliases in pairs(mappings) do
-- Copy the aliases table, as # doesn't work with tables returned from
-- mw.loadData.
paramAliases = shallowCopy(paramAliases)
local paramName = paramAliases[1]
-- Iterate backwards along the array so that any values for the local
-- namespace names overwrite those for namespace aliases.
for i = #paramAliases, 1, -1 do
local paramAlias = paramAliases[i]
local ndArg = checkPagetypeInput(paramAlias, args[paramAlias])
if ndArg == false then
-- If any arguments are false, convert them to nil to protect
-- against breakage by future changes to
-- [[Module:Namespace detect]].
ndArgs[paramName] = nil
elseif ndArg then
ndArgs[paramName] = ndArg
end
end
end
-- Check for disambiguation-class and N/A-class pages in mainspace.
if ndArgs.main then
local class = args[1]
if type(class) == 'string' then
-- Put in lower case so e.g. "Dab" and "dab" will both match.
class = mw.ustring.lower(class)
end
local dab = getPagetypeFromClass(
class,
args[cfg.dab],
cfg.dabAliases,
cfg.dabDefault
)
if dab then
ndArgs.main = dab
else
local na = getPagetypeFromClass(
class,
args[cfg.na],
cfg.naAliases,
cfg.naDefault
)
if na then
ndArgs.main = na
end
end
end
-- If there is no talk value specified, use the corresponding subject
-- namespace for talk pages.
if not ndArgs.talk then
ndArgs.subjectns = true
end
-- Add the fallback value. This can also be customised, but it cannot be
-- disabled.
local other = args[cfg.other]
-- We will ignore true/false/nil results from yesno here, but using it
-- anyway for consistency.
other = yesno(other, other)
if type(other) == 'string' then
ndArgs.other = other
else
ndArgs.other = cfg.otherDefault
end
-- Allow custom page values.
ndArgs.page = args.page
return nsDetect(ndArgs)
end
local function detectRedirects(args)
local redirect = args[cfg.redirect]
-- The yesno function returns true/false for "yes", "no", etc., and returns
-- redirect for other input.
redirect = yesno(redirect, redirect)
if redirect == false then
-- Detect redirects unless they have been explicitly disallowed with
-- "redirect=no" or similar.
return
end
local pageObject = getPageObject(args.page)
-- If we are using subject namespaces elsewhere, do so here as well.
if pageObject
and not yesno(args.talk, true)
and args[cfg.defaultns] ~= cfg.defaultnsAll
then
pageObject = getPageObject(
pageObject.subjectNsText .. ':' .. pageObject.text
)
end
-- Allow custom values for redirects.
if pageObject and pageObject.isRedirect then
if type(redirect) == 'string' then
return redirect
else
return cfg.redirectDefault
end
end
end
function p._main(args)
local redirect = detectRedirects(args)
local pagetype = ""
if redirect then
pagetype = redirect
else
pagetype = getNsDetectValue(args)
end
if yesno(args.plural, false) then
if cfg.irregularPlurals[pagetype] then
pagetype = cfg.irregularPlurals[pagetype]
else
pagetype = pagetype .. cfg.plural -- often 's'
end
end
if yesno(args.caps, false) then
pagetype = mw.ustring.upper(mw.ustring.sub(pagetype, 1, 1)) ..
mw.ustring.sub(pagetype, 2)
end
return pagetype
end
function p.main(frame)
local args = getArgs(frame)
return p._main(args)
end
return p
210524e0c60e3354325aea88c508e94423ad228d
Module:String
828
19
40
2020-08-02T15:49:42Z
wikipedia>RexxS
0
separate annotations for str.match from those for str._match
Scribunto
text/plain
--[[
This module is intended to provide access to basic string functions.
Most of the functions provided here can be invoked with named parameters,
unnamed parameters, or a mixture. If named parameters are used, Mediawiki will
automatically remove any leading or trailing whitespace from the parameter.
Depending on the intended use, it may be advantageous to either preserve or
remove such whitespace.
Global options
ignore_errors: If set to 'true' or 1, any error condition will result in
an empty string being returned rather than an error message.
error_category: If an error occurs, specifies the name of a category to
include with the error message. The default category is
[Category:Errors reported by Module String].
no_category: If set to 'true' or 1, no category will be added if an error
is generated.
Unit tests for this module are available at Module:String/tests.
]]
local str = {}
--[[
len
This function returns the length of the target string.
Usage:
{{#invoke:String|len|target_string|}}
OR
{{#invoke:String|len|s=target_string}}
Parameters
s: The string whose length to report
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string.
]]
function str.len( frame )
local new_args = str._getParameters( frame.args, {'s'} )
local s = new_args['s'] or ''
return mw.ustring.len( s )
end
--[[
sub
This function returns a substring of the target string at specified indices.
Usage:
{{#invoke:String|sub|target_string|start_index|end_index}}
OR
{{#invoke:String|sub|s=target_string|i=start_index|j=end_index}}
Parameters
s: The string to return a subset of
i: The fist index of the substring to return, defaults to 1.
j: The last index of the string to return, defaults to the last character.
The first character of the string is assigned an index of 1. If either i or j
is a negative value, it is interpreted the same as selecting a character by
counting from the end of the string. Hence, a value of -1 is the same as
selecting the last character of the string.
If the requested indices are out of range for the given string, an error is
reported.
]]
function str.sub( frame )
local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } )
local s = new_args['s'] or ''
local i = tonumber( new_args['i'] ) or 1
local j = tonumber( new_args['j'] ) or -1
local len = mw.ustring.len( s )
-- Convert negatives for range checking
if i < 0 then
i = len + i + 1
end
if j < 0 then
j = len + j + 1
end
if i > len or j > len or i < 1 or j < 1 then
return str._error( 'String subset index out of range' )
end
if j < i then
return str._error( 'String subset indices out of order' )
end
return mw.ustring.sub( s, i, j )
end
--[[
This function implements that features of {{str sub old}} and is kept in order
to maintain these older templates.
]]
function str.sublength( frame )
local i = tonumber( frame.args.i ) or 0
local len = tonumber( frame.args.len )
return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) )
end
--[[
_match
This function returns a substring from the source string that matches a
specified pattern. It is exported for use in other modules
Usage:
strmatch = require("Module:String")._match
sresult = strmatch( s, pattern, start, match, plain, nomatch )
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This sub-routine is exported for use in other modules
function str._match( s, pattern, start, match_index, plain_flag, nomatch )
if s == '' then
return str._error( 'Target string is empty' )
end
if pattern == '' then
return str._error( 'Pattern string is empty' )
end
start = tonumber(start) or 1
if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then
return str._error( 'Requested start is out of range' )
end
if match_index == 0 then
return str._error( 'Match index is out of range' )
end
if plain_flag then
pattern = str._escapePattern( pattern )
end
local result
if match_index == 1 then
-- Find first match is simple case
result = mw.ustring.match( s, pattern, start )
else
if start > 1 then
s = mw.ustring.sub( s, start )
end
local iterator = mw.ustring.gmatch(s, pattern)
if match_index > 0 then
-- Forward search
for w in iterator do
match_index = match_index - 1
if match_index == 0 then
result = w
break
end
end
else
-- Reverse search
local result_table = {}
local count = 1
for w in iterator do
result_table[count] = w
count = count + 1
end
result = result_table[ count + match_index ]
end
end
if result == nil then
if nomatch == nil then
return str._error( 'Match not found' )
else
return nomatch
end
else
return result
end
end
--[[
match
This function returns a substring from the source string that matches a
specified pattern.
Usage:
{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}
OR
{{#invoke:String|match|s=source_string|pattern=pattern_string|start=start_index
|match=match_number|plain=plain_flag|nomatch=nomatch_output}}
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from each string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
If the match_number or start_index are out of range for the string being queried, then
this function generates an error. An error is also generated if no match is found.
If one adds the parameter ignore_errors=true, then the error will be suppressed and
an empty string will be returned on any failure.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This is the entry point for #invoke:String|match
function str.match( frame )
local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} )
local s = new_args['s'] or ''
local start = tonumber( new_args['start'] ) or 1
local plain_flag = str._getBoolean( new_args['plain'] or false )
local pattern = new_args['pattern'] or ''
local match_index = math.floor( tonumber(new_args['match']) or 1 )
local nomatch = new_args['nomatch']
return str._match( s, pattern, start, match_index, plain_flag, nomatch )
end
--[[
pos
This function returns a single character from the target string at position pos.
Usage:
{{#invoke:String|pos|target_string|index_value}}
OR
{{#invoke:String|pos|target=target_string|pos=index_value}}
Parameters
target: The string to search
pos: The index for the character to return
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
The first character has an index value of 1.
If one requests a negative value, this function will select a character by counting backwards
from the end of the string. In other words pos = -1 is the same as asking for the last character.
A requested value of zero, or a value greater than the length of the string returns an error.
]]
function str.pos( frame )
local new_args = str._getParameters( frame.args, {'target', 'pos'} )
local target_str = new_args['target'] or ''
local pos = tonumber( new_args['pos'] ) or 0
if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then
return str._error( 'String index out of range' )
end
return mw.ustring.sub( target_str, pos, pos )
end
--[[
str_find
This function duplicates the behavior of {{str_find}}, including all of its quirks.
This is provided in order to support existing templates, but is NOT RECOMMENDED for
new code and templates. New code is recommended to use the "find" function instead.
Returns the first index in "source" that is a match to "target". Indexing is 1-based,
and the function returns -1 if the "target" string is not present in "source".
Important Note: If the "target" string is empty / missing, this function returns a
value of "1", which is generally unexpected behavior, and must be accounted for
separatetly.
]]
function str.str_find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target'} )
local source_str = new_args['source'] or ''
local target_str = new_args['target'] or ''
if target_str == '' then
return 1
end
local start = mw.ustring.find( source_str, target_str, 1, true )
if start == nil then
start = -1
end
return start
end
--[[
find
This function allows one to search for a target string or pattern within another
string.
Usage:
{{#invoke:String|find|source_str|target_string|start_index|plain_flag}}
OR
{{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}}
Parameters
source: The string to search
target: The string or pattern to find within source
start: The index within the source string to start the search, defaults to 1
plain: Boolean flag indicating that target should be understood as plain
text and not as a Lua style regular expression, defaults to true
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the parameter. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
This function returns the first index >= "start" where "target" can be found
within "source". Indices are 1-based. If "target" is not found, then this
function returns 0. If either "source" or "target" are missing / empty, this
function also returns 0.
This function should be safe for UTF-8 strings.
]]
function str.find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['target'] or ''
local start_pos = tonumber(new_args['start']) or 1
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return 0
end
plain = str._getBoolean( plain )
local start = mw.ustring.find( source_str, pattern, start_pos, plain )
if start == nil then
start = 0
end
return start
end
--[[
replace
This function allows one to replace a target string or pattern within another
string.
Usage:
{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}
OR
{{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string|
count=replacement_count|plain=plain_flag}}
Parameters
source: The string to search
pattern: The string or pattern to find within source
replace: The replacement text
count: The number of occurences to replace, defaults to all.
plain: Boolean flag indicating that pattern should be understood as plain
text and not as a Lua style regular expression, defaults to true
]]
function str.replace( frame )
local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['pattern'] or ''
local replace = new_args['replace'] or ''
local count = tonumber( new_args['count'] )
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return source_str
end
plain = str._getBoolean( plain )
if plain then
pattern = str._escapePattern( pattern )
replace = mw.ustring.gsub( replace, "%%", "%%%%" ) --Only need to escape replacement sequences.
end
local result
if count ~= nil then
result = mw.ustring.gsub( source_str, pattern, replace, count )
else
result = mw.ustring.gsub( source_str, pattern, replace )
end
return result
end
--[[
simple function to pipe string.rep to templates.
]]
function str.rep( frame )
local repetitions = tonumber( frame.args[2] )
if not repetitions then
return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' )
end
return string.rep( frame.args[1] or '', repetitions )
end
--[[
escapePattern
This function escapes special characters from a Lua string pattern. See [1]
for details on how patterns work.
[1] https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
Usage:
{{#invoke:String|escapePattern|pattern_string}}
Parameters
pattern_string: The pattern string to escape.
]]
function str.escapePattern( frame )
local pattern_str = frame.args[1]
if not pattern_str then
return str._error( 'No pattern string specified' )
end
local result = str._escapePattern( pattern_str )
return result
end
--[[
count
This function counts the number of occurrences of one string in another.
]]
function str.count(frame)
local args = str._getParameters(frame.args, {'source', 'pattern', 'plain'})
local source = args.source or ''
local pattern = args.pattern or ''
local plain = str._getBoolean(args.plain or true)
if plain then
pattern = str._escapePattern(pattern)
end
local _, count = mw.ustring.gsub(source, pattern, '')
return count
end
--[[
endswith
This function determines whether a string ends with another string.
]]
function str.endswith(frame)
local args = str._getParameters(frame.args, {'source', 'pattern'})
local source = args.source or ''
local pattern = args.pattern or ''
if pattern == '' then
-- All strings end with the empty string.
return "yes"
end
if mw.ustring.sub(source, -mw.ustring.len(pattern), -1) == pattern then
return "yes"
else
return ""
end
end
--[[
join
Join all non empty arguments together; the first argument is the separator.
Usage:
{{#invoke:String|join|sep|one|two|three}}
]]
function str.join(frame)
local args = {}
local sep
for _, v in ipairs( frame.args ) do
if sep then
if v ~= '' then
table.insert(args, v)
end
else
sep = v
end
end
return table.concat( args, sep or '' )
end
--[[
Helper function that populates the argument list given that user may need to use a mix of
named and unnamed parameters. This is relevant because named parameters are not
identical to unnamed parameters due to string trimming, and when dealing with strings
we sometimes want to either preserve or remove that whitespace depending on the application.
]]
function str._getParameters( frame_args, arg_list )
local new_args = {}
local index = 1
local value
for _, arg in ipairs( arg_list ) do
value = frame_args[arg]
if value == nil then
value = frame_args[index]
index = index + 1
end
new_args[arg] = value
end
return new_args
end
--[[
Helper function to handle error messages.
]]
function str._error( error_str )
local frame = mw.getCurrentFrame()
local error_category = frame.args.error_category or 'Errors reported by Module String'
local ignore_errors = frame.args.ignore_errors or false
local no_category = frame.args.no_category or false
if str._getBoolean(ignore_errors) then
return ''
end
local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>'
if error_category ~= '' and not str._getBoolean( no_category ) then
error_str = '[[Category:' .. error_category .. ']]' .. error_str
end
return error_str
end
--[[
Helper Function to interpret boolean strings
]]
function str._getBoolean( boolean_str )
local boolean_value
if type( boolean_str ) == 'string' then
boolean_str = boolean_str:lower()
if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0'
or boolean_str == '' then
boolean_value = false
else
boolean_value = true
end
elseif type( boolean_str ) == 'boolean' then
boolean_value = boolean_str
else
error( 'No boolean value found' )
end
return boolean_value
end
--[[
Helper function that escapes all pattern characters so that they will be treated
as plain text.
]]
function str._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" )
end
return str
6df794dd52434e0f6a372c9918f5a9dedd15f579
Module:Date
828
134
276
2020-08-03T02:55:18Z
wikipedia>Johnuniq
0
update from sandbox: implement show=M (minutes) and show=s (seconds); better method to fill a partial date
Scribunto
text/plain
-- Date functions for use by other modules.
-- I18N and time zones are not supported.
local MINUS = '−' -- Unicode U+2212 MINUS SIGN
local floor = math.floor
local Date, DateDiff, diffmt -- forward declarations
local uniq = { 'unique identifier' }
local function is_date(t)
-- The system used to make a date read-only means there is no unique
-- metatable that is conveniently accessible to check.
return type(t) == 'table' and t._id == uniq
end
local function is_diff(t)
return type(t) == 'table' and getmetatable(t) == diffmt
end
local function _list_join(list, sep)
return table.concat(list, sep)
end
local function collection()
-- Return a table to hold items.
return {
n = 0,
add = function (self, item)
self.n = self.n + 1
self[self.n] = item
end,
join = _list_join,
}
end
local function strip_to_nil(text)
-- If text is a string, return its trimmed content, or nil if empty.
-- Otherwise return text (convenient when Date fields are provided from
-- another module which may pass a string, a number, or another type).
if type(text) == 'string' then
text = text:match('(%S.-)%s*$')
end
return text
end
local function is_leap_year(year, calname)
-- Return true if year is a leap year.
if calname == 'Julian' then
return year % 4 == 0
end
return (year % 4 == 0 and year % 100 ~= 0) or year % 400 == 0
end
local function days_in_month(year, month, calname)
-- Return number of days (1..31) in given month (1..12).
if month == 2 and is_leap_year(year, calname) then
return 29
end
return ({ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 })[month]
end
local function h_m_s(time)
-- Return hour, minute, second extracted from fraction of a day.
time = floor(time * 24 * 3600 + 0.5) -- number of seconds
local second = time % 60
time = floor(time / 60)
return floor(time / 60), time % 60, second
end
local function hms(date)
-- Return fraction of a day from date's time, where (0 <= fraction < 1)
-- if the values are valid, but could be anything if outside range.
return (date.hour + (date.minute + date.second / 60) / 60) / 24
end
local function julian_date(date)
-- Return jd, jdz from a Julian or Gregorian calendar date where
-- jd = Julian date and its fractional part is zero at noon
-- jdz = same, but assume time is 00:00:00 if no time given
-- http://www.tondering.dk/claus/cal/julperiod.php#formula
-- Testing shows this works for all dates from year -9999 to 9999!
-- JDN 0 is the 24-hour period starting at noon UTC on Monday
-- 1 January 4713 BC = (-4712, 1, 1) Julian calendar
-- 24 November 4714 BC = (-4713, 11, 24) Gregorian calendar
local offset
local a = floor((14 - date.month)/12)
local y = date.year + 4800 - a
if date.calendar == 'Julian' then
offset = floor(y/4) - 32083
else
offset = floor(y/4) - floor(y/100) + floor(y/400) - 32045
end
local m = date.month + 12*a - 3
local jd = date.day + floor((153*m + 2)/5) + 365*y + offset
if date.hastime then
jd = jd + hms(date) - 0.5
return jd, jd
end
return jd, jd - 0.5
end
local function set_date_from_jd(date)
-- Set the fields of table date from its Julian date field.
-- Return true if date is valid.
-- http://www.tondering.dk/claus/cal/julperiod.php#formula
-- This handles the proleptic Julian and Gregorian calendars.
-- Negative Julian dates are not defined but they work.
local calname = date.calendar
local low, high -- min/max limits for date ranges −9999-01-01 to 9999-12-31
if calname == 'Gregorian' then
low, high = -1930999.5, 5373484.49999
elseif calname == 'Julian' then
low, high = -1931076.5, 5373557.49999
else
return
end
local jd = date.jd
if not (type(jd) == 'number' and low <= jd and jd <= high) then
return
end
local jdn = floor(jd)
if date.hastime then
local time = jd - jdn -- 0 <= time < 1
if time >= 0.5 then -- if at or after midnight of next day
jdn = jdn + 1
time = time - 0.5
else
time = time + 0.5
end
date.hour, date.minute, date.second = h_m_s(time)
else
date.second = 0
date.minute = 0
date.hour = 0
end
local b, c
if calname == 'Julian' then
b = 0
c = jdn + 32082
else -- Gregorian
local a = jdn + 32044
b = floor((4*a + 3)/146097)
c = a - floor(146097*b/4)
end
local d = floor((4*c + 3)/1461)
local e = c - floor(1461*d/4)
local m = floor((5*e + 2)/153)
date.day = e - floor((153*m + 2)/5) + 1
date.month = m + 3 - 12*floor(m/10)
date.year = 100*b + d - 4800 + floor(m/10)
return true
end
local function fix_numbers(numbers, y, m, d, H, M, S, partial, hastime, calendar)
-- Put the result of normalizing the given values in table numbers.
-- The result will have valid m, d values if y is valid; caller checks y.
-- The logic of PHP mktime is followed where m or d can be zero to mean
-- the previous unit, and -1 is the one before that, etc.
-- Positive values carry forward.
local date
if not (1 <= m and m <= 12) then
date = Date(y, 1, 1)
if not date then return end
date = date + ((m - 1) .. 'm')
y, m = date.year, date.month
end
local days_hms
if not partial then
if hastime and H and M and S then
if not (0 <= H and H <= 23 and
0 <= M and M <= 59 and
0 <= S and S <= 59) then
days_hms = hms({ hour = H, minute = M, second = S })
end
end
if days_hms or not (1 <= d and d <= days_in_month(y, m, calendar)) then
date = date or Date(y, m, 1)
if not date then return end
date = date + (d - 1 + (days_hms or 0))
y, m, d = date.year, date.month, date.day
if days_hms then
H, M, S = date.hour, date.minute, date.second
end
end
end
numbers.year = y
numbers.month = m
numbers.day = d
if days_hms then
-- Don't set H unless it was valid because a valid H will set hastime.
numbers.hour = H
numbers.minute = M
numbers.second = S
end
end
local function set_date_from_numbers(date, numbers, options)
-- Set the fields of table date from numeric values.
-- Return true if date is valid.
if type(numbers) ~= 'table' then
return
end
local y = numbers.year or date.year
local m = numbers.month or date.month
local d = numbers.day or date.day
local H = numbers.hour
local M = numbers.minute or date.minute or 0
local S = numbers.second or date.second or 0
local need_fix
if y and m and d then
date.partial = nil
if not (-9999 <= y and y <= 9999 and
1 <= m and m <= 12 and
1 <= d and d <= days_in_month(y, m, date.calendar)) then
if not date.want_fix then
return
end
need_fix = true
end
elseif y and date.partial then
if d or not (-9999 <= y and y <= 9999) then
return
end
if m and not (1 <= m and m <= 12) then
if not date.want_fix then
return
end
need_fix = true
end
else
return
end
if date.partial then
H = nil -- ignore any time
M = nil
S = nil
else
if H then
-- It is not possible to set M or S without also setting H.
date.hastime = true
else
H = 0
end
if not (0 <= H and H <= 23 and
0 <= M and M <= 59 and
0 <= S and S <= 59) then
if date.want_fix then
need_fix = true
else
return
end
end
end
date.want_fix = nil
if need_fix then
fix_numbers(numbers, y, m, d, H, M, S, date.partial, date.hastime, date.calendar)
return set_date_from_numbers(date, numbers, options)
end
date.year = y -- -9999 to 9999 ('n BC' → year = 1 - n)
date.month = m -- 1 to 12 (may be nil if partial)
date.day = d -- 1 to 31 (* = nil if partial)
date.hour = H -- 0 to 59 (*)
date.minute = M -- 0 to 59 (*)
date.second = S -- 0 to 59 (*)
if type(options) == 'table' then
for _, k in ipairs({ 'am', 'era', 'format' }) do
if options[k] then
date.options[k] = options[k]
end
end
end
return true
end
local function make_option_table(options1, options2)
-- If options1 is a string, return a table with its settings, or
-- if it is a table, use its settings.
-- Missing options are set from table options2 or defaults.
-- If a default is used, a flag is set so caller knows the value was not intentionally set.
-- Valid option settings are:
-- am: 'am', 'a.m.', 'AM', 'A.M.'
-- 'pm', 'p.m.', 'PM', 'P.M.' (each has same meaning as corresponding item above)
-- era: 'BCMINUS', 'BCNEGATIVE', 'BC', 'B.C.', 'BCE', 'B.C.E.', 'AD', 'A.D.', 'CE', 'C.E.'
-- Option am = 'am' does not mean the hour is AM; it means 'am' or 'pm' is used, depending on the hour,
-- and am = 'pm' has the same meaning.
-- Similarly, era = 'BC' means 'BC' is used if year <= 0.
-- BCMINUS displays a MINUS if year < 0 and the display format does not include %{era}.
-- BCNEGATIVE is similar but displays a hyphen.
local result = { bydefault = {} }
if type(options1) == 'table' then
result.am = options1.am
result.era = options1.era
elseif type(options1) == 'string' then
-- Example: 'am:AM era:BC' or 'am=AM era=BC'.
for item in options1:gmatch('%S+') do
local lhs, rhs = item:match('^(%w+)[:=](.+)$')
if lhs then
result[lhs] = rhs
end
end
end
options2 = type(options2) == 'table' and options2 or {}
local defaults = { am = 'am', era = 'BC' }
for k, v in pairs(defaults) do
if not result[k] then
if options2[k] then
result[k] = options2[k]
else
result[k] = v
result.bydefault[k] = true
end
end
end
return result
end
local ampm_options = {
-- lhs = input text accepted as an am/pm option
-- rhs = code used internally
['am'] = 'am',
['AM'] = 'AM',
['a.m.'] = 'a.m.',
['A.M.'] = 'A.M.',
['pm'] = 'am', -- same as am
['PM'] = 'AM',
['p.m.'] = 'a.m.',
['P.M.'] = 'A.M.',
}
local era_text = {
-- Text for displaying an era with a positive year (after adjusting
-- by replacing year with 1 - year if date.year <= 0).
-- options.era = { year<=0 , year>0 }
['BCMINUS'] = { 'BC' , '' , isbc = true, sign = MINUS },
['BCNEGATIVE'] = { 'BC' , '' , isbc = true, sign = '-' },
['BC'] = { 'BC' , '' , isbc = true },
['B.C.'] = { 'B.C.' , '' , isbc = true },
['BCE'] = { 'BCE' , '' , isbc = true },
['B.C.E.'] = { 'B.C.E.', '' , isbc = true },
['AD'] = { 'BC' , 'AD' },
['A.D.'] = { 'B.C.' , 'A.D.' },
['CE'] = { 'BCE' , 'CE' },
['C.E.'] = { 'B.C.E.', 'C.E.' },
}
local function get_era_for_year(era, year)
return (era_text[era] or era_text['BC'])[year > 0 and 2 or 1] or ''
end
local function strftime(date, format, options)
-- Return date formatted as a string using codes similar to those
-- in the C strftime library function.
local sformat = string.format
local shortcuts = {
['%c'] = '%-I:%M %p %-d %B %-Y %{era}', -- date and time: 2:30 pm 1 April 2016
['%x'] = '%-d %B %-Y %{era}', -- date: 1 April 2016
['%X'] = '%-I:%M %p', -- time: 2:30 pm
}
if shortcuts[format] then
format = shortcuts[format]
end
local codes = {
a = { field = 'dayabbr' },
A = { field = 'dayname' },
b = { field = 'monthabbr' },
B = { field = 'monthname' },
u = { fmt = '%d' , field = 'dowiso' },
w = { fmt = '%d' , field = 'dow' },
d = { fmt = '%02d', fmt2 = '%d', field = 'day' },
m = { fmt = '%02d', fmt2 = '%d', field = 'month' },
Y = { fmt = '%04d', fmt2 = '%d', field = 'year' },
H = { fmt = '%02d', fmt2 = '%d', field = 'hour' },
M = { fmt = '%02d', fmt2 = '%d', field = 'minute' },
S = { fmt = '%02d', fmt2 = '%d', field = 'second' },
j = { fmt = '%03d', fmt2 = '%d', field = 'dayofyear' },
I = { fmt = '%02d', fmt2 = '%d', field = 'hour', special = 'hour12' },
p = { field = 'hour', special = 'am' },
}
options = make_option_table(options, date.options)
local amopt = options.am
local eraopt = options.era
local function replace_code(spaces, modifier, id)
local code = codes[id]
if code then
local fmt = code.fmt
if modifier == '-' and code.fmt2 then
fmt = code.fmt2
end
local value = date[code.field]
if not value then
return nil -- an undefined field in a partial date
end
local special = code.special
if special then
if special == 'hour12' then
value = value % 12
value = value == 0 and 12 or value
elseif special == 'am' then
local ap = ({
['a.m.'] = { 'a.m.', 'p.m.' },
['AM'] = { 'AM', 'PM' },
['A.M.'] = { 'A.M.', 'P.M.' },
})[ampm_options[amopt]] or { 'am', 'pm' }
return (spaces == '' and '' or ' ') .. (value < 12 and ap[1] or ap[2])
end
end
if code.field == 'year' then
local sign = (era_text[eraopt] or {}).sign
if not sign or format:find('%{era}', 1, true) then
sign = ''
if value <= 0 then
value = 1 - value
end
else
if value >= 0 then
sign = ''
else
value = -value
end
end
return spaces .. sign .. sformat(fmt, value)
end
return spaces .. (fmt and sformat(fmt, value) or value)
end
end
local function replace_property(spaces, id)
if id == 'era' then
-- Special case so can use local era option.
local result = get_era_for_year(eraopt, date.year)
if result == '' then
return ''
end
return (spaces == '' and '' or ' ') .. result
end
local result = date[id]
if type(result) == 'string' then
return spaces .. result
end
if type(result) == 'number' then
return spaces .. tostring(result)
end
if type(result) == 'boolean' then
return spaces .. (result and '1' or '0')
end
-- This occurs if id is an undefined field in a partial date, or is the name of a function.
return nil
end
local PERCENT = '\127PERCENT\127'
return (format
:gsub('%%%%', PERCENT)
:gsub('(%s*)%%{(%w+)}', replace_property)
:gsub('(%s*)%%(%-?)(%a)', replace_code)
:gsub(PERCENT, '%%')
)
end
local function _date_text(date, fmt, options)
-- Return a formatted string representing the given date.
if not is_date(date) then
error('date:text: need a date (use "date:text()" with a colon)', 2)
end
if type(fmt) == 'string' and fmt:match('%S') then
if fmt:find('%', 1, true) then
return strftime(date, fmt, options)
end
elseif date.partial then
fmt = date.month and 'my' or 'y'
else
fmt = 'dmy'
if date.hastime then
fmt = (date.second > 0 and 'hms ' or 'hm ') .. fmt
end
end
local function bad_format()
-- For consistency with other format processing, return given format
-- (or cleaned format if original was not a string) if invalid.
return mw.text.nowiki(fmt)
end
if date.partial then
-- Ignore days in standard formats like 'ymd'.
if fmt == 'ym' or fmt == 'ymd' then
fmt = date.month and '%Y-%m %{era}' or '%Y %{era}'
elseif fmt == 'my' or fmt == 'dmy' or fmt == 'mdy' then
fmt = date.month and '%B %-Y %{era}' or '%-Y %{era}'
elseif fmt == 'y' then
fmt = date.month and '%-Y %{era}' or '%-Y %{era}'
else
return bad_format()
end
return strftime(date, fmt, options)
end
local function hm_fmt()
local plain = make_option_table(options, date.options).bydefault.am
return plain and '%H:%M' or '%-I:%M %p'
end
local need_time = date.hastime
local t = collection()
for item in fmt:gmatch('%S+') do
local f
if item == 'hm' then
f = hm_fmt()
need_time = false
elseif item == 'hms' then
f = '%H:%M:%S'
need_time = false
elseif item == 'ymd' then
f = '%Y-%m-%d %{era}'
elseif item == 'mdy' then
f = '%B %-d, %-Y %{era}'
elseif item == 'dmy' then
f = '%-d %B %-Y %{era}'
else
return bad_format()
end
t:add(f)
end
fmt = t:join(' ')
if need_time then
fmt = hm_fmt() .. ' ' .. fmt
end
return strftime(date, fmt, options)
end
local day_info = {
-- 0=Sun to 6=Sat
[0] = { 'Sun', 'Sunday' },
{ 'Mon', 'Monday' },
{ 'Tue', 'Tuesday' },
{ 'Wed', 'Wednesday' },
{ 'Thu', 'Thursday' },
{ 'Fri', 'Friday' },
{ 'Sat', 'Saturday' },
}
local month_info = {
-- 1=Jan to 12=Dec
{ 'Jan', 'January' },
{ 'Feb', 'February' },
{ 'Mar', 'March' },
{ 'Apr', 'April' },
{ 'May', 'May' },
{ 'Jun', 'June' },
{ 'Jul', 'July' },
{ 'Aug', 'August' },
{ 'Sep', 'September' },
{ 'Oct', 'October' },
{ 'Nov', 'November' },
{ 'Dec', 'December' },
}
local function name_to_number(text, translate)
if type(text) == 'string' then
return translate[text:lower()]
end
end
local function day_number(text)
return name_to_number(text, {
sun = 0, sunday = 0,
mon = 1, monday = 1,
tue = 2, tuesday = 2,
wed = 3, wednesday = 3,
thu = 4, thursday = 4,
fri = 5, friday = 5,
sat = 6, saturday = 6,
})
end
local function month_number(text)
return name_to_number(text, {
jan = 1, january = 1,
feb = 2, february = 2,
mar = 3, march = 3,
apr = 4, april = 4,
may = 5,
jun = 6, june = 6,
jul = 7, july = 7,
aug = 8, august = 8,
sep = 9, september = 9, sept = 9,
oct = 10, october = 10,
nov = 11, november = 11,
dec = 12, december = 12,
})
end
local function _list_text(list, fmt)
-- Return a list of formatted strings from a list of dates.
if not type(list) == 'table' then
error('date:list:text: need "list:text()" with a colon', 2)
end
local result = { join = _list_join }
for i, date in ipairs(list) do
result[i] = date:text(fmt)
end
return result
end
local function _date_list(date, spec)
-- Return a possibly empty numbered table of dates meeting the specification.
-- Dates in the list are in ascending order (oldest date first).
-- The spec should be a string of form "<count> <day> <op>"
-- where each item is optional and
-- count = number of items wanted in list
-- day = abbreviation or name such as Mon or Monday
-- op = >, >=, <, <= (default is > meaning after date)
-- If no count is given, the list is for the specified days in date's month.
-- The default day is date's day.
-- The spec can also be a positive or negative number:
-- -5 is equivalent to '5 <'
-- 5 is equivalent to '5' which is '5 >'
if not is_date(date) then
error('date:list: need a date (use "date:list()" with a colon)', 2)
end
local list = { text = _list_text }
if date.partial then
return list
end
local count, offset, operation
local ops = {
['>='] = { before = false, include = true },
['>'] = { before = false, include = false },
['<='] = { before = true , include = true },
['<'] = { before = true , include = false },
}
if spec then
if type(spec) == 'number' then
count = floor(spec + 0.5)
if count < 0 then
count = -count
operation = ops['<']
end
elseif type(spec) == 'string' then
local num, day, op = spec:match('^%s*(%d*)%s*(%a*)%s*([<>=]*)%s*$')
if not num then
return list
end
if num ~= '' then
count = tonumber(num)
end
if day ~= '' then
local dow = day_number(day:gsub('[sS]$', '')) -- accept plural days
if not dow then
return list
end
offset = dow - date.dow
end
operation = ops[op]
else
return list
end
end
offset = offset or 0
operation = operation or ops['>']
local datefrom, dayfirst, daylast
if operation.before then
if offset > 0 or (offset == 0 and not operation.include) then
offset = offset - 7
end
if count then
if count > 1 then
offset = offset - 7*(count - 1)
end
datefrom = date + offset
else
daylast = date.day + offset
dayfirst = daylast % 7
if dayfirst == 0 then
dayfirst = 7
end
end
else
if offset < 0 or (offset == 0 and not operation.include) then
offset = offset + 7
end
if count then
datefrom = date + offset
else
dayfirst = date.day + offset
daylast = date.monthdays
end
end
if not count then
if daylast < dayfirst then
return list
end
count = floor((daylast - dayfirst)/7) + 1
datefrom = Date(date, {day = dayfirst})
end
for i = 1, count do
if not datefrom then break end -- exceeds date limits
list[i] = datefrom
datefrom = datefrom + 7
end
return list
end
-- A table to get the current date/time (UTC), but only if needed.
local current = setmetatable({}, {
__index = function (self, key)
local d = os.date('!*t')
self.year = d.year
self.month = d.month
self.day = d.day
self.hour = d.hour
self.minute = d.min
self.second = d.sec
return rawget(self, key)
end })
local function extract_date(newdate, text)
-- Parse the date/time in text and return n, o where
-- n = table of numbers with date/time fields
-- o = table of options for AM/PM or AD/BC or format, if any
-- or return nothing if date is known to be invalid.
-- Caller determines if the values in n are valid.
-- A year must be positive ('1' to '9999'); use 'BC' for BC.
-- In a y-m-d string, the year must be four digits to avoid ambiguity
-- ('0001' to '9999'). The only way to enter year <= 0 is by specifying
-- the date as three numeric parameters like ymd Date(-1, 1, 1).
-- Dates of form d/m/y, m/d/y, y/m/d are rejected as potentially ambiguous.
local date, options = {}, {}
if text:sub(-1) == 'Z' then
-- Extract date/time from a Wikidata timestamp.
-- The year can be 1 to 16 digits but this module handles 1 to 4 digits only.
-- Examples: '+2016-06-21T14:30:00Z', '-0000000180-00-00T00:00:00Z'.
local sign, y, m, d, H, M, S = text:match('^([+%-])(%d+)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)Z$')
if sign then
y = tonumber(y)
if sign == '-' and y > 0 then
y = -y
end
if y <= 0 then
options.era = 'BCE'
end
date.year = y
m = tonumber(m)
d = tonumber(d)
H = tonumber(H)
M = tonumber(M)
S = tonumber(S)
if m == 0 then
newdate.partial = true
return date, options
end
date.month = m
if d == 0 then
newdate.partial = true
return date, options
end
date.day = d
if H > 0 or M > 0 or S > 0 then
date.hour = H
date.minute = M
date.second = S
end
return date, options
end
return
end
local function extract_ymd(item)
-- Called when no day or month has been set.
local y, m, d = item:match('^(%d%d%d%d)%-(%w+)%-(%d%d?)$')
if y then
if date.year then
return
end
if m:match('^%d%d?$') then
m = tonumber(m)
else
m = month_number(m)
end
if m then
date.year = tonumber(y)
date.month = m
date.day = tonumber(d)
return true
end
end
end
local function extract_day_or_year(item)
-- Called when a day would be valid, or
-- when a year would be valid if no year has been set and partial is set.
local number, suffix = item:match('^(%d%d?%d?%d?)(.*)$')
if number then
local n = tonumber(number)
if #number <= 2 and n <= 31 then
suffix = suffix:lower()
if suffix == '' or suffix == 'st' or suffix == 'nd' or suffix == 'rd' or suffix == 'th' then
date.day = n
return true
end
elseif suffix == '' and newdate.partial and not date.year then
date.year = n
return true
end
end
end
local function extract_month(item)
-- A month must be given as a name or abbreviation; a number could be ambiguous.
local m = month_number(item)
if m then
date.month = m
return true
end
end
local function extract_time(item)
local h, m, s = item:match('^(%d%d?):(%d%d)(:?%d*)$')
if date.hour or not h then
return
end
if s ~= '' then
s = s:match('^:(%d%d)$')
if not s then
return
end
end
date.hour = tonumber(h)
date.minute = tonumber(m)
date.second = tonumber(s) -- nil if empty string
return true
end
local item_count = 0
local index_time
local function set_ampm(item)
local H = date.hour
if H and not options.am and index_time + 1 == item_count then
options.am = ampm_options[item] -- caller checked this is not nil
if item:match('^[Aa]') then
if not (1 <= H and H <= 12) then
return
end
if H == 12 then
date.hour = 0
end
else
if not (1 <= H and H <= 23) then
return
end
if H <= 11 then
date.hour = H + 12
end
end
return true
end
end
for item in text:gsub(',', ' '):gsub(' ', ' '):gmatch('%S+') do
item_count = item_count + 1
if era_text[item] then
-- Era is accepted in peculiar places.
if options.era then
return
end
options.era = item
elseif ampm_options[item] then
if not set_ampm(item) then
return
end
elseif item:find(':', 1, true) then
if not extract_time(item) then
return
end
index_time = item_count
elseif date.day and date.month then
if date.year then
return -- should be nothing more so item is invalid
end
if not item:match('^(%d%d?%d?%d?)$') then
return
end
date.year = tonumber(item)
elseif date.day then
if not extract_month(item) then
return
end
elseif date.month then
if not extract_day_or_year(item) then
return
end
elseif extract_month(item) then
options.format = 'mdy'
elseif extract_ymd(item) then
options.format = 'ymd'
elseif extract_day_or_year(item) then
if date.day then
options.format = 'dmy'
end
else
return
end
end
if not date.year or date.year == 0 then
return
end
local era = era_text[options.era]
if era and era.isbc then
date.year = 1 - date.year
end
return date, options
end
local function autofill(date1, date2)
-- Fill any missing month or day in each date using the
-- corresponding component from the other date, if present,
-- or with 1 if both dates are missing the month or day.
-- This gives a good result for calculating the difference
-- between two partial dates when no range is wanted.
-- Return filled date1, date2 (two full dates).
local function filled(a, b)
-- Return date a filled, if necessary, with month and/or day from date b.
-- The filled day is truncated to fit the number of days in the month.
local fillmonth, fillday
if not a.month then
fillmonth = b.month or 1
end
if not a.day then
fillday = b.day or 1
end
if fillmonth or fillday then -- need to create a new date
a = Date(a, {
month = fillmonth,
day = math.min(fillday or a.day, days_in_month(a.year, fillmonth or a.month, a.calendar))
})
end
return a
end
return filled(date1, date2), filled(date2, date1)
end
local function date_add_sub(lhs, rhs, is_sub)
-- Return a new date from calculating (lhs + rhs) or (lhs - rhs),
-- or return nothing if invalid.
-- The result is nil if the calculated date exceeds allowable limits.
-- Caller ensures that lhs is a date; its properties are copied for the new date.
if lhs.partial then
-- Adding to a partial is not supported.
-- Can subtract a date or partial from a partial, but this is not called for that.
return
end
local function is_prefix(text, word, minlen)
local n = #text
return (minlen or 1) <= n and n <= #word and text == word:sub(1, n)
end
local function do_days(n)
local forcetime, jd
if floor(n) == n then
jd = lhs.jd
else
forcetime = not lhs.hastime
jd = lhs.jdz
end
jd = jd + (is_sub and -n or n)
if forcetime then
jd = tostring(jd)
if not jd:find('.', 1, true) then
jd = jd .. '.0'
end
end
return Date(lhs, 'juliandate', jd)
end
if type(rhs) == 'number' then
-- Add/subtract days, including fractional days.
return do_days(rhs)
end
if type(rhs) == 'string' then
-- rhs is a single component like '26m' or '26 months' (with optional sign).
-- Fractions like '3.25d' are accepted for the units which are handled as days.
local sign, numstr, id = rhs:match('^%s*([+-]?)([%d%.]+)%s*(%a+)$')
if sign then
if sign == '-' then
is_sub = not (is_sub and true or false)
end
local y, m, days
local num = tonumber(numstr)
if not num then
return
end
id = id:lower()
if is_prefix(id, 'years') then
y = num
m = 0
elseif is_prefix(id, 'months') then
y = floor(num / 12)
m = num % 12
elseif is_prefix(id, 'weeks') then
days = num * 7
elseif is_prefix(id, 'days') then
days = num
elseif is_prefix(id, 'hours') then
days = num / 24
elseif is_prefix(id, 'minutes', 3) then
days = num / (24 * 60)
elseif is_prefix(id, 'seconds') then
days = num / (24 * 3600)
else
return
end
if days then
return do_days(days)
end
if numstr:find('.', 1, true) then
return
end
if is_sub then
y = -y
m = -m
end
assert(-11 <= m and m <= 11)
y = lhs.year + y
m = lhs.month + m
if m > 12 then
y = y + 1
m = m - 12
elseif m < 1 then
y = y - 1
m = m + 12
end
local d = math.min(lhs.day, days_in_month(y, m, lhs.calendar))
return Date(lhs, y, m, d)
end
end
if is_diff(rhs) then
local days = rhs.age_days
if (is_sub or false) ~= (rhs.isnegative or false) then
days = -days
end
return lhs + days
end
end
local full_date_only = {
dayabbr = true,
dayname = true,
dow = true,
dayofweek = true,
dowiso = true,
dayofweekiso = true,
dayofyear = true,
gsd = true,
juliandate = true,
jd = true,
jdz = true,
jdnoon = true,
}
-- Metatable for a date's calculated fields.
local datemt = {
__index = function (self, key)
if rawget(self, 'partial') then
if full_date_only[key] then return end
if key == 'monthabbr' or key == 'monthdays' or key == 'monthname' then
if not self.month then return end
end
end
local value
if key == 'dayabbr' then
value = day_info[self.dow][1]
elseif key == 'dayname' then
value = day_info[self.dow][2]
elseif key == 'dow' then
value = (self.jdnoon + 1) % 7 -- day-of-week 0=Sun to 6=Sat
elseif key == 'dayofweek' then
value = self.dow
elseif key == 'dowiso' then
value = (self.jdnoon % 7) + 1 -- ISO day-of-week 1=Mon to 7=Sun
elseif key == 'dayofweekiso' then
value = self.dowiso
elseif key == 'dayofyear' then
local first = Date(self.year, 1, 1, self.calendar).jdnoon
value = self.jdnoon - first + 1 -- day-of-year 1 to 366
elseif key == 'era' then
-- Era text (never a negative sign) from year and options.
value = get_era_for_year(self.options.era, self.year)
elseif key == 'format' then
value = self.options.format or 'dmy'
elseif key == 'gsd' then
-- GSD = 1 from 00:00:00 to 23:59:59 on 1 January 1 AD Gregorian calendar,
-- which is from jd 1721425.5 to 1721426.49999.
value = floor(self.jd - 1721424.5)
elseif key == 'juliandate' or key == 'jd' or key == 'jdz' then
local jd, jdz = julian_date(self)
rawset(self, 'juliandate', jd)
rawset(self, 'jd', jd)
rawset(self, 'jdz', jdz)
return key == 'jdz' and jdz or jd
elseif key == 'jdnoon' then
-- Julian date at noon (an integer) on the calendar day when jd occurs.
value = floor(self.jd + 0.5)
elseif key == 'isleapyear' then
value = is_leap_year(self.year, self.calendar)
elseif key == 'monthabbr' then
value = month_info[self.month][1]
elseif key == 'monthdays' then
value = days_in_month(self.year, self.month, self.calendar)
elseif key == 'monthname' then
value = month_info[self.month][2]
end
if value ~= nil then
rawset(self, key, value)
return value
end
end,
}
-- Date operators.
local function mt_date_add(lhs, rhs)
if not is_date(lhs) then
lhs, rhs = rhs, lhs -- put date on left (it must be a date for this to have been called)
end
return date_add_sub(lhs, rhs)
end
local function mt_date_sub(lhs, rhs)
if is_date(lhs) then
if is_date(rhs) then
return DateDiff(lhs, rhs)
end
return date_add_sub(lhs, rhs, true)
end
end
local function mt_date_concat(lhs, rhs)
return tostring(lhs) .. tostring(rhs)
end
local function mt_date_tostring(self)
return self:text()
end
local function mt_date_eq(lhs, rhs)
-- Return true if dates identify same date/time where, for example,
-- Date(-4712, 1, 1, 'Julian') == Date(-4713, 11, 24, 'Gregorian') is true.
-- This is called only if lhs and rhs have the same type and the same metamethod.
if lhs.partial or rhs.partial then
-- One date is partial; the other is a partial or a full date.
-- The months may both be nil, but must be the same.
return lhs.year == rhs.year and lhs.month == rhs.month and lhs.calendar == rhs.calendar
end
return lhs.jdz == rhs.jdz
end
local function mt_date_lt(lhs, rhs)
-- Return true if lhs < rhs, for example,
-- Date('1 Jan 2016') < Date('06:00 1 Jan 2016') is true.
-- This is called only if lhs and rhs have the same type and the same metamethod.
if lhs.partial or rhs.partial then
-- One date is partial; the other is a partial or a full date.
if lhs.calendar ~= rhs.calendar then
return lhs.calendar == 'Julian'
end
if lhs.partial then
lhs = lhs.partial.first
end
if rhs.partial then
rhs = rhs.partial.first
end
end
return lhs.jdz < rhs.jdz
end
--[[ Examples of syntax to construct a date:
Date(y, m, d, 'julian') default calendar is 'gregorian'
Date(y, m, d, H, M, S, 'julian')
Date('juliandate', jd, 'julian') if jd contains "." text output includes H:M:S
Date('currentdate')
Date('currentdatetime')
Date('1 April 1995', 'julian') parse date from text
Date('1 April 1995 AD', 'julian') using an era sets a flag to do the same for output
Date('04:30:59 1 April 1995', 'julian')
Date(date) copy of an existing date
Date(date, t) same, updated with y,m,d,H,M,S fields from table t
Date(t) date with y,m,d,H,M,S fields from table t
]]
function Date(...) -- for forward declaration above
-- Return a table holding a date assuming a uniform calendar always applies
-- (proleptic Gregorian calendar or proleptic Julian calendar), or
-- return nothing if date is invalid.
-- A partial date has a valid year, however its month may be nil, and
-- its day and time fields are nil.
-- Field partial is set to false (if a full date) or a table (if a partial date).
local calendars = { julian = 'Julian', gregorian = 'Gregorian' }
local newdate = {
_id = uniq,
calendar = 'Gregorian', -- default is Gregorian calendar
hastime = false, -- true if input sets a time
hour = 0, -- always set hour/minute/second so don't have to handle nil
minute = 0,
second = 0,
options = {},
list = _date_list,
subtract = function (self, rhs, options)
return DateDiff(self, rhs, options)
end,
text = _date_text,
}
local argtype, datetext, is_copy, jd_number, tnums
local numindex = 0
local numfields = { 'year', 'month', 'day', 'hour', 'minute', 'second' }
local numbers = {}
for _, v in ipairs({...}) do
v = strip_to_nil(v)
local vlower = type(v) == 'string' and v:lower() or nil
if v == nil then
-- Ignore empty arguments after stripping so modules can directly pass template parameters.
elseif calendars[vlower] then
newdate.calendar = calendars[vlower]
elseif vlower == 'partial' then
newdate.partial = true
elseif vlower == 'fix' then
newdate.want_fix = true
elseif is_date(v) then
-- Copy existing date (items can be overridden by other arguments).
if is_copy or tnums then
return
end
is_copy = true
newdate.calendar = v.calendar
newdate.partial = v.partial
newdate.hastime = v.hastime
newdate.options = v.options
newdate.year = v.year
newdate.month = v.month
newdate.day = v.day
newdate.hour = v.hour
newdate.minute = v.minute
newdate.second = v.second
elseif type(v) == 'table' then
if tnums then
return
end
tnums = {}
local tfields = { year=1, month=1, day=1, hour=2, minute=2, second=2 }
for tk, tv in pairs(v) do
if tfields[tk] then
tnums[tk] = tonumber(tv)
end
if tfields[tk] == 2 then
newdate.hastime = true
end
end
else
local num = tonumber(v)
if not num and argtype == 'setdate' and numindex == 1 then
num = month_number(v)
end
if num then
if not argtype then
argtype = 'setdate'
end
if argtype == 'setdate' and numindex < 6 then
numindex = numindex + 1
numbers[numfields[numindex]] = num
elseif argtype == 'juliandate' and not jd_number then
jd_number = num
if type(v) == 'string' then
if v:find('.', 1, true) then
newdate.hastime = true
end
elseif num ~= floor(num) then
-- The given value was a number. The time will be used
-- if the fractional part is nonzero.
newdate.hastime = true
end
else
return
end
elseif argtype then
return
elseif type(v) == 'string' then
if v == 'currentdate' or v == 'currentdatetime' or v == 'juliandate' then
argtype = v
else
argtype = 'datetext'
datetext = v
end
else
return
end
end
end
if argtype == 'datetext' then
if tnums or not set_date_from_numbers(newdate, extract_date(newdate, datetext)) then
return
end
elseif argtype == 'juliandate' then
newdate.partial = nil
newdate.jd = jd_number
if not set_date_from_jd(newdate) then
return
end
elseif argtype == 'currentdate' or argtype == 'currentdatetime' then
newdate.partial = nil
newdate.year = current.year
newdate.month = current.month
newdate.day = current.day
if argtype == 'currentdatetime' then
newdate.hour = current.hour
newdate.minute = current.minute
newdate.second = current.second
newdate.hastime = true
end
newdate.calendar = 'Gregorian' -- ignore any given calendar name
elseif argtype == 'setdate' then
if tnums or not set_date_from_numbers(newdate, numbers) then
return
end
elseif not (is_copy or tnums) then
return
end
if tnums then
newdate.jd = nil -- force recalculation in case jd was set before changes from tnums
if not set_date_from_numbers(newdate, tnums) then
return
end
end
if newdate.partial then
local year = newdate.year
local month = newdate.month
local first = Date(year, month or 1, 1, newdate.calendar)
month = month or 12
local last = Date(year, month, days_in_month(year, month), newdate.calendar)
newdate.partial = { first = first, last = last }
else
newdate.partial = false -- avoid index lookup
end
setmetatable(newdate, datemt)
local readonly = {}
local mt = {
__index = newdate,
__newindex = function(t, k, v) error('date.' .. tostring(k) .. ' is read-only', 2) end,
__add = mt_date_add,
__sub = mt_date_sub,
__concat = mt_date_concat,
__tostring = mt_date_tostring,
__eq = mt_date_eq,
__lt = mt_date_lt,
}
return setmetatable(readonly, mt)
end
local function _diff_age(diff, code, options)
-- Return a tuple of integer values from diff as specified by code, except that
-- each integer may be a list of two integers for a diff with a partial date, or
-- return nil if the code is not supported.
-- If want round, the least significant unit is rounded to nearest whole unit.
-- For a duration, an extra day is added.
local wantround, wantduration, wantrange
if type(options) == 'table' then
wantround = options.round
wantduration = options.duration
wantrange = options.range
else
wantround = options
end
if not is_diff(diff) then
local f = wantduration and 'duration' or 'age'
error(f .. ': need a date difference (use "diff:' .. f .. '()" with a colon)', 2)
end
if diff.partial then
-- Ignore wantround, wantduration.
local function choose(v)
if type(v) == 'table' then
if not wantrange or v[1] == v[2] then
-- Example: Date('partial', 2005) - Date('partial', 2001) gives
-- diff.years = { 3, 4 } to show the range of possible results.
-- If do not want a range, choose the second value as more expected.
return v[2]
end
end
return v
end
if code == 'ym' or code == 'ymd' then
if not wantrange and diff.iszero then
-- This avoids an unexpected result such as
-- Date('partial', 2001) - Date('partial', 2001)
-- giving diff = { years = 0, months = { 0, 11 } }
-- which would be reported as 0 years and 11 months.
return 0, 0
end
return choose(diff.partial.years), choose(diff.partial.months)
end
if code == 'y' then
return choose(diff.partial.years)
end
if code == 'm' or code == 'w' or code == 'd' then
return choose({ diff.partial.mindiff:age(code), diff.partial.maxdiff:age(code) })
end
return nil
end
local extra_days = wantduration and 1 or 0
if code == 'wd' or code == 'w' or code == 'd' then
local offset = wantround and 0.5 or 0
local days = diff.age_days + extra_days
if code == 'wd' or code == 'd' then
days = floor(days + offset)
if code == 'd' then
return days
end
return floor(days/7), days % 7
end
return floor(days/7 + offset)
end
local H, M, S = diff.hours, diff.minutes, diff.seconds
if code == 'dh' or code == 'dhm' or code == 'dhms' or code == 'h' or code == 'hm' or code == 'hms' or code == 'M' or code == 's' then
local days = floor(diff.age_days + extra_days)
local inc_hour
if wantround then
if code == 'dh' or code == 'h' then
if M >= 30 then
inc_hour = true
end
elseif code == 'dhm' or code == 'hm' then
if S >= 30 then
M = M + 1
if M >= 60 then
M = 0
inc_hour = true
end
end
elseif code == 'M' then
if S >= 30 then
M = M + 1
end
else
-- Nothing needed because S is an integer.
end
if inc_hour then
H = H + 1
if H >= 24 then
H = 0
days = days + 1
end
end
end
if code == 'dh' or code == 'dhm' or code == 'dhms' then
if code == 'dh' then
return days, H
elseif code == 'dhm' then
return days, H, M
else
return days, H, M, S
end
end
local hours = days * 24 + H
if code == 'h' then
return hours
elseif code == 'hm' then
return hours, M
elseif code == 'M' or code == 's' then
M = hours * 60 + M
if code == 'M' then
return M
end
return M * 60 + S
end
return hours, M, S
end
if wantround then
local inc_hour
if code == 'ymdh' or code == 'ymwdh' then
if M >= 30 then
inc_hour = true
end
elseif code == 'ymdhm' or code == 'ymwdhm' then
if S >= 30 then
M = M + 1
if M >= 60 then
M = 0
inc_hour = true
end
end
elseif code == 'ymd' or code == 'ymwd' or code == 'yd' or code == 'md' then
if H >= 12 then
extra_days = extra_days + 1
end
end
if inc_hour then
H = H + 1
if H >= 24 then
H = 0
extra_days = extra_days + 1
end
end
end
local y, m, d = diff.years, diff.months, diff.days
if extra_days > 0 then
d = d + extra_days
if d > 28 or code == 'yd' then
-- Recalculate in case have passed a month.
diff = diff.date1 + extra_days - diff.date2
y, m, d = diff.years, diff.months, diff.days
end
end
if code == 'ymd' then
return y, m, d
elseif code == 'yd' then
if y > 0 then
-- It is known that diff.date1 > diff.date2.
diff = diff.date1 - (diff.date2 + (y .. 'y'))
end
return y, floor(diff.age_days)
elseif code == 'md' then
return y * 12 + m, d
elseif code == 'ym' or code == 'm' then
if wantround then
if d >= 16 then
m = m + 1
if m >= 12 then
m = 0
y = y + 1
end
end
end
if code == 'ym' then
return y, m
end
return y * 12 + m
elseif code == 'ymw' then
local weeks = floor(d/7)
if wantround then
local days = d % 7
if days > 3 or (days == 3 and H >= 12) then
weeks = weeks + 1
end
end
return y, m, weeks
elseif code == 'ymwd' then
return y, m, floor(d/7), d % 7
elseif code == 'ymdh' then
return y, m, d, H
elseif code == 'ymwdh' then
return y, m, floor(d/7), d % 7, H
elseif code == 'ymdhm' then
return y, m, d, H, M
elseif code == 'ymwdhm' then
return y, m, floor(d/7), d % 7, H, M
end
if code == 'y' then
if wantround and m >= 6 then
y = y + 1
end
return y
end
return nil
end
local function _diff_duration(diff, code, options)
if type(options) ~= 'table' then
options = { round = options }
end
options.duration = true
return _diff_age(diff, code, options)
end
-- Metatable for some operations on date differences.
diffmt = { -- for forward declaration above
__concat = function (lhs, rhs)
return tostring(lhs) .. tostring(rhs)
end,
__tostring = function (self)
return tostring(self.age_days)
end,
__index = function (self, key)
local value
if key == 'age_days' then
if rawget(self, 'partial') then
local function jdz(date)
return (date.partial and date.partial.first or date).jdz
end
value = jdz(self.date1) - jdz(self.date2)
else
value = self.date1.jdz - self.date2.jdz
end
end
if value ~= nil then
rawset(self, key, value)
return value
end
end,
}
function DateDiff(date1, date2, options) -- for forward declaration above
-- Return a table with the difference between two dates (date1 - date2).
-- The difference is negative if date1 is older than date2.
-- Return nothing if invalid.
-- If d = date1 - date2 then
-- date1 = date2 + d
-- If date1 >= date2 and the dates have no H:M:S time specified then
-- date1 = date2 + (d.years..'y') + (d.months..'m') + d.days
-- where the larger time units are added first.
-- The result of Date(2015,1,x) + '1m' is Date(2015,2,28) for
-- x = 28, 29, 30, 31. That means, for example,
-- d = Date(2015,3,3) - Date(2015,1,31)
-- gives d.years, d.months, d.days = 0, 1, 3 (excluding date1).
if not (is_date(date1) and is_date(date2) and date1.calendar == date2.calendar) then
return
end
local wantfill
if type(options) == 'table' then
wantfill = options.fill
end
local isnegative = false
local iszero = false
if date1 < date2 then
isnegative = true
date1, date2 = date2, date1
elseif date1 == date2 then
iszero = true
end
-- It is known that date1 >= date2 (period is from date2 to date1).
if date1.partial or date2.partial then
-- Two partial dates might have timelines:
---------------------A=================B--- date1 is from A to B inclusive
--------C=======D-------------------------- date2 is from C to D inclusive
-- date1 > date2 iff A > C (date1.partial.first > date2.partial.first)
-- The periods can overlap ('April 2001' - '2001'):
-------------A===B------------------------- A=2001-04-01 B=2001-04-30
--------C=====================D------------ C=2001-01-01 D=2001-12-31
if wantfill then
date1, date2 = autofill(date1, date2)
else
local function zdiff(date1, date2)
local diff = date1 - date2
if diff.isnegative then
return date1 - date1 -- a valid diff in case we call its methods
end
return diff
end
local function getdate(date, which)
return date.partial and date.partial[which] or date
end
local maxdiff = zdiff(getdate(date1, 'last'), getdate(date2, 'first'))
local mindiff = zdiff(getdate(date1, 'first'), getdate(date2, 'last'))
local years, months
if maxdiff.years == mindiff.years then
years = maxdiff.years
if maxdiff.months == mindiff.months then
months = maxdiff.months
else
months = { mindiff.months, maxdiff.months }
end
else
years = { mindiff.years, maxdiff.years }
end
return setmetatable({
date1 = date1,
date2 = date2,
partial = {
years = years,
months = months,
maxdiff = maxdiff,
mindiff = mindiff,
},
isnegative = isnegative,
iszero = iszero,
age = _diff_age,
duration = _diff_duration,
}, diffmt)
end
end
local y1, m1 = date1.year, date1.month
local y2, m2 = date2.year, date2.month
local years = y1 - y2
local months = m1 - m2
local d1 = date1.day + hms(date1)
local d2 = date2.day + hms(date2)
local days, time
if d1 >= d2 then
days = d1 - d2
else
months = months - 1
-- Get days in previous month (before the "to" date) given December has 31 days.
local dpm = m1 > 1 and days_in_month(y1, m1 - 1, date1.calendar) or 31
if d2 >= dpm then
days = d1 - hms(date2)
else
days = dpm - d2 + d1
end
end
if months < 0 then
years = years - 1
months = months + 12
end
days, time = math.modf(days)
local H, M, S = h_m_s(time)
return setmetatable({
date1 = date1,
date2 = date2,
partial = false, -- avoid index lookup
years = years,
months = months,
days = days,
hours = H,
minutes = M,
seconds = S,
isnegative = isnegative,
iszero = iszero,
age = _diff_age,
duration = _diff_duration,
}, diffmt)
end
return {
_current = current,
_Date = Date,
_days_in_month = days_in_month,
}
48b9402c32798b1e9f91f2ab44283ebda7b53ed9
Template:SDcat
10
89
181
2020-08-07T18:02:31Z
wikipedia>MusikBot II
0
Protected "[[Template:SDcat]]": [[Wikipedia:High-risk templates|High-risk template or module]] ([[User:MusikBot II/TemplateProtector|more info]]) ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
wikitext
text/x-wiki
<includeonly>{{#invoke:SDcat |setCat}}</includeonly><noinclude>
{{documentation}}
</noinclude>
8c6e8783ddb0dc699d6fb60370db97b73725b9a6
Template:Code
10
40
82
2020-08-09T22:30:02Z
wikipedia>Bsherr
0
adding comment
wikitext
text/x-wiki
{{#tag:syntaxhighlight|{{{code|{{{1}}}}}}|lang={{{lang|{{{2|text}}}}}}|class={{{class|}}}|id={{{id|}}}|style={{{style|}}}|inline=1}}<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
5d9b1a0980efe1b02eb91bc717438a5ae4a5ee04
Template:Em
10
41
84
2020-08-09T23:17:35Z
wikipedia>Bsherr
0
/* top */as found, replacing [[Template:Tld]] with [[Template:Tlc]] or adding/updating category placement comments, plus general and typo fixes
wikitext
text/x-wiki
<em {{#if:{{{role|}}}|role="{{{role}}}"}} {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} {{#if:{{{style|}}}|style="{{{style}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</em><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
e2fac6fb507a0dd72c4e79d02403049c7d857c8d
Template:Yesno
10
15
32
2020-08-28T03:15:17Z
wikipedia>Xaosflux
0
add additional paramerters, "t", "f" - requested on talk - worked in sandbox /testcases
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|¬}}} }}
|no
|n
|f
|false
|off
|0 = {{{no|<!-- null -->}}}
| = {{{blank|{{{no|<!-- null -->}}}}}}
|¬ = {{{¬|}}}
|yes
|y
|t
|true
|on
|1 = {{{yes|yes}}}
|#default = {{{def|{{{yes|yes}}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
629c2937bc5cf7cfe13cd2a598582af832782399
Module:TNT
828
146
300
2020-08-30T07:28:25Z
wikipedia>Johnuniq
0
Changed protection level for "[[Module:TNT]]": [[WP:High-risk templates|High-risk Lua module]]: per request at [[WP:RFPP]] to match [[Module:Excerpt]] ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
-- Forward declaration of the local functions
local sanitizeDataset, loadData, link, formatMessage
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
table.insert(params, mw.text.trim(v))
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Identical to p.msg() above, but used from other lua modules
-- Parameters: name of dataset, message key, optional arguments
-- Example with 2 params: format('I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.format(dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
return formatMessage(dataset, key, {...})
end
-- Identical to p.msg() above, but used from other lua modules with the language param
-- Parameters: language code, name of dataset, message key, optional arguments
-- Example with 2 params: formatInLanguage('es', I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.formatInLanguage(lang, dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('formatInLanguage', 1, lang, 'string')
checkType('formatInLanguage', 2, dataset, 'string')
checkType('formatInLanguage', 3, key, 'string')
return formatMessage(dataset, key, {...}, lang)
end
-- Obsolete function that adds a 'c:' prefix to the first param.
-- "Sandbox/Sample.tab" -> 'c:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
function p.doc(frame)
local dataset = 'Templatedata/' .. sanitizeDataset(frame.args[1])
return frame:extensionTag('templatedata', p.getTemplateData(dataset)) ..
formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(dataset)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in pairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in pairs(data.data) do
local newVal = {}
local name = nil
for pos, val in pairs(row) do
local columnName = names[pos]
if columnName == 'name' then
name = val
else
newVal[columnName] = val
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
-- Local functions
sanitizeDataset = function(dataset)
if not dataset then
return nil
end
dataset = mw.text.trim(dataset)
if dataset == '' then
return nil
elseif string.sub(dataset,-4) ~= '.tab' then
return dataset .. '.tab'
else
return dataset
end
end
loadData = function(dataset, lang)
dataset = sanitizeDataset(dataset)
if not dataset then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
end
-- Give helpful error to thirdparties who try and copy this module.
if not mw.ext or not mw.ext.data or not mw.ext.data.get then
error('Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:' .. dataset)
end
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(formatMessage(i18nDataset, 'error_bad_dataset', {link(dataset)}))
end
end
return data
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
return 'c:Data:' .. mw.text.trim(dataset or '')
end
formatMessage = function(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params or {}))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(formatMessage(i18nDataset, 'error_bad_msgkey', {key, link(dataset)}))
end
end
return p
9d0d10e54abd232c806dcabccaf03e52858634a1
Module:Anchor
828
36
74
2020-09-24T22:32:51Z
wikipedia>Pppery
0
Add class per edit request
Scribunto
text/plain
-- This module implements {{anchor}}.
local getArgs = require('Module:Arguments').getArgs
local tableTools = require('Module:TableTools')
local p = {}
function p.main(frame)
-- Get the positional arguments from #invoke, remove any nil values,
-- and pass them to p._main.
local args = getArgs(frame)
local argArray = tableTools.compressSparseArray(args)
return p._main(unpack(argArray))
end
function p._main(...)
-- Generate the list of anchors.
local anchors = {...}
local ret = {}
for _, anchor in ipairs(anchors) do
ret[#ret + 1] = '<span class="anchor" id="' .. anchor .. '"></span>'
end
return table.concat(ret)
end
return p
e41d3f5d2f2840528aebb9bac719873540fcb3b8
Module:Effective protection level
828
27
56
2020-09-29T03:38:47Z
wikipedia>Jackmcbarn
0
bring in changes from sandbox
Scribunto
text/plain
local p = {}
-- Returns the permission required to perform a given action on a given title.
-- If no title is specified, the title of the page being displayed is used.
function p._main(action, pagename)
local title
if type(pagename) == 'table' and pagename.prefixedText then
title = pagename
elseif pagename then
title = mw.title.new(pagename)
else
title = mw.title.getCurrentTitle()
end
pagename = title.prefixedText
if action == 'autoreview' then
local level = mw.ext.FlaggedRevs.getStabilitySettings(title)
level = level and level.autoreview
if level == 'review' then
return 'reviewer'
elseif level ~= '' then
return level
else
return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review
end
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' and action ~= 'undelete' then
error( 'First parameter must be one of edit, move, create, upload, undelete, autoreview', 2 )
end
if title.namespace == 8 then -- MediaWiki namespace
if title.text:sub(-3) == '.js' or title.text:sub(-4) == '.css' or title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page
return 'interfaceadmin'
else -- any non-JS/CSS MediaWiki page
return 'sysop'
end
elseif title.namespace == 2 and title.isSubpage then
if title.contentModel == 'javascript' or title.contentModel == 'css' then -- user JS or CSS page
return 'interfaceadmin'
elseif title.contentModel == 'json' then -- user JSON page
return 'sysop'
end
end
if action == 'undelete' then
return 'sysop'
end
local level = title.protectionLevels[action] and title.protectionLevels[action][1]
if level == 'sysop' or level == 'editprotected' then
return 'sysop'
elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page
return 'sysop'
elseif level == 'templateeditor' then
return 'templateeditor'
elseif action == 'move' then
local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move.
if blacklistentry and not blacklistentry.params.autoconfirmed then
return 'templateeditor'
elseif title.namespace == 6 then
return 'filemover'
elseif level == 'extendedconfirmed' then
return 'extendedconfirmed'
else
return 'autoconfirmed'
end
end
local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)
if blacklistentry then
if not blacklistentry.params.autoconfirmed then
return 'templateeditor'
elseif level == 'extendedconfirmed' then
return 'extendedconfirmed'
else
return 'autoconfirmed'
end
elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason
return 'autoconfirmed'
elseif level then
return level
elseif action == 'upload' then
return 'autoconfirmed'
elseif action == 'create' and title.namespace % 2 == 0 and title.namespace ~= 118 then -- You need to be registered, but not autoconfirmed, to create non-talk pages other than drafts
return 'user'
else
return '*'
end
end
setmetatable(p, { __index = function(t, k)
return function(frame)
return t._main(k, frame.args[1])
end
end })
return p
70256a489edf6be9808031b14a7e3ef3e025da97
Template:Short description/test
10
85
172
2020-10-21T17:22:59Z
wikipedia>Jonesey95
0
wrap in nowiki2, since short descriptions do not render wikicode
wikitext
text/x-wiki
<span class="shortdescription nomobile noexcerpt noprint">{{nowiki2|1={{#invoke:WikidataIB|getDescription|{{{1|}}}|qid={{{qid|}}}}}}}</span><noinclude>
{{documentation}}</noinclude>
880c3d2e1319b90060840b592e30fd9d1abdb27e
Template:Cross
10
101
205
2020-11-14T04:41:20Z
wikipedia>Arbitrarily0
0
Arbitrarily0 moved page [[Template:Cross]] to [[Template:Xmark]]: [[Wikipedia:Requested moves|requested move]]; consensus at [[Template talk:Xmark]]
wikitext
text/x-wiki
#REDIRECT [[Template:Xmark]]
{{Redirect category shell|
{{R from move}}
}}
e97e23c5fb1a53fbf972794777b17b669b615ad4
Module:Documentation/styles.css
828
58
118
2020-11-19T20:21:58Z
wikipedia>Izno
0
Changed protection level for "[[Module:Documentation/styles.css]]": actually match module ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
text
text/plain
/* {{pp|small=yes}} */
.documentation,
.documentation-metadata {
border: 1px solid #a2a9b1;
background-color: #ecfcf4;
clear: both;
}
.documentation {
margin: 1em 0 0 0;
padding: 1em;
}
.documentation-metadata {
margin: 0.2em 0; /* same margin left-right as .documentation */
font-style: italic;
padding: 0.4em 1em; /* same padding left-right as .documentation */
}
.documentation-startbox {
padding-bottom: 3px;
border-bottom: 1px solid #aaa;
margin-bottom: 1ex;
}
.documentation-heading {
font-weight: bold;
font-size: 125%;
}
.documentation-clear { /* Don't want things to stick out where they shouldn't. */
clear: both;
}
.documentation-toolbar {
font-style: normal;
font-size: 85%;
}
ce0e629c92e3d825ab9fd927fe6cc37d9117b6cb
Template:Tnull
10
64
130
2020-11-20T18:16:50Z
wikipedia>Primefac
0
Primefac moved page [[Template:Tnull]] to [[Template:Template link null]]: more obvious template name to match family
wikitext
text/x-wiki
#REDIRECT [[Template:Template link null]]
{{Redirect category shell|
{{R from move}}
}}
b22d666a4b16808dc3becc2403546fb9ab5dea7e
Template:Tld
10
66
134
2020-11-20T18:52:18Z
wikipedia>Primefac
0
avoid redir
wikitext
text/x-wiki
#REDIRECT [[Template:Template link code]]
be5d6275ea41d83224503e05901f3405c82141f7
Template:Tlx
10
22
46
2020-11-20T18:53:35Z
wikipedia>Primefac
0
Primefac moved page [[Template:Tlx]] to [[Template:Template link expanded]] over redirect: expand name, make it more obvious
wikitext
text/x-wiki
#REDIRECT [[Template:Template link expanded]]
{{Redirect category shell|
{{R from move}}
}}
1fec988ceb46cb324af228aac45d7cd25fcc9008
Template:Template link expanded
10
23
48
2020-11-21T12:04:41Z
wikipedia>Primefac
0
update
wikitext
text/x-wiki
{{#Invoke:Template link general|main|code=on}}<noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlx}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
6c99696fee02f1da368ed20d2504e19bc15b1c13
Template:Template link code
10
62
126
2020-11-21T12:06:22Z
wikipedia>Primefac
0
update
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nolink=yes|code=yes|nowrap=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlc}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
044f00ca1bfc10cb967c32e893043ccc6f739764
Template:Template link null
10
65
132
2020-11-21T12:06:41Z
wikipedia>Primefac
0
update
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nolink=yes|code=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tnull}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
2167c503e001d24d870ef82a9de0aaa9832404cb
Template:High risk
10
84
170
2021-01-19T20:55:25Z
wikipedia>Elli
0
Added {{[[:Template:R avoided double redirect|R avoided double redirect]]}} tag to redirect
wikitext
text/x-wiki
#REDIRECT [[Template:High-use]]
{{Redirect category shell|
{{R avoided double redirect|1=Template:High-risk}}
{{R from alternative hyphenation|'''{{-r|Template:High-risk}}'''}}{{R from template shortcut}}
}}
ce1776d54ed01e65417b2a4ed18778e32694aa48
Template:Anchor
10
35
72
2021-01-31T22:06:17Z
wikipedia>Plastikspork
0
Fix |=FOO bug where {{anchor|=FOO}} transcludes [[Template:FOO]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:anchor|main}}<noinclude>
{{Documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
7d65122552007ac959072bddfa6f723296c81998
Template:Tl
10
10
22
2021-02-12T22:03:00Z
wikipedia>Anthony Appleyard
0
Anthony Appleyard moved page [[Template:Tl]] to [[Template:Template link]]: [[Special:Permalink/1006428669|Requested]] by Buidhe at [[WP:RM/TR]]: RM closed as move
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
{{Redirect category shell|
{{R from move}}
}}
d6593bb3b4a866249f55d0f34b047a71fe1f1529
Template:Shortcut
10
67
136
2021-02-16T17:54:05Z
wikipedia>Nardog
0
TfM closed
wikitext
text/x-wiki
<includeonly>{{#invoke:Shortcut|main}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
2f2ccc402cde40b1ae056628bffa0852ee01653c
Template:Template shortcut
10
154
316
2021-02-16T17:54:32Z
wikipedia>Nardog
0
TfM closed as convert
wikitext
text/x-wiki
<includeonly>{{#invoke:Shortcut|main|template=yes}}</includeonly><noinclude>{{Documentation}}</noinclude>
bfb2889c4c0ec36294b7b667f5e03350d2df680e
Module:Shortcut/config
828
69
140
2021-02-16T18:43:45Z
wikipedia>Nardog
0
Scribunto
text/plain
-- This module holds configuration data for [[Module:Shortcut]].
return {
-- The heading at the top of the shortcut box. It accepts the following parameter:
-- $1 - the total number of shortcuts. (required)
['shortcut-heading'] = '[[Wikipedia:Shortcut|{{PLURAL:$1|Shortcut|Shortcuts}}]]',
-- The heading when |redirect=yes is given. It accepts the following parameter:
-- $1 - the total number of shortcuts. (required)
['redirect-heading'] = '[[Wikipedia:Redirect|{{PLURAL:$1|Redirect|Redirects}}]]',
-- The error message to display when a shortcut is invalid (is not a string, or
-- is the blank string). It accepts the following parameter:
-- $1 - the number of the shortcut in the argument list. (required)
['invalid-shortcut-error'] = 'shortcut #$1 was invalid (shortcuts must be ' ..
'strings of at least one character in length)',
-- The error message to display when no shortcuts or other displayable content
-- were specified. (required)
['no-content-error'] = 'Error: no shortcuts were specified and the ' ..
mw.text.nowiki('|msg=') ..
' parameter was not set.',
-- A category to add when the no-content-error message is displayed. (optional)
['no-content-error-category'] = 'Shortcut templates with missing parameters',
}
f9d1d94844d5953753eb19e30a3ce389eda3d319
Template:Nowiki2
10
82
166
2021-02-18T18:38:29Z
wikipedia>Jonesey95
0
Reverted 1 edit by [[Special:Contributions/154.133.144.234|154.133.144.234]] ([[User talk:154.133.144.234|talk]]) to last revision by Ans
wikitext
text/x-wiki
{{#if: {{{tag|}}}
| {{#if: {{{style|}}}
| <{{{tag}}} style="{{{style}}}">
| <{{{tag}}}>
}}
}}{{#invoke:LuaCall | call | mw.text.nowiki |\{{{1|}}}<!-- -->}}{{#if: {{{tag|}}}
| </{{{tag}}}>
}}<noinclude>
{{Documentation}}
</noinclude>
2712eeff2099493a4151603b9ed4ea74e51fa6ed
Module:Math
828
138
284
2021-03-11T22:23:48Z
wikipedia>Primefac
0
typo fix
Scribunto
text/plain
--[[
This module provides a number of basic mathematical operations.
]]
local yesno, getArgs -- lazily initialized
local p = {} -- Holds functions to be returned from #invoke, and functions to make available to other Lua modules.
local wrap = {} -- Holds wrapper functions that process arguments from #invoke. These act as intemediary between functions meant for #invoke and functions meant for Lua.
--[[
Helper functions used to avoid redundant code.
]]
local function err(msg)
-- Generates wikitext error messages.
return mw.ustring.format('<strong class="error">Formatting error: %s</strong>', msg)
end
local function unpackNumberArgs(args)
-- Returns an unpacked list of arguments specified with numerical keys.
local ret = {}
for k, v in pairs(args) do
if type(k) == 'number' then
table.insert(ret, v)
end
end
return unpack(ret)
end
local function makeArgArray(...)
-- Makes an array of arguments from a list of arguments that might include nils.
local args = {...} -- Table of arguments. It might contain nils or non-number values, so we can't use ipairs.
local nums = {} -- Stores the numbers of valid numerical arguments.
local ret = {}
for k, v in pairs(args) do
v = p._cleanNumber(v)
if v then
nums[#nums + 1] = k
args[k] = v
end
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[#ret + 1] = args[num]
end
return ret
end
local function fold(func, ...)
-- Use a function on all supplied arguments, and return the result. The function must accept two numbers as parameters,
-- and must return a number as an output. This number is then supplied as input to the next function call.
local vals = makeArgArray(...)
local count = #vals -- The number of valid arguments
if count == 0 then return
-- Exit if we have no valid args, otherwise removing the first arg would cause an error.
nil, 0
end
local ret = table.remove(vals, 1)
for _, val in ipairs(vals) do
ret = func(ret, val)
end
return ret, count
end
--[[
Fold arguments by selectively choosing values (func should return when to choose the current "dominant" value).
]]
local function binary_fold(func, ...)
local value = fold((function(a, b) if func(a, b) then return a else return b end end), ...)
return value
end
--[[
random
Generate a random number
Usage:
{{#invoke: Math | random }}
{{#invoke: Math | random | maximum value }}
{{#invoke: Math | random | minimum value | maximum value }}
]]
function wrap.random(args)
local first = p._cleanNumber(args[1])
local second = p._cleanNumber(args[2])
return p._random(first, second)
end
function p._random(first, second)
math.randomseed(mw.site.stats.edits + mw.site.stats.pages + os.time() + math.floor(os.clock() * 1000000000))
-- math.random will throw an error if given an explicit nil parameter, so we need to use if statements to check the params.
if first and second then
if first <= second then -- math.random doesn't allow the first number to be greater than the second.
return math.random(first, second)
end
elseif first then
return math.random(first)
else
return math.random()
end
end
--[[
order
Determine order of magnitude of a number
Usage:
{{#invoke: Math | order | value }}
]]
function wrap.order(args)
local input_string = (args[1] or args.x or '0');
local input_number = p._cleanNumber(input_string);
if input_number == nil then
return err('order of magnitude input appears non-numeric')
else
return p._order(input_number)
end
end
function p._order(x)
if x == 0 then return 0 end
return math.floor(math.log10(math.abs(x)))
end
--[[
precision
Detemines the precision of a number using the string representation
Usage:
{{ #invoke: Math | precision | value }}
]]
function wrap.precision(args)
local input_string = (args[1] or args.x or '0');
local trap_fraction = args.check_fraction;
local input_number;
if not yesno then
yesno = require('Module:Yesno')
end
if yesno(trap_fraction, true) then -- Returns true for all input except nil, false, "no", "n", "0" and a few others. See [[Module:Yesno]].
local pos = string.find(input_string, '/', 1, true);
if pos ~= nil then
if string.find(input_string, '/', pos + 1, true) == nil then
local denominator = string.sub(input_string, pos+1, -1);
local denom_value = tonumber(denominator);
if denom_value ~= nil then
return math.log10(denom_value);
end
end
end
end
input_number, input_string = p._cleanNumber(input_string);
if input_string == nil then
return err('precision input appears non-numeric')
else
return p._precision(input_string)
end
end
function p._precision(x)
if type(x) == 'number' then
x = tostring(x)
end
x = string.upper(x)
local decimal = x:find('%.')
local exponent_pos = x:find('E')
local result = 0;
if exponent_pos ~= nil then
local exponent = string.sub(x, exponent_pos + 1)
x = string.sub(x, 1, exponent_pos - 1)
result = result - tonumber(exponent)
end
if decimal ~= nil then
result = result + string.len(x) - decimal
return result
end
local pos = string.len(x);
while x:byte(pos) == string.byte('0') do
pos = pos - 1
result = result - 1
if pos <= 0 then
return 0
end
end
return result
end
--[[
max
Finds the maximum argument
Usage:
{{#invoke:Math| max | value1 | value2 | ... }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.max(args)
return p._max(unpackNumberArgs(args))
end
function p._max(...)
local max_value = binary_fold((function(a, b) return a > b end), ...)
if max_value then
return max_value
end
end
--[[
median
Find the median of set of numbers
Usage:
{{#invoke:Math | median | number1 | number2 | ...}}
OR
{{#invoke:Math | median }}
]]
function wrap.median(args)
return p._median(unpackNumberArgs(args))
end
function p._median(...)
local vals = makeArgArray(...)
local count = #vals
table.sort(vals)
if count == 0 then
return 0
end
if p._mod(count, 2) == 0 then
return (vals[count/2] + vals[count/2+1])/2
else
return vals[math.ceil(count/2)]
end
end
--[[
min
Finds the minimum argument
Usage:
{{#invoke:Math| min | value1 | value2 | ... }}
OR
{{#invoke:Math| min }}
When used with no arguments, it takes its input from the parent
frame. Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.min(args)
return p._min(unpackNumberArgs(args))
end
function p._min(...)
local min_value = binary_fold((function(a, b) return a < b end), ...)
if min_value then
return min_value
end
end
--[[
sum
Finds the sum
Usage:
{{#invoke:Math| sum | value1 | value2 | ... }}
OR
{{#invoke:Math| sum }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.sum(args)
return p._sum(unpackNumberArgs(args))
end
function p._sum(...)
local sums, count = fold((function(a, b) return a + b end), ...)
if not sums then
return 0
else
return sums
end
end
--[[
average
Finds the average
Usage:
{{#invoke:Math| average | value1 | value2 | ... }}
OR
{{#invoke:Math| average }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.average(args)
return p._average(unpackNumberArgs(args))
end
function p._average(...)
local sum, count = fold((function(a, b) return a + b end), ...)
if not sum then
return 0
else
return sum / count
end
end
--[[
round
Rounds a number to specified precision
Usage:
{{#invoke:Math | round | value | precision }}
--]]
function wrap.round(args)
local value = p._cleanNumber(args[1] or args.value or 0)
local precision = p._cleanNumber(args[2] or args.precision or 0)
if value == nil or precision == nil then
return err('round input appears non-numeric')
else
return p._round(value, precision)
end
end
function p._round(value, precision)
local rescale = math.pow(10, precision or 0);
return math.floor(value * rescale + 0.5) / rescale;
end
--[[
log10
returns the log (base 10) of a number
Usage:
{{#invoke:Math | log10 | x }}
]]
function wrap.log10(args)
return math.log10(args[1])
end
--[[
mod
Implements the modulo operator
Usage:
{{#invoke:Math | mod | x | y }}
--]]
function wrap.mod(args)
local x = p._cleanNumber(args[1])
local y = p._cleanNumber(args[2])
if not x then
return err('first argument to mod appears non-numeric')
elseif not y then
return err('second argument to mod appears non-numeric')
else
return p._mod(x, y)
end
end
function p._mod(x, y)
local ret = x % y
if not (0 <= ret and ret < y) then
ret = 0
end
return ret
end
--[[
gcd
Calculates the greatest common divisor of multiple numbers
Usage:
{{#invoke:Math | gcd | value 1 | value 2 | value 3 | ... }}
--]]
function wrap.gcd(args)
return p._gcd(unpackNumberArgs(args))
end
function p._gcd(...)
local function findGcd(a, b)
local r = b
local oldr = a
while r ~= 0 do
local quotient = math.floor(oldr / r)
oldr, r = r, oldr - quotient * r
end
if oldr < 0 then
oldr = oldr * -1
end
return oldr
end
local result, count = fold(findGcd, ...)
return result
end
--[[
precision_format
Rounds a number to the specified precision and formats according to rules
originally used for {{template:Rnd}}. Output is a string.
Usage:
{{#invoke: Math | precision_format | number | precision }}
]]
function wrap.precision_format(args)
local value_string = args[1] or 0
local precision = args[2] or 0
return p._precision_format(value_string, precision)
end
function p._precision_format(value_string, precision)
-- For access to Mediawiki built-in formatter.
local lang = mw.getContentLanguage();
local value
value, value_string = p._cleanNumber(value_string)
precision = p._cleanNumber(precision)
-- Check for non-numeric input
if value == nil or precision == nil then
return err('invalid input when rounding')
end
local current_precision = p._precision(value)
local order = p._order(value)
-- Due to round-off effects it is neccesary to limit the returned precision under
-- some circumstances because the terminal digits will be inaccurately reported.
if order + precision >= 14 then
if order + p._precision(value_string) >= 14 then
precision = 13 - order;
end
end
-- If rounding off, truncate extra digits
if precision < current_precision then
value = p._round(value, precision)
current_precision = p._precision(value)
end
local formatted_num = lang:formatNum(math.abs(value))
local sign
-- Use proper unary minus sign rather than ASCII default
if value < 0 then
sign = '−'
else
sign = ''
end
-- Handle cases requiring scientific notation
if string.find(formatted_num, 'E', 1, true) ~= nil or math.abs(order) >= 9 then
value = value * math.pow(10, -order)
current_precision = current_precision + order
precision = precision + order
formatted_num = lang:formatNum(math.abs(value))
else
order = 0;
end
formatted_num = sign .. formatted_num
-- Pad with zeros, if needed
if current_precision < precision then
local padding
if current_precision <= 0 then
if precision > 0 then
local zero_sep = lang:formatNum(1.1)
formatted_num = formatted_num .. zero_sep:sub(2,2)
padding = precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
else
padding = precision - current_precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
end
-- Add exponential notation, if necessary.
if order ~= 0 then
-- Use proper unary minus sign rather than ASCII default
if order < 0 then
order = '−' .. lang:formatNum(math.abs(order))
else
order = lang:formatNum(order)
end
formatted_num = formatted_num .. '<span style="margin:0 .15em 0 .25em">×</span>10<sup>' .. order .. '</sup>'
end
return formatted_num
end
--[[
divide
Implements the division operator
Usage:
{{#invoke:Math | divide | x | y | round= | precision= }}
--]]
function wrap.divide(args)
local x = args[1]
local y = args[2]
local round = args.round
local precision = args.precision
if not yesno then
yesno = require('Module:Yesno')
end
return p._divide(x, y, yesno(round), precision)
end
function p._divide(x, y, round, precision)
if y == nil or y == "" then
return err("Empty divisor")
elseif not tonumber(y) then
if type(y) == 'string' and string.sub(y, 1, 1) == '<' then
return y
else
return err("Not a number: " .. y)
end
elseif x == nil or x == "" then
return err("Empty dividend")
elseif not tonumber(x) then
if type(x) == 'string' and string.sub(x, 1, 1) == '<' then
return x
else
return err("Not a number: " .. x)
end
else
local z = x / y
if round then
return p._round(z, 0)
elseif precision then
return p._round(z, precision)
else
return z
end
end
end
--[[
Helper function that interprets the input numerically. If the
input does not appear to be a number, attempts evaluating it as
a parser functions expression.
]]
function p._cleanNumber(number_string)
if type(number_string) == 'number' then
-- We were passed a number, so we don't need to do any processing.
return number_string, tostring(number_string)
elseif type(number_string) ~= 'string' or not number_string:find('%S') then
-- We were passed a non-string or a blank string, so exit.
return nil, nil;
end
-- Attempt basic conversion
local number = tonumber(number_string)
-- If failed, attempt to evaluate input as an expression
if number == nil then
local success, result = pcall(mw.ext.ParserFunctions.expr, number_string)
if success then
number = tonumber(result)
number_string = tostring(number)
else
number = nil
number_string = nil
end
else
number_string = number_string:match("^%s*(.-)%s*$") -- String is valid but may contain padding, clean it.
number_string = number_string:match("^%+(.*)$") or number_string -- Trim any leading + signs.
if number_string:find('^%-?0[xX]') then
-- Number is using 0xnnn notation to indicate base 16; use the number that Lua detected instead.
number_string = tostring(number)
end
end
return number, number_string
end
--[[
Wrapper function that does basic argument processing. This ensures that all functions from #invoke can use either the current
frame or the parent frame, and it also trims whitespace for all arguments and removes blank arguments.
]]
local mt = { __index = function(t, k)
return function(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return wrap[k](getArgs(frame)) -- Argument processing is left to Module:Arguments. Whitespace is trimmed and blank arguments are removed.
end
end }
return setmetatable(p, mt)
2bbe734d898299f65412963a3c1782e9fcc4d9ca
Template:Template link
10
11
24
2021-03-25T19:03:22Z
wikipedia>Izno
0
[[Wikipedia:Templates for discussion/Log/2021 March 18#Template:Tlu]] closed as keep ([[WP:XFDC#4.0.11|XFDcloser]])
wikitext
text/x-wiki
{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
eabbec62efe3044a98ebb3ce9e7d4d43c222351d
Template:Category link with count
10
79
160
2021-06-11T18:13:44Z
wikipedia>GKFX
0
Support wider range of (valid) input format
wikitext
text/x-wiki
[[:Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|<!--
-->{{#if:{{{name|}}}|{{{name}}}|Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}}}<!--
-->]] ({{PAGESINCATEGORY:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|{{{2|all}}}}})<noinclude>
{{Documentation}}
</noinclude>
f93f1540b8c157703bd6d24ae35c35bef745981d
Module:Pagetype/config
828
93
189
2021-07-10T15:47:32Z
wikipedia>Trialpears
0
Book namespace removal will happen within a few days
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Pagetype configuration data --
-- This page holds localisation and configuration data for Module:Pagetype. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Start configuration data --
--------------------------------------------------------------------------------
-- This table holds the values to use for "main=true", "user=true", etc. Keys to
-- this table should be namespace parameters that can be used with
-- [[Module:Namespace detect]].
cfg.pagetypes = {
['main'] = 'article',
['user'] = 'user page',
['project'] = 'project page',
['wikipedia'] = 'project page',
['wp'] = 'project page',
['file'] = 'file',
['image'] = 'file',
['mediawiki'] = 'interface page',
['template'] = 'template',
['help'] = 'help page',
['category'] = 'category',
['portal'] = 'portal',
['draft'] = 'draft',
['timedtext'] = 'Timed Text page',
['module'] = 'module',
['topic'] = 'topic',
['gadget'] = 'gadget',
['gadget definition'] = 'gadget definition',
['talk'] = 'talk page',
['special'] = 'special page',
['media'] = 'file',
}
-- This table holds the names of the namespaces to be looked up from
-- cfg.pagetypes by default.
cfg.defaultNamespaces = {
'main',
'file',
'template',
'category',
'module'
}
-- This table holds the names of the namespaces to be looked up from
-- cfg.pagetypes if cfg.defaultnsExtended is set.
cfg.extendedNamespaces = {
'main',
'user',
'project',
'file',
'mediawiki',
'template',
'category',
'help',
'portal',
'module',
'draft'
}
-- The parameter name to set which default namespace values to be looked up from
-- cfg.pagetypes.
cfg.defaultns = 'defaultns'
-- The value of cfg.defaultns to set all namespaces, including talk.
cfg.defaultnsAll = 'all'
-- The value of cfg.defaultns to set the namespaces listed in
-- cfg.extendedNamespaces
cfg.defaultnsExtended = 'extended'
-- The value of cfg.defaultns to set no default namespaces.
cfg.defaultnsNone = 'none'
-- The parameter name to use for disambiguation pages page.
cfg.dab = 'dab'
-- This table holds the different possible aliases for disambiguation-class
-- pages. These should be lower-case.
cfg.dabAliases = {
'disambiguation',
'disambig',
'disamb',
'dab'
}
-- The default value for disambiguation pages.
cfg.dabDefault = 'page'
-- The parameter name to use for N/A-class page.
cfg.na = 'na'
-- This table holds the different possible aliases for N/A-class pages. These
-- should be lower-case.
cfg.naAliases = {'na', 'n/a'}
-- The default value for N/A-class pages.
cfg.naDefault = 'page'
-- The parameter name to use for redirects.
cfg.redirect = 'redirect'
-- The default value to use for redirects.
cfg.redirectDefault = 'redirect'
-- The parameter name for undefined namespaces.
cfg.other = 'other'
-- The value used if the module detects an undefined namespace.
cfg.otherDefault = 'page'
-- The usual suffix denoting a plural.
cfg.plural = 's'
-- This table holds plurals not formed by a simple suffix.
cfg.irregularPlurals = {
["category"] = "categories"
}
--------------------------------------------------------------------------------
-- End configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line
e2eb36d6c43611a422bae37947ebeb04b695dcba
Template:Crossreference
10
44
90
2021-07-12T05:56:35Z
wikipedia>SMcCandlish
0
clearer code
wikitext
text/x-wiki
<templatestyles src="Crossreference/styles.css" />{{Hatnote inline
|1={{{1|{{{text|{{{content|<noinclude>sample content</noinclude>}}}}}}}}}
|extraclasses=crossreference {{{class|{{{extraclasses|}}}}}}
|selfref={{#if:{{{selfref|{{{printworthy|{{{unprintworthy|}}}}}}}}}||yes}}
|inline={{{inline|true}}}
}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
b8ac8a6a83bb08330ba0b9f31a7fcd8567217d0e
Template:Hatnote inline
10
46
94
2021-07-12T05:59:40Z
wikipedia>SMcCandlish
0
more readable code
wikitext
text/x-wiki
{{Hatnote inline/invoke
|1={{{1|{{{text|{{{content}}}}}}}}}
|extraclasses={{{class|{{{extraclasses|}}}}}}
|selfref={{#if:{{{printworthy|{{{selfref|}}}}}}||yes}}
|category={{{category|}}}
|inline={{{inline|true}}}
}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
257f3004ea74817011cab7b3bdfd0c87531d7e35
Template:Crossreference/styles.css
10
45
92
2021-07-12T06:50:43Z
wikipedia>SMcCandlish
0
Nope, that had no effect at all.
text
text/plain
/* {{pp-template}} */
/* This snippet just undoes the default "padding-left: 1.6em;" imposed by
div.hatnote, when Template:Crossreference is used in block (div) mode.
Ignore the dumb CSS editor's "Element (div.crossreference) is overqualified"
warning. It is wrong. We do not want to apply any CSS intended for block
mode when it is not in block mode. While it's unlikely our "padding-left: 0;"
does anything wrong in inline (span) mode, we can't guarantee it forever. */
div.crossreference {
padding-left: 0;
}
ae665603577c5dbafbdf190ec9e29f2ed1f7cd77
Module:Hatnote inline
828
48
98
2021-07-12T17:42:32Z
wikipedia>Nihiltres
0
Made substitution fix more specific by limiting to 1 match per substitution-pair
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote-inline --
-- --
-- This module produces hatnote-style links, and links to related articles, --
-- but inside a <span>, instead of the <div> used by Module:Hatnote. It --
-- implements the {{hatnote-inline}} meta-template. --
--------------------------------------------------------------------------------
local mHatnote = require('Module:Hatnote')
local mArguments = require('Module:Arguments')
local yesno = require('Module:Yesno')
local p = {}
function p.hatnoteInline (frame)
local args = mArguments.getArgs(frame)
local hatnote = mHatnote.hatnote(frame)
if args.inline == nil or yesno(args.inline, true) then
local subs = {
['<div'] = '<span',
['</div>$'] = '</span>'
}
for k, v in pairs(subs) do hatnote = string.gsub(hatnote, k, v, 1) end
end
return hatnote
end
p.hatnote = p.hatnoteInline --alias
return p
b5000cd7910b7eae23206235b64880a775e4209b
Module:Hatnote/styles.css
828
30
62
2021-07-12T19:22:27Z
wikipedia>Izno
0
per my talk page
text
text/plain
/* {{pp|small=y}} */
.hatnote {
font-style: italic;
}
/* Limit structure CSS to divs because of [[Module:Hatnote inline]] */
div.hatnote {
/* @noflip */
padding-left: 1.6em;
margin-bottom: 0.5em;
}
.hatnote i {
font-style: normal;
}
/* The templatestyles element inserts a link element before hatnotes.
* TODO: Remove link if/when WMF resolves T200206 */
.hatnote + link + .hatnote {
margin-top: -0.5em;
}
44680ffd6e888866df2cdfa0341af9c7b97da94c
Template:If both
10
119
246
2021-07-27T21:26:23Z
wikipedia>Trialpears
0
substitutable
wikitext
text/x-wiki
{{{{{|safesubst:}}}#if:{{{1|}}}| {{{{{|safesubst:}}}#if:{{{2|}}}|{{{3|}}}|{{{4|}}}}} |{{{4|}}} }}<noinclude>
{{Documentation}}
<!--
PLEASE ADD CATEGORIES AND INTERWIKIS
TO THE /doc SUBPAGE, THANKS
-->
</noinclude>
d77fc191cada8977a8131dd6d85dde5e31d0e6f2
Template:Q
10
49
100
2021-08-16T20:38:04Z
wikipedia>ToBeFree
0
Changed protection settings for "[[Template:Q]]": [[WP:High-risk templates|Highly visible template]] ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
wikitext
text/x-wiki
#REDIRECT [[Template:Wikidata entity link]]
[[Category:Wikidata templates]]
{{Redirect category shell|
{{R from template shortcut}}
{{R from move}}
}}
7f19fdcb2b05d966cd3f0f5f540cf8fa37935869
Template:TemplateData header
10
71
144
2021-08-29T21:32:29Z
wikipedia>SUM1
0
Added "based" parameter to other transclusion
wikitext
text/x-wiki
<div class="templatedata-header">{{#if:{{{noheader|}}}|<!--
noheader:
-->{{Template parameter usage|based=y}}|<!--
+header:
-->This is the {{#if:{{{nolink|}}}|<!--
+header, nolink TD
-->TemplateData|<!--
+header, +link [[TD]]; DEFAULT:
-->[[Wikipedia:TemplateData|TemplateData]]}}<!--
e.o. #if:nolink; DEFAULT:
--> for this template used by [[mw:Extension:TemplateWizard|TemplateWizard]], [[Wikipedia:VisualEditor|VisualEditor]] and other tools. {{Template parameter usage|based=y}}<!--
e.o. #if:noheader
-->}}
'''TemplateData for {{{1|{{BASEPAGENAME}}}}}'''
</div><includeonly><!--
check parameters
-->{{#invoke:Check for unknown parameters|check
|unknown={{template other|1=[[Category:Pages using TemplateData header with unknown parameters|_VALUE_]]}}
|template=Template:TemplateData header
|1 |nolink |noheader
|preview=<div class="error" style="font-weight:normal">Unknown parameter '_VALUE_' in [[Template:TemplateData header]].</div>
}}<!--
-->{{template other|{{sandbox other||
[[Category:Templates using TemplateData]]
}}}}</includeonly><!--
--><noinclude>{{Documentation}}</noinclude>
ddfbb4ae793846b96d4c06330417fa6ed4da2adc
Module:Redirect
828
14
30
2021-09-10T07:46:37Z
wikipedia>Johnuniq
0
restore p.getTargetFromText which is used by [[Module:RfD]] which is causing "Lua error in Module:RfD at line 87: attempt to call upvalue 'getTargetFromText' (a nil value)"
Scribunto
text/plain
-- This module provides functions for getting the target of a redirect page.
local p = {}
-- Gets a mw.title object, using pcall to avoid generating script errors if we
-- are over the expensive function count limit (among other possible causes).
local function getTitle(...)
local success, titleObj = pcall(mw.title.new, ...)
if success then
return titleObj
else
return nil
end
end
-- Gets the name of a page that a redirect leads to, or nil if it isn't a
-- redirect.
function p.getTargetFromText(text)
local target = string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)%]%]"
) or string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)|[^%[%]]-%]%]"
)
return target and mw.uri.decode(target, 'PATH')
end
-- Gets the target of a redirect. If the page specified is not a redirect,
-- returns nil.
function p.getTarget(page, fulltext)
-- Get the title object. Both page names and title objects are allowed
-- as input.
local titleObj
if type(page) == 'string' or type(page) == 'number' then
titleObj = getTitle(page)
elseif type(page) == 'table' and type(page.getContent) == 'function' then
titleObj = page
else
error(string.format(
"bad argument #1 to 'getTarget'"
.. " (string, number, or title object expected, got %s)",
type(page)
), 2)
end
if not titleObj then
return nil
end
local targetTitle = titleObj.redirectTarget
if targetTitle then
if fulltext then
return targetTitle.fullText
else
return targetTitle.prefixedText
end
else
return nil
end
end
--[[
-- Given a single page name determines what page it redirects to and returns the
-- target page name, or the passed page name when not a redirect. The passed
-- page name can be given as plain text or as a page link.
--
-- Returns page name as plain text, or when the bracket parameter is given, as a
-- page link. Returns an error message when page does not exist or the redirect
-- target cannot be determined for some reason.
--]]
function p.luaMain(rname, bracket, fulltext)
if type(rname) ~= "string" or not rname:find("%S") then
return nil
end
bracket = bracket and "[[%s]]" or "%s"
rname = rname:match("%[%[(.+)%]%]") or rname
local target = p.getTarget(rname, fulltext)
local ret = target or rname
ret = getTitle(ret)
if ret then
if fulltext then
ret = ret.fullText
else
ret = ret.prefixedText
end
return bracket:format(ret)
else
return nil
end
end
-- Provides access to the luaMain function from wikitext.
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {frameOnly = true})
return p.luaMain(args[1], args.bracket, args.fulltext) or ''
end
-- Returns true if the specified page is a redirect, and false otherwise.
function p.luaIsRedirect(page)
local titleObj = getTitle(page)
if not titleObj then
return false
end
if titleObj.isRedirect then
return true
else
return false
end
end
-- Provides access to the luaIsRedirect function from wikitext, returning 'yes'
-- if the specified page is a redirect, and the blank string otherwise.
function p.isRedirect(frame)
local args = require('Module:Arguments').getArgs(frame, {frameOnly = true})
if p.luaIsRedirect(args[1]) then
return 'yes'
else
return ''
end
end
return p
a224c45940343d66f49a78b0a39b2045e2c45d20
Template:High use
10
104
211
2021-10-05T19:24:15Z
wikipedia>MusikBot II
0
Protected "[[Template:High use]]": [[Wikipedia:High-risk templates|High-risk template or module]]: 345 transclusions ([[User:MusikBot II/TemplateProtector|more info]]) ([Edit=Require autoconfirmed or confirmed access] (indefinite))
wikitext
text/x-wiki
#Redirect [[Template:High-use]]
{{Redirect category shell|{{R from modification}}{{R from template shortcut}}}}
65ce33c8f2d9659b46256ceb1f7fe57859f66fb2
Module:Unsubst
828
185
387
2021-10-08T18:22:16Z
wikipedia>Trappist the monk
0
sync from sandbox; see [[Module_talk:Unsubst#template_invocation_name_override|talk]];
Scribunto
text/plain
local checkType = require('libraryUtil').checkType
local p = {}
local BODY_PARAM = '$B'
local specialParams = {
['$params'] = 'parameter list',
['$aliases'] = 'parameter aliases',
['$flags'] = 'flags',
['$B'] = 'template content',
['$template-name'] = 'template invocation name override',
}
function p.main(frame, body)
-- If we are substing, this function returns a template invocation, and if
-- not, it returns the template body. The template body can be specified in
-- the body parameter, or in the template parameter defined in the
-- BODY_PARAM variable. This function can be called from Lua or from
-- #invoke.
-- Return the template body if we aren't substing.
if not mw.isSubsting() then
if body ~= nil then
return body
elseif frame.args[BODY_PARAM] ~= nil then
return frame.args[BODY_PARAM]
else
error(string.format(
"no template content specified (use parameter '%s' from #invoke)",
BODY_PARAM
), 2)
end
end
-- Sanity check for the frame object.
if type(frame) ~= 'table'
or type(frame.getParent) ~= 'function'
or not frame:getParent()
then
error(
"argument #1 to 'main' must be a frame object with a parent " ..
"frame available",
2
)
end
-- Find the invocation name.
local mTemplateInvocation = require('Module:Template invocation')
local name
if frame.args['$template-name'] and '' ~= frame.args['$template-name'] then
name = frame.args['$template-name'] -- override whatever the template name is with this name
else
name = mTemplateInvocation.name(frame:getParent():getTitle())
end
-- Combine passed args with passed defaults
local args = {}
if string.find( ','..(frame.args['$flags'] or '')..',', ',%s*override%s*,' ) then
for k, v in pairs( frame:getParent().args ) do
args[k] = v
end
for k, v in pairs( frame.args ) do
if not specialParams[k] then
if v == '__DATE__' then
v = mw.getContentLanguage():formatDate( 'F Y' )
end
args[k] = v
end
end
else
for k, v in pairs( frame.args ) do
if not specialParams[k] then
if v == '__DATE__' then
v = mw.getContentLanguage():formatDate( 'F Y' )
end
args[k] = v
end
end
for k, v in pairs( frame:getParent().args ) do
args[k] = v
end
end
-- Trim parameters, if not specified otherwise
if not string.find( ','..(frame.args['$flags'] or '')..',', ',%s*keep%-whitespace%s*,' ) then
for k, v in pairs( args ) do args[k] = mw.ustring.match(v, '^%s*(.*)%s*$') or '' end
end
-- Pull information from parameter aliases
local aliases = {}
if frame.args['$aliases'] then
local list = mw.text.split( frame.args['$aliases'], '%s*,%s*' )
for k, v in ipairs( list ) do
local tmp = mw.text.split( v, '%s*>%s*' )
aliases[tonumber(mw.ustring.match(tmp[1], '^[1-9][0-9]*$')) or tmp[1]] = ((tonumber(mw.ustring.match(tmp[2], '^[1-9][0-9]*$'))) or tmp[2])
end
end
for k, v in pairs( aliases ) do
if args[k] and ( not args[v] or args[v] == '' ) then
args[v] = args[k]
end
args[k] = nil
end
-- Remove empty parameters, if specified
if string.find( ','..(frame.args['$flags'] or '')..',', ',%s*remove%-empty%s*,' ) then
local tmp = 0
for k, v in ipairs( args ) do
if v ~= '' or ( args[k+1] and args[k+1] ~= '' ) or ( args[k+2] and args[k+2] ~= '' ) then
tmp = k
else
break
end
end
for k, v in pairs( args ) do
if v == '' then
if not (type(k) == 'number' and k < tmp) then args[k] = nil end
end
end
end
-- Order parameters
if frame.args['$params'] then
local params, tmp = mw.text.split( frame.args['$params'], '%s*,%s*' ), {}
for k, v in ipairs(params) do
v = tonumber(mw.ustring.match(v, '^[1-9][0-9]*$')) or v
if args[v] then tmp[v], args[v] = args[v], nil end
end
for k, v in pairs(args) do tmp[k], args[k] = args[k], nil end
args = tmp
end
return mTemplateInvocation.invocation(name, args)
end
p[''] = p.main -- For backwards compatibility
return p
7f01ffc8aa2ac4a4772f14c12e0b77e384ecabb6
Template:If either
10
161
330
2021-10-20T01:50:42Z
wikipedia>MusikBot II
0
Changed protection settings for "[[Template:If either]]": [[Wikipedia:High-risk templates|High-risk template or module]]: 4912 transclusions ([[User:MusikBot II/TemplateProtector|more info]]) ([Edit=Require extended confirmed access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
{{#if:{{{1|}}}
|{{{then|{{{3|}}}}}}
|{{#if:{{{2|}}}
|{{{then|{{{3|}}}}}}
|{{{else|{{{4|}}}}}}
}}
}}<noinclude>
{{Documentation}}
</noinclude>
13d04801b797d6d74d49ef61d8700ad733d481ea
Template:Module other
10
174
365
2021-10-20T19:50:22Z
wikipedia>MusikBot II
0
Changed protection settings for "[[Template:Module other]]": [[Wikipedia:High-risk templates|High-risk template or module]]: 3570 transclusions ([[User:MusikBot II/TemplateProtector|more info]]) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite))
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Module}}
| module
| other
}}
}}
| module = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
503694836c1b07142e63fd35d8be69ec8bb9ffe7
Template:Hatnote inline/invoke
10
47
96
2021-10-22T01:54:39Z
wikipedia>MusikBot II
0
Changed protection settings for "[[Template:Hatnote inline/invoke]]": [[Wikipedia:High-risk templates|High-risk template or module]]: 3213 transclusions ([[User:MusikBot II/TemplateProtector|more info]]) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite))
wikitext
text/x-wiki
<includeonly>{{#invoke:Hatnote inline|hatnote}}</includeonly><noinclude>
{{Documentation|content=This is an includeonly part of [[Template:Hatnote inline]].}}</noinclude>
bcceba0d964fb499427b81aef69b70f463221df3
Template:Main other
10
16
34
2021-12-10T16:08:06Z
wikipedia>Xaosflux
0
<!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! -->
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:0}}
| main
| other
}}
}}
| main = {{{1|}}}
| other
| #default = {{{2|}}}
}}<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! -->
</noinclude>
86ad907ffeea3cc545159e00cd1f2d6433946450
Template:FULLROOTPAGENAME
10
183
383
2022-01-02T08:54:02Z
wikipedia>Dinoguy1000
0
fix "|=foo" bug
wikitext
text/x-wiki
{{ safesubst:<noinclude/>#if: {{ safesubst:<noinclude/>Ns has subpages | {{ safesubst:<noinclude/>#if:{{{1|}}}|{{ safesubst:<noinclude/>NAMESPACE:{{{1}}}}}|{{ safesubst:<noinclude/>NAMESPACE}}}} }}
| {{ safesubst:<noinclude/>#titleparts:{{ safesubst:<noinclude/>#if:{{{1|}}}|{{{1}}}|{{ safesubst:<noinclude/>FULLPAGENAME}}}}|1}}
| {{ safesubst:<noinclude/>#if:{{{1|}}}|{{{1}}}|{{ safesubst:<noinclude/>FULLPAGENAME}}}}
}}<noinclude>
{{documentation}}
</noinclude>
fd0c4e7050dded2d50e5df405e6e5e31dd0d46ac
Template:No redirect
10
54
110
2022-01-02T09:07:18Z
wikipedia>Dinoguy1000
0
fix "|=foo" bug
wikitext
text/x-wiki
{{safesubst:<noinclude/>#if: {{safesubst:<noinclude/>#invoke:Redirect|isRedirect|{{{1}}}}}
| <span class="plainlinks">[{{safesubst:<noinclude/>fullurl:{{{1}}}|redirect=no}} {{{2|{{{1}}}}}}]</span>
| {{safesubst:<noinclude/>#if:{{{2|}}}|[[:{{safesubst:<noinclude/>FULLPAGENAME:{{{1}}}}}|{{{2}}}]]|[[:{{safesubst:<noinclude/>FULLPAGENAME:{{{1}}}}}]]}}
}}<noinclude>
{{documentation}}
</noinclude>
1760035b1bed54ee08b810208ed3551b812dfe13
Template:Pluralize from text
10
135
278
2022-01-09T17:59:39Z
wikipedia>MusikBot II
0
Protected "[[Template:Pluralize from text]]": [[Wikipedia:High-risk templates|High-risk template or module]]: 18336 transclusions ([[User:MusikBot II/TemplateProtector|more info]]) ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
wikitext
text/x-wiki
{{#invoke:Detect singular|pluralize}}<noinclude>{{documentation}}</noinclude>
305f4b531ea5639895c83cecd0fd809f7f5cf845
Module:Infobox/styles.css
828
125
258
2022-01-18T15:18:00Z
wikipedia>Jdlrobson
0
Fix [[phab:T281642]], a pet peeve of mine. This copies across styles from [[MediaWiki:Minerva.css]]
sanitized-css
text/css
/* {{pp|small=y}} */
/*
* This TemplateStyles sheet deliberately does NOT include the full set of
* infobox styles. We are still working to migrate all of the manual
* infoboxes. See [[MediaWiki talk:Common.css/to do#Infobox]]
* DO NOT ADD THEM HERE
*/
/*
* not strictly certain these styles are necessary since the modules now
* exclusively output infobox-subbox or infobox, not both
* just replicating the module faithfully
*/
.infobox-subbox {
padding: 0;
border: none;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
}
.infobox-3cols-child {
margin: auto;
}
.infobox .navbar {
font-size: 100%;
}
/* T281642 */
body.skin-minerva .infobox-header,
body.skin-minerva .infobox-subheader,
body.skin-minerva .infobox-above,
body.skin-minerva .infobox-title,
body.skin-minerva .infobox-image,
body.skin-minerva .infobox-full-data,
body.skin-minerva .infobox-below {
text-align: center;
}
e8de6d96f4fde53afc4a6b0fed534405ab59b0a7
Module:Citation/CS1/Utilities
828
114
236
2022-01-22T14:11:16Z
wikipedia>Trappist the monk
0
update per [[Wikipedia:Village_pump_(proposals)#rfc:_shall_we_update_cs1/2?|RfC]];
Scribunto
text/plain
local z = {
error_cats_t = {}; -- for categorizing citations that contain errors
error_ids_t = {}; -- list of error identifiers; used to prevent duplication of certain errors; local to this module
error_msgs_t = {}; -- sequence table of error messages
maint_cats_t = {}; -- for categorizing citations that aren't erroneous per se, but could use a little work
prop_cats_t = {}; -- for categorizing citations based on certain properties, language of source for instance
prop_keys_t = {}; -- for adding classes to the citation's <cite> tag
};
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set (var)
return not (var == nil or var == '');
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array (needle, haystack)
if needle == nil then
return false;
end
for n, v in ipairs (haystack) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< H A S _ A C C E P T _ A S _ W R I T T E N >------------------------------------
When <str> is wholly wrapped in accept-as-written markup, return <str> without markup and true; return <str> and false else
with allow_empty = false, <str> must have at least one character inside the markup
with allow_empty = true, <str> the markup frame can be empty like (()) to distinguish an empty template parameter from the specific condition "has no applicable value" in citation-context.
After further evaluation the two cases might be merged at a later stage, but should be kept separated for now.
]]
local function has_accept_as_written (str, allow_empty)
if not is_set (str) then
return str, false;
end
local count;
if true == allow_empty then
str, count = str:gsub ('^%(%((.*)%)%)$', '%1'); -- allows (()) to be an empty set
else
str, count = str:gsub ('^%(%((.+)%)%)$', '%1');
end
return str, 0 ~= count;
end
--[[--------------------------< S U B S T I T U T E >----------------------------------------------------------
Populates numbered arguments in a message string using an argument table. <args> may be a single string or a
sequence table of multiple strings.
]]
local function substitute (msg, args)
return args and mw.message.newRawMessage (msg, args):plain() or msg;
end
--[[--------------------------< E R R O R _ C O M M E N T >----------------------------------------------------
Wraps error messages with CSS markup according to the state of hidden. <content> may be a single string or a
sequence table of multiple strings.
]]
local function error_comment (content, hidden)
return substitute (hidden and cfg.presentation['hidden-error'] or cfg.presentation['visible-error'], content);
end
--[[--------------------------< H Y P H E N _ T O _ D A S H >--------------------------------------------------
Converts a hyphen to a dash under certain conditions. The hyphen must separate
like items; unlike items are returned unmodified. These forms are modified:
letter - letter (A - B)
digit - digit (4-5)
digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)
letterdigit - letterdigit (A1-A5) (an optional separator between letter and
digit is supported – a.1-a.5 or a-1-a-5)
digitletter - digitletter (5a - 5d) (an optional separator between letter and
digit is supported – 5.a-5.d or 5-a-5-d)
any other forms are returned unmodified.
str may be a comma- or semicolon-separated list
]]
local function hyphen_to_dash (str)
if not is_set (str) then
return str;
end
local accept; -- boolean
str = str:gsub ("(%(%(.-%)%))", function(m) return m:gsub(",", ","):gsub(";", ";") end) -- replace commas and semicolons in accept-as-written markup with similar unicode characters so they'll be ignored during the split
str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—'] = '—'}); -- replace — and – entities with their characters; semicolon mucks up the text.split
str = str:gsub ('-', '-'); -- replace HTML numeric entity with hyphen character
str = str:gsub (' ', ' '); -- replace entity with generic keyboard space character
local out = {};
local list = mw.text.split (str, '%s*[,;]%s*'); -- split str at comma or semicolon separators if there are any
for _, item in ipairs (list) do -- for each item in the list
item, accept = has_accept_as_written (item); -- remove accept-this-as-written markup when it wraps all of item
if not accept and mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators
if item:match ('^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit)
item:match ('^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter)
item:match ('^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$') or -- digit separator digit hyphen digit separator digit
item:match ('^%d+%s*%-%s*%d+$') or -- digit hyphen digit
item:match ('^%a+%s*%-%s*%a+$') then -- letter hyphen letter
item = item:gsub ('(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)', '%1–%2'); -- replace hyphen, remove extraneous space characters
else
item = mw.ustring.gsub (item, '%s*[–—]%s*', '–'); -- for endash or emdash separated ranges, replace em with en, remove extraneous whitespace
end
end
table.insert (out, item); -- add the (possibly modified) item to the output table
end
local temp_str = ''; -- concatenate the output table into a comma separated string
temp_str, accept = has_accept_as_written (table.concat (out, ', ')); -- remove accept-this-as-written markup when it wraps all of concatenated out
if accept then
temp_str = has_accept_as_written (str); -- when global markup removed, return original str; do it this way to suppress boolean second return value
return temp_str:gsub(",", ","):gsub(";", ";");
else
return temp_str:gsub(",", ","):gsub(";", ";"); -- else, return assembled temp_str
end
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided (or link and display are the same), returns a wikilink in the form [[L]]; if neither are
provided or link is omitted, returns an empty string.
]=]
local function make_wikilink (link, display)
if not is_set (link) then return '' end
if is_set (display) and link ~= display then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
end
--[[--------------------------< S E T _ M E S S A G E >----------------------------------------------------------
Sets an error message using the ~/Configuration error_conditions{} table along with arguments supplied in the function
call, inserts the resulting message in z.error_msgs_t{} sequence table, and returns the error message.
<error_id> – key value for appropriate error handler in ~/Configuration error_conditions{} table
<arguments> – may be a single string or a sequence table of multiple strings to be subsititued into error_conditions[error_id].message
<raw> – boolean
true – causes this function to return the error message not wrapped in visible-error, hidden-error span tag;
returns error_conditions[error_id].hidden as a second return value
does not add message to z.error_msgs_t sequence table
false, nil – adds message wrapped in visible-error, hidden-error span tag to z.error_msgs_t
returns the error message wrapped in visible-error, hidden-error span tag; there is no second return value
<prefix> – string to be prepended to <message> -- TODO: remove support for these unused(?) arguments?
<suffix> – string to be appended to <message>
TODO: change z.error_cats_t and z.maint_cats_t to have the form cat_name = true? this to avoid dups without having to have an extra table
]]
local added_maint_cats = {} -- list of maintenance categories that have been added to z.maint_cats_t; TODO: figure out how to delete this table
local function set_message (error_id, arguments, raw, prefix, suffix)
local error_state = cfg.error_conditions[error_id];
prefix = prefix or '';
suffix = suffix or '';
if error_state == nil then
error (cfg.messages['undefined_error'] .. ': ' .. error_id); -- because missing error handler in Module:Citation/CS1/Configuration
elseif is_set (error_state.category) then
if error_state.message then -- when error_state.message defined, this is an error message
table.insert (z.error_cats_t, error_state.category);
else
if not added_maint_cats[error_id] then
added_maint_cats[error_id] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (error_state.category, arguments)); -- make cat name then add to table
end
return; -- because no message, nothing more to do
end
end
local message = substitute (error_state.message, arguments);
message = table.concat (
{
message,
' (',
make_wikilink (
table.concat (
{
cfg.messages['help page link'],
'#',
error_state.anchor
}),
cfg.messages['help page label']),
')'
});
z.error_ids_t[error_id] = true;
if z.error_ids_t['err_citation_missing_title'] and -- if missing-title error already noted
in_array (error_id, {'err_bare_url_missing_title', 'err_trans_missing_title'}) then -- and this error is one of these
return '', false; -- don't bother because one flavor of missing title is sufficient
end
message = table.concat ({prefix, message, suffix});
if true == raw then
return message, error_state.hidden; -- return message not wrapped in visible-error, hidden-error span tag
end
message = error_comment (message, error_state.hidden); -- wrap message in visible-error, hidden-error span tag
table.insert (z.error_msgs_t, message); -- add it to the messages sequence table
return message; -- and done; return value generally not used but is used as a flag in various functions of ~/Identifiers
end
--[[-------------------------< I S _ A L I A S _ U S E D >-----------------------------------------------------
This function is used by select_one() to determine if one of a list of alias parameters is in the argument list
provided by the template.
Input:
args – pointer to the arguments table from calling template
alias – one of the list of possible aliases in the aliases lists from Module:Citation/CS1/Configuration
index – for enumerated parameters, identifies which one
enumerated – true/false flag used to choose how enumerated aliases are examined
value – value associated with an alias that has previously been selected; nil if not yet selected
selected – the alias that has previously been selected; nil if not yet selected
error_list – list of aliases that are duplicates of the alias already selected
Returns:
value – value associated with alias we selected or that was previously selected or nil if an alias not yet selected
selected – the alias we selected or the alias that was previously selected or nil if an alias not yet selected
]]
local function is_alias_used (args, alias, index, enumerated, value, selected, error_list)
if enumerated then -- is this a test for an enumerated parameters?
alias = alias:gsub ('#', index); -- replace '#' with the value in index
else
alias = alias:gsub ('#', ''); -- remove '#' if it exists
end
if is_set (args[alias]) then -- alias is in the template's argument list
if value ~= nil and selected ~= alias then -- if we have already selected one of the aliases
local skip;
for _, v in ipairs (error_list) do -- spin through the error list to see if we've added this alias
if v == alias then
skip = true;
break; -- has been added so stop looking
end
end
if not skip then -- has not been added so
table.insert (error_list, alias); -- add error alias to the error list
end
else
value = args[alias]; -- not yet selected an alias, so select this one
selected = alias;
end
end
return value, selected; -- return newly selected alias, or previously selected alias
end
--[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
Adds a category to z.maint_cats_t using names from the configuration file with additional text if any.
To prevent duplication, the added_maint_cats table lists the categories by key that have been added to z.maint_cats_t.
]]
local function add_maint_cat (key, arguments)
if not added_maint_cats [key] then
added_maint_cats [key] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (cfg.maint_cats [key], arguments)); -- make name then add to table
end
end
--[[--------------------------< A D D _ P R O P _ C A T >--------------------------------------------------------
Adds a category to z.prop_cats_t using names from the configuration file with additional text if any.
foreign_lang_source and foreign_lang_source_2 keys have a language code appended to them so that multiple languages
may be categorized but multiples of the same language are not categorized.
added_prop_cats is a table declared in page scope variables above
]]
local added_prop_cats = {}; -- list of property categories that have been added to z.prop_cats_t
local function add_prop_cat (key, arguments, key_modifier)
local key_modified = key .. ((key_modifier and key_modifier) or ''); -- modify <key> with <key_modifier> if present and not nil
if not added_prop_cats [key_modified] then
added_prop_cats [key_modified] = true; -- note that we've added this category
table.insert (z.prop_cats_t, substitute (cfg.prop_cats [key], arguments)); -- make name then add to table
table.insert (z.prop_keys_t, 'cs1-prop-' .. key); -- convert key to class for use in the citation's <cite> tag
end
end
--[[--------------------------< S A F E _ F O R _ I T A L I C S >----------------------------------------------
Protects a string that will be wrapped in wiki italic markup '' ... ''
Note: We cannot use <i> for italics, as the expected behavior for italics specified by ''...'' in the title is that
they will be inverted (i.e. unitalicized) in the resulting references. In addition, <i> and '' tend to interact
poorly under Mediawiki's HTML tidy.
]]
local function safe_for_italics (str)
if not is_set (str) then return str end
if str:sub (1, 1) == "'" then str = "<span></span>" .. str; end
if str:sub (-1, -1) == "'" then str = str .. "<span></span>"; end
return str:gsub ('\n', ' '); -- Remove newlines as they break italics.
end
--[[--------------------------< W R A P _ S T Y L E >----------------------------------------------------------
Applies styling to various parameters. Supplied string is wrapped using a message_list configuration taking one
argument; protects italic styled parameters. Additional text taken from citation_config.presentation - the reason
this function is similar to but separate from wrap_msg().
]]
local function wrap_style (key, str)
if not is_set (str) then
return "";
elseif in_array (key, {'italic-title', 'trans-italic-title'}) then
str = safe_for_italics (str);
end
return substitute (cfg.presentation[key], {str});
end
--[[--------------------------< M A K E _ S E P _ L I S T >------------------------------------------------------------
make a separated list of items using provided separators.
<sep_list> - typically '<comma><space>'
<sep_list_pair> - typically '<space>and<space>'
<sep_list_end> - typically '<comma><space>and<space>' or '<comma><space>&<space>'
defaults to cfg.presentation['sep_list'], cfg.presentation['sep_list_pair'], and cfg.presentation['sep_list_end']
if <sep_list_end> is specified, <sep_list> and <sep_list_pair> must also be supplied
]]
local function make_sep_list (count, list_seq, sep_list, sep_list_pair, sep_list_end)
local list = '';
if not sep_list then -- set the defaults
sep_list = cfg.presentation['sep_list'];
sep_list_pair = cfg.presentation['sep_list_pair'];
sep_list_end = cfg.presentation['sep_list_end'];
end
if 2 >= count then
list = table.concat (list_seq, sep_list_pair); -- insert separator between two items; returns list_seq[1] then only one item
elseif 2 < count then
list = table.concat (list_seq, sep_list, 1, count - 1); -- concatenate all but last item with plain list separator
list = table.concat ({list, list_seq[count]}, sep_list_end); -- concatenate last item onto end of <list> with final separator
end
return list;
end
--[[--------------------------< S E L E C T _ O N E >----------------------------------------------------------
Chooses one matching parameter from a list of parameters to consider. The list of parameters to consider is just
names. For parameters that may be enumerated, the position of the numerator in the parameter name is identified
by the '#' so |author-last1= and |author1-last= are represented as 'author-last#' and 'author#-last'.
Because enumerated parameter |<param>1= is an alias of |<param>= we must test for both possibilities.
Generates an error if more than one match is present.
]]
local function select_one (args, aliases_list, error_condition, index)
local value = nil; -- the value assigned to the selected parameter
local selected = ''; -- the name of the parameter we have chosen
local error_list = {};
if index ~= nil then index = tostring(index); end
for _, alias in ipairs (aliases_list) do -- for each alias in the aliases list
if alias:match ('#') then -- if this alias can be enumerated
if '1' == index then -- when index is 1 test for enumerated and non-enumerated aliases
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- first test for non-enumerated alias
end
value, selected = is_alias_used (args, alias, index, true, value, selected, error_list); -- test for enumerated alias
else
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- test for non-enumerated alias
end
end
if #error_list > 0 and 'none' ~= error_condition then -- for cases where this code is used outside of extract_names()
for i, v in ipairs (error_list) do
error_list[i] = wrap_style ('parameter', v);
end
table.insert (error_list, wrap_style ('parameter', selected));
set_message (error_condition, {make_sep_list (#error_list, error_list)});
end
return value, selected;
end
--[=[-------------------------< R E M O V E _ W I K I _ L I N K >----------------------------------------------
Gets the display text from a wikilink like [[A|B]] or [[B]] gives B
The str:gsub() returns either A|B froma [[A|B]] or B from [[B]] or B from B (no wikilink markup).
In l(), l:gsub() removes the link and pipe (if they exist); the second :gsub() trims whitespace from the label
if str was wrapped in wikilink markup. Presumably, this is because without wikimarkup in str, there is no match
in the initial gsub, the replacement function l() doesn't get called.
]=]
local function remove_wiki_link (str)
return (str:gsub ("%[%[([^%[%]]*)%]%]", function(l)
return l:gsub ("^[^|]*|(.*)$", "%1" ):gsub ("^%s*(.-)%s*$", "%1");
end));
end
--[=[-------------------------< I S _ W I K I L I N K >--------------------------------------------------------
Determines if str is a wikilink, extracts, and returns the wikilink type, link text, and display text parts.
If str is a complex wikilink ([[L|D]]):
returns wl_type 2 and D and L from [[L|D]];
if str is a simple wikilink ([[D]])
returns wl_type 1 and D from [[D]] and L as empty string;
if not a wikilink:
returns wl_type 0, str as D, and L as empty string.
trims leading and trailing whitespace and pipes from L and D ([[L|]] and [[|D]] are accepted by MediaWiki and
treated like [[D]]; while [[|D|]] is not accepted by MediaWiki, here, we accept it and return D without the pipes).
]=]
local function is_wikilink (str)
local D, L
local wl_type = 2; -- assume that str is a complex wikilink [[L|D]]
if not str:match ('^%[%[[^%]]+%]%]$') then -- is str some sort of a wikilink (must have some sort of content)
return 0, str, ''; -- not a wikilink; return wl_type as 0, str as D, and empty string as L
end
L, D = str:match ('^%[%[([^|]+)|([^%]]+)%]%]$'); -- get L and D from [[L|D]]
if not is_set (D) then -- if no separate display
D = str:match ('^%[%[([^%]]*)|*%]%]$'); -- get D from [[D]] or [[D|]]
wl_type = 1;
end
D = mw.text.trim (D, '%s|'); -- trim white space and pipe characters
return wl_type, D, L or '';
end
--[[--------------------------< S T R I P _ A P O S T R O P H E _ M A R K U P >--------------------------------
Strip wiki italic and bold markup from argument so that it doesn't contaminate COinS metadata.
This function strips common patterns of apostrophe markup. We presume that editors who have taken the time to
markup a title have, as a result, provided valid markup. When they don't, some single apostrophes are left behind.
Returns the argument without wiki markup and a number; the number is more-or-less meaningless except as a flag
to indicate that markup was replaced; do not rely on it as an indicator of how many of any kind of markup was
removed; returns the argument and nil when no markup removed
]]
local function strip_apostrophe_markup (argument)
if not is_set (argument) then
return argument, nil; -- no argument, nothing to do
end
if nil == argument:find ( "''", 1, true ) then -- Is there at least one double apostrophe? If not, exit.
return argument, nil;
end
local flag;
while true do
if argument:find ("'''''", 1, true) then -- bold italic (5)
argument, flag = argument:gsub ("%'%'%'%'%'", ""); -- remove all instances of it
elseif argument:find ("''''", 1, true) then -- italic start and end without content (4)
argument, flag=argument:gsub ("%'%'%'%'", "");
elseif argument:find ("'''", 1, true) then -- bold (3)
argument, flag=argument:gsub ("%'%'%'", "");
elseif argument:find ("''", 1, true) then -- italic (2)
argument, flag = argument:gsub ("%'%'", "");
else
break;
end
end
return argument, flag; -- done
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr)
cfg = cfg_table_ptr;
end
--[[--------------------------< E X P O R T S >----------------------------------------------------------------
]]
return {
add_maint_cat = add_maint_cat, -- exported functions
add_prop_cat = add_prop_cat,
error_comment = error_comment,
has_accept_as_written = has_accept_as_written,
hyphen_to_dash = hyphen_to_dash,
in_array = in_array,
is_set = is_set,
is_wikilink = is_wikilink,
make_sep_list = make_sep_list,
make_wikilink = make_wikilink,
remove_wiki_link = remove_wiki_link,
safe_for_italics = safe_for_italics,
select_one = select_one,
set_message = set_message,
set_selected_modules = set_selected_modules,
strip_apostrophe_markup = strip_apostrophe_markup,
substitute = substitute,
wrap_style = wrap_style,
z = z, -- exported table
}
b006801b48981b2987f20fc09cbe0dfda525e044
Template:SDcat/doc
10
90
183
2022-01-23T09:54:20Z
wikipedia>Christian75
0
{{High risk}}
wikitext
text/x-wiki
{{Documentation subpage}}
{{High risk}}
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{lua|Module:SDcat}}
This template is merely a wrapper for [[Module:SDcat]], which adds tracking categories to articles depending on whether their [[WP:short description|short description]] matches the associated description field on Wikidata. Complete documentation is available at [[Module:SDcat]].
== Usage ==
<code><nowiki>{{SDcat |sd={{{shortdescription|}}} }}</nowiki></code>
=== For testing ===
<code><nowiki>{{SDcat |sd=short description |qid=Wikidata entity ID |lp=link prefix (usually ":") }}</nowiki></code>
<includeonly>{{sandbox other||
<!-- Categories below this line; interwikis at Wikidata -->
[[Category:WikiProject Short descriptions]]
}}</includeonly>
2a2e572b915cc316e39d344979cbca621b80c828
Module:Documentation/config
828
57
116
2022-01-25T23:46:11Z
wikipedia>Ianblair23
0
link
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
cfg['sandbox-notice-compare-link-display'] = 'diff'
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
cfg['sandbox-notice-testcases-link-display'] = 'test cases'
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
cfg['sandbox-notice-testcases-run-link-display'] = 'run'
-- cfg['sandbox-category']
-- A category to add to all template sandboxes.
cfg['sandbox-category'] = 'Template sandboxes'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Help:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
71b68ed73088f1a59d61acf06bbee9fde6677f03
Module:TableTools
828
21
44
2022-01-31T13:08:18Z
wikipedia>MSGJ
0
updates/fixes requested by [[User:Uzume]]
Scribunto
text/plain
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should not --
-- be called directly from #invoke. --
------------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
function p.isPositiveInteger(v)
return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity
end
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false if
-- not. Although it doesn't operate on tables, it is included here as it is useful
-- for determining whether a value can be a valid table key. Lua will generate an
-- error if a NaN is used as a table key.
------------------------------------------------------------------------------------
function p.isNan(v)
return type(v) == 'number' and v ~= v
end
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
function p.shallowClone(t)
checkType('shallowClone', 1, t, 'table')
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
function p.removeDuplicates(arr)
checkType('removeDuplicates', 1, arr, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for _, v in ipairs(arr) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will return
-- {1, 3, 6}.
------------------------------------------------------------------------------------
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like {"foo1", "bar1", "foo2", "baz2"}, returns a table
-- of subtables in the format
-- {[1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'}}.
-- Keys that don't end with an integer are stored in a subtable named "other". The
-- compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for _ in pairs(t) do
i = i + 1
end
return i
end
local function defaultKeySort(item1, item2)
-- "number" < "string", so numbers will be sorted before strings.
local type1, type2 = type(item1), type(item2)
if type1 ~= type2 then
return type1 < type2
elseif type1 == 'table' or type1 == 'boolean' or type1 == 'function' then
return tostring(item1) < tostring(item2)
else
return item1 < item2
end
end
------------------------------------------------------------------------------------
-- keysToList
--
-- Returns an array of the keys in a table, sorted using either a default
-- comparison function or a custom keySort function.
------------------------------------------------------------------------------------
function p.keysToList(t, keySort, checked)
if not checked then
checkType('keysToList', 1, t, 'table')
checkTypeMulti('keysToList', 2, keySort, {'function', 'boolean', 'nil'})
end
local arr = {}
local index = 1
for k in pairs(t) do
arr[index] = k
index = index + 1
end
if keySort ~= false then
keySort = type(keySort) == 'function' and keySort or defaultKeySort
table.sort(arr, keySort)
end
return arr
end
------------------------------------------------------------------------------------
-- sortedPairs
--
-- Iterates through a table, with the keys sorted using the keysToList function.
-- If there are only numerical keys, sparseIpairs is probably more efficient.
------------------------------------------------------------------------------------
function p.sortedPairs(t, keySort)
checkType('sortedPairs', 1, t, 'table')
checkType('sortedPairs', 2, keySort, 'function', true)
local arr = p.keysToList(t, keySort, true)
local i = 0
return function ()
i = i + 1
local key = arr[i]
if key ~= nil then
return key, t[key]
else
return nil, nil
end
end
end
------------------------------------------------------------------------------------
-- isArray
--
-- Returns true if the given value is a table and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArray(v)
if type(v) ~= 'table' then
return false
end
local i = 0
for _ in pairs(v) do
i = i + 1
if v[i] == nil then
return false
end
end
return true
end
------------------------------------------------------------------------------------
-- isArrayLike
--
-- Returns true if the given value is iterable and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArrayLike(v)
if not pcall(pairs, v) then
return false
end
local i = 0
for _ in pairs(v) do
i = i + 1
if v[i] == nil then
return false
end
end
return true
end
------------------------------------------------------------------------------------
-- invert
--
-- Transposes the keys and values in an array. For example, {"a", "b", "c"} ->
-- {a = 1, b = 2, c = 3}. Duplicates are not supported (result values refer to
-- the index of the last duplicate) and NaN values are ignored.
------------------------------------------------------------------------------------
function p.invert(arr)
checkType("invert", 1, arr, "table")
local isNan = p.isNan
local map = {}
for i, v in ipairs(arr) do
if not isNan(v) then
map[v] = i
end
end
return map
end
------------------------------------------------------------------------------------
-- listToSet
--
-- Creates a set from the array part of the table. Indexing the set by any of the
-- values of the array returns true. For example, {"a", "b", "c"} ->
-- {a = true, b = true, c = true}. NaN values are ignored as Lua considers them
-- never equal to any value (including other NaNs or even themselves).
------------------------------------------------------------------------------------
function p.listToSet(arr)
checkType("listToSet", 1, arr, "table")
local isNan = p.isNan
local set = {}
for _, v in ipairs(arr) do
if not isNan(v) then
set[v] = true
end
end
return set
end
------------------------------------------------------------------------------------
-- deepCopy
--
-- Recursive deep copy function. Preserves identities of subtables.
------------------------------------------------------------------------------------
local function _deepCopy(orig, includeMetatable, already_seen)
-- Stores copies of tables indexed by the original table.
already_seen = already_seen or {}
local copy = already_seen[orig]
if copy ~= nil then
return copy
end
if type(orig) == 'table' then
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[_deepCopy(orig_key, includeMetatable, already_seen)] = _deepCopy(orig_value, includeMetatable, already_seen)
end
already_seen[orig] = copy
if includeMetatable then
local mt = getmetatable(orig)
if mt ~= nil then
local mt_copy = _deepCopy(mt, includeMetatable, already_seen)
setmetatable(copy, mt_copy)
already_seen[mt] = mt_copy
end
end
else -- number, string, boolean, etc
copy = orig
end
return copy
end
function p.deepCopy(orig, noMetatable, already_seen)
checkType("deepCopy", 3, already_seen, "table", true)
return _deepCopy(orig, not noMetatable, already_seen)
end
------------------------------------------------------------------------------------
-- sparseConcat
--
-- Concatenates all values in the table that are indexed by a number, in order.
-- sparseConcat{a, nil, c, d} => "acd"
-- sparseConcat{nil, b, c, d} => "bcd"
------------------------------------------------------------------------------------
function p.sparseConcat(t, sep, i, j)
local arr = {}
local arr_i = 0
for _, v in p.sparseIpairs(t) do
arr_i = arr_i + 1
arr[arr_i] = v
end
return table.concat(arr, sep, i, j)
end
------------------------------------------------------------------------------------
-- length
--
-- Finds the length of an array, or of a quasi-array with keys such as "data1",
-- "data2", etc., using an exponential search algorithm. It is similar to the
-- operator #, but may return a different value when there are gaps in the array
-- portion of the table. Intended to be used on data loaded with mw.loadData. For
-- other tables, use #.
-- Note: #frame.args in frame object always be set to 0, regardless of the number
-- of unnamed template parameters, so use this function for frame.args.
------------------------------------------------------------------------------------
function p.length(t, prefix)
-- requiring module inline so that [[Module:Exponential search]] which is
-- only needed by this one function doesn't get millions of transclusions
local expSearch = require("Module:Exponential search")
checkType('length', 1, t, 'table')
checkType('length', 2, prefix, 'string', true)
return expSearch(function (i)
local key
if prefix then
key = prefix .. tostring(i)
else
key = i
end
return t[key] ~= nil
end) or 0
end
------------------------------------------------------------------------------------
-- inArray
--
-- Returns true if valueToFind is a member of the array, and false otherwise.
------------------------------------------------------------------------------------
function p.inArray(arr, valueToFind)
checkType("inArray", 1, arr, "table")
-- if valueToFind is nil, error?
for _, v in ipairs(arr) do
if v == valueToFind then
return true
end
end
return false
end
return p
085e7094ac84eb0132ee65822cf3f69cd8ba3d81
Template:Short description/lowercasecheck
10
17
36
2022-02-12T16:35:05Z
wikipedia>ToBeFree
0
Changed protection settings for "[[Template:Short description/lowercasecheck]]": 4 million transclusions, through [[Template:Short description]] ([[WP:HRT]]) ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
{{#ifeq:<!--test first character for lower-case letter-->{{#invoke:string|find|1={{{1|}}}|2=^%l|plain=false}}|1
|<!-- first character is a lower case letter; test against whitelist
-->{{#switch: {{First word|{{{1|}}}}}<!--begin whitelist-->
|c. <!--for circa-->
|gTLD
|iMac
|iOS
|iOS,
|iPad
|iPhone
|iTunes
|macOS
|none
|pH
|pH-dependent=<!-- end whitelist; short description starts with an allowed lower-case string; whitelist matched; do nothing -->
|#default=<!-- apply category to track lower-case short descriptions -->{{main other|[[Category:Pages with lower-case short description|{{trim|{{{1|}}}}}]]}}{{Testcases other|{{red|CATEGORY APPLIED}}}}<!-- end whitelist test -->}}
|<!-- short description does not start with lower-case letter; do nothing; end lower-case test -->
}}<noinclude>
{{documentation}}
</noinclude>
9a6d4db14b74614625fd234b4f8ee3c8e1a235c0
Module:Check for unknown parameters
828
18
38
2022-02-21T05:24:13Z
wikipedia>BusterD
0
Changed protection settings for "[[Module:Check for unknown parameters]]": [[WP:High-risk templates|Highly visible template]]; requested at [[WP:RfPP]] ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
Scribunto
text/plain
-- This module may be used to compare the arguments passed to the parent
-- with a list of arguments, returning a specified result if an argument is
-- not on the list
local p = {}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
local function isnotempty(s)
return s and s:match('%S')
end
local function clean(text)
-- Return text cleaned for display and truncated if too long.
-- Strip markers are replaced with dummy text representing the original wikitext.
local pos, truncated
local function truncate(text)
if truncated then
return ''
end
if mw.ustring.len(text) > 25 then
truncated = true
text = mw.ustring.sub(text, 1, 25) .. '...'
end
return mw.text.nowiki(text)
end
local parts = {}
for before, tag, remainder in text:gmatch('([^\127]*)\127[^\127]*%-(%l+)%-[^\127]*\127()') do
pos = remainder
table.insert(parts, truncate(before) .. '<' .. tag .. '>...</' .. tag .. '>')
end
table.insert(parts, truncate(text:sub(pos or 1)))
return table.concat(parts)
end
function p._check(args, pargs)
if type(args) ~= "table" or type(pargs) ~= "table" then
-- TODO: error handling
return
end
-- create the list of known args, regular expressions, and the return string
local knownargs = {}
local regexps = {}
for k, v in pairs(args) do
if type(k) == 'number' then
v = trim(v)
knownargs[v] = 1
elseif k:find('^regexp[1-9][0-9]*$') then
table.insert(regexps, '^' .. v .. '$')
end
end
-- loop over the parent args, and make sure they are on the list
local ignoreblank = isnotempty(args['ignoreblank'])
local showblankpos = isnotempty(args['showblankpositional'])
local values = {}
for k, v in pairs(pargs) do
if type(k) == 'string' and knownargs[k] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(k, regexp) then
knownflag = true
break
end
end
if not knownflag and ( not ignoreblank or isnotempty(v) ) then
table.insert(values, clean(k))
end
elseif type(k) == 'number' and knownargs[tostring(k)] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(tostring(k), regexp) then
knownflag = true
break
end
end
if not knownflag and ( showblankpos or isnotempty(v) ) then
table.insert(values, k .. ' = ' .. clean(v))
end
end
end
-- add results to the output tables
local res = {}
if #values > 0 then
local unknown_text = args['unknown'] or 'Found _VALUE_, '
if mw.getCurrentFrame():preprocess( "{{REVISIONID}}" ) == "" then
local preview_text = args['preview']
if isnotempty(preview_text) then
preview_text = require('Module:If preview')._warning({preview_text})
elseif preview == nil then
preview_text = unknown_text
end
unknown_text = preview_text
end
for _, v in pairs(values) do
-- Fix odd bug for | = which gets stripped to the empty string and
-- breaks category links
if v == '' then v = ' ' end
-- avoid error with v = 'example%2' ("invalid capture index")
local r = unknown_text:gsub('_VALUE_', {_VALUE_ = v})
table.insert(res, r)
end
end
return table.concat(res)
end
function p.check(frame)
local args = frame.args
local pargs = frame:getParent().args
return p._check(args, pargs)
end
return p
93db6d115d4328d2a5148bb42959105e367b663e
Template:Use dmy dates
10
187
391
2022-02-22T16:24:28Z
wikipedia>Frietjes
0
fix |=February 2022 bug (see https://en.wikipedia.org/w/index.php?title=Night_of_the_Pencils_(film)&type=revision&diff=1073091061&oldid=1067523640 which transcluded [[Template:February 2022]])
wikitext
text/x-wiki
{{ <includeonly>safesubst:</includeonly>#invoke:Unsubst||date=__DATE__ |$B=
{{DMCA|Use dmy dates|from|{{{date|}}}}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using Use dmy dates template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Use dmy dates]] with unknown parameter "_VALUE_"|ignoreblank=y| cs1-dates | date }}}}<noinclude>{{documentation}}</noinclude>
3a087cd27e88fd70a0765c62d5ab506c3b73c9e7
Template:Wikidata entity link
10
50
102
2022-02-22T17:47:17Z
wikipedia>Uzume
0
simplify and always uppercase
wikitext
text/x-wiki
<includeonly>{{#if:{{{1|}}}
| {{#switch:{{padleft:|1|{{uc:{{{1}}}}}}}
| Q | P = [[d:Special:EntityPage/{{uc:{{{1}}}}}|{{#invoke:wd|label|{{uc:{{{1}}}}}}} <small>({{uc:{{{1}}}}})</small>]]
| #default = [[d:Special:EntityPage/Q{{uc:{{{1}}}}}|{{#invoke:wd|label|Q{{uc:{{{1}}}}}}} <small>(Q{{uc:{{{1|}}}}})</small>]]
}}
| {{#if:{{#invoke:wd|label|raw}}
| [[d:Special:EntityPage/{{#invoke:wd|label|raw}}|{{#invoke:wd|label}} <small>({{#invoke:wd|label|raw}})</small>]]
| <small>(no entity)</small>
}}
}}</includeonly><noinclude>{{Documentation}}</noinclude>
3eaf99f5fdf869bc08932bb8eda9eba23858c9c8
Module:Effective protection expiry
828
26
54
2022-02-23T10:59:29Z
wikipedia>Xaosflux
0
Changed protection settings for "[[Module:Effective protection expiry]]": used in the mediawiki interface / match [[Module:Effective protection level]] ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
Scribunto
text/plain
local p = {}
-- Returns the expiry of a restriction of an action on a given title, or unknown if it cannot be known.
-- If no title is specified, the title of the page being displayed is used.
function p._main(action, pagename)
local title
if type(pagename) == 'table' and pagename.prefixedText then
title = pagename
elseif pagename then
title = mw.title.new(pagename)
else
title = mw.title.getCurrentTitle()
end
pagename = title.prefixedText
if action == 'autoreview' then
local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title)
return stabilitySettings and stabilitySettings.expiry or 'unknown'
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then
error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )
end
local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename)
if rawExpiry == 'infinity' then
return 'infinity'
elseif rawExpiry == '' then
return 'unknown'
else
local year, month, day, hour, minute, second = rawExpiry:match(
'^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$'
)
if year then
return string.format(
'%s-%s-%sT%s:%s:%s',
year, month, day, hour, minute, second
)
else
error('internal error in Module:Effective protection expiry; malformed expiry timestamp')
end
end
end
setmetatable(p, { __index = function(t, k)
return function(frame)
return t._main(k, frame.args[1])
end
end })
return p
9a8c58dc2667232ed08a9b206a5d89ca8150312b
Template:Ns has subpages
10
184
385
2022-03-02T10:43:18Z
wikipedia>Trialpears
0
Changed protection settings for "[[Template:Ns has subpages]]": [[WP:High-risk templates|Highly visible template]] ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:Ns has subpages|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
060d2d01af26cb67fd90a7c346a0d2d5e450a040
Module:Template link general
828
24
50
2022-03-08T08:30:51Z
wikipedia>Primefac
0
update from sandbox - fixes to _show_result and adding _expand
Scribunto
text/plain
-- This implements Template:Tlg
local getArgs = require('Module:Arguments').getArgs
local p = {}
-- Is a string non-empty?
local function _ne(s)
return s ~= nil and s ~= ""
end
local nw = mw.text.nowiki
local function addTemplate(s)
local i, _ = s:find(':', 1, true)
if i == nil then
return 'Template:' .. s
end
local ns = s:sub(1, i - 1)
if ns == '' or mw.site.namespaces[ns] then
return s
else
return 'Template:' .. s
end
end
local function trimTemplate(s)
local needle = 'template:'
if s:sub(1, needle:len()):lower() == needle then
return s:sub(needle:len() + 1)
else
return s
end
end
local function linkTitle(args)
if _ne(args.nolink) then
return args['1']
end
local titleObj
local titlePart = '[['
if args['1'] then
-- This handles :Page and other NS
titleObj = mw.title.new(args['1'], 'Template')
else
titleObj = mw.title.getCurrentTitle()
end
titlePart = titlePart .. (titleObj ~= nil and titleObj.fullText or
addTemplate(args['1']))
local textPart = args.alttext
if not _ne(textPart) then
if titleObj ~= nil then
textPart = titleObj:inNamespace("Template") and args['1'] or titleObj.fullText
else
-- redlink
textPart = args['1']
end
end
if _ne(args.subst) then
-- HACK: the ns thing above is probably broken
textPart = 'subst:' .. textPart
end
if _ne(args.brace) then
textPart = nw('{{') .. textPart .. nw('}}')
elseif _ne(args.braceinside) then
textPart = nw('{') .. textPart .. nw('}')
end
titlePart = titlePart .. '|' .. textPart .. ']]'
if _ne(args.braceinside) then
titlePart = nw('{') .. titlePart .. nw('}')
end
return titlePart
end
function p.main(frame)
local args = getArgs(frame, {
trim = true,
removeBlanks = false
})
return p._main(args)
end
function p._main(args)
local bold = _ne(args.bold) or _ne(args.boldlink) or _ne(args.boldname)
local italic = _ne(args.italic) or _ne(args.italics)
local dontBrace = _ne(args.brace) or _ne(args.braceinside)
local code = _ne(args.code) or _ne(args.tt)
local show_result = _ne(args._show_result)
local expand = _ne(args._expand)
-- Build the link part
local titlePart = linkTitle(args)
if bold then titlePart = "'''" .. titlePart .. "'''" end
if _ne(args.nowrapname) then titlePart = '<span class="nowrap">' .. titlePart .. '</span>' end
-- Build the arguments
local textPart = ""
local textPartBuffer = "|"
local codeArguments = {}
local codeArgumentsString = ""
local i = 2
local j = 1
while args[i] do
local val = args[i]
if val ~= "" then
if _ne(args.nowiki) then
-- Unstrip nowiki tags first because calling nw on something that already contains nowiki tags will
-- mangle the nowiki strip marker and result in literal UNIQ...QINU showing up
val = nw(mw.text.unstripNoWiki(val))
end
local k, v = string.match(val, "(.*)=(.*)")
if not k then
codeArguments[j] = val
j = j + 1
else
codeArguments[k] = v
end
codeArgumentsString = codeArgumentsString .. textPartBuffer .. val
if italic then
val = '<span style="font-style:italic;">' .. val .. '</span>'
end
textPart = textPart .. textPartBuffer .. val
end
i = i + 1
end
-- final wrap
local ret = titlePart .. textPart
if not dontBrace then ret = nw('{{') .. ret .. nw('}}') end
if _ne(args.a) then ret = nw('*') .. ' ' .. ret end
if _ne(args.kbd) then ret = '<kbd>' .. ret .. '</kbd>' end
if code then
ret = '<code>' .. ret .. '</code>'
elseif _ne(args.plaincode) then
ret = '<code style="border:none;background:transparent;">' .. ret .. '</code>'
end
if _ne(args.nowrap) then ret = '<span class="nowrap">' .. ret .. '</span>' end
--[[ Wrap as html??
local span = mw.html.create('span')
span:wikitext(ret)
--]]
if _ne(args.debug) then ret = ret .. '\n<pre>' .. mw.text.encode(mw.dumpObject(args)) .. '</pre>' end
if show_result then
local result = mw.getCurrentFrame():expandTemplate{title = addTemplate(args[1]), args = codeArguments}
ret = ret .. " → " .. result
end
if expand then
local query = mw.text.encode('{{' .. addTemplate(args[1]) .. string.gsub(codeArgumentsString, textPartBuffer, "|") .. '}}')
local url = mw.uri.fullUrl('special:ExpandTemplates', 'wpInput=' .. query)
mw.log()
ret = ret .. " [" .. tostring(url) .. "]"
end
return ret
end
return p
c7307fa3959d308a2dd7fd2f5009c1ce6db3d122
Module:InfoboxImage
828
124
256
2022-03-13T19:18:18Z
wikipedia>WOSlinker
0
add class param from sandbox as per edit request
Scribunto
text/plain
-- Inputs:
-- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link
-- page - page to display for multipage images (DjVu)
-- size - size to display the image
-- maxsize - maximum size for image
-- sizedefault - default size to display the image if size param is blank
-- alt - alt text for image
-- title - title text for image
-- border - set to yes if border
-- center - set to yes, if the image has to be centered
-- upright - upright image param
-- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it
-- link - page to visit when clicking on image
-- class - HTML classes to add to the image
-- Outputs:
-- Formatted image.
-- More details available at the "Module:InfoboxImage/doc" page
local i = {};
local placeholder_image = {
"Blue - Replace this image female.svg",
"Blue - Replace this image male.svg",
"Female no free image yet.png",
"Flag of None (square).svg",
"Flag of None.svg",
"Flag of.svg",
"Green - Replace this image female.svg",
"Green - Replace this image male.svg",
"Image is needed female.svg",
"Image is needed male.svg",
"Location map of None.svg",
"Male no free image yet.png",
"Missing flag.png",
"No flag.svg",
"No free portrait.svg",
"No portrait (female).svg",
"No portrait (male).svg",
"Red - Replace this image female.svg",
"Red - Replace this image male.svg",
"Replace this image female (blue).svg",
"Replace this image female.svg",
"Replace this image male (blue).svg",
"Replace this image male.svg",
"Silver - Replace this image female.svg",
"Silver - Replace this image male.svg",
"Replace this image.svg",
"Cricket no pic.png",
"CarersLogo.gif",
"Diagram Needed.svg",
"Example.jpg",
"Image placeholder.png",
"No male portrait.svg",
"Nocover-upload.png",
"NoDVDcover copy.png",
"Noribbon.svg",
"No portrait-BFD-test.svg",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Sin bandera.svg",
"Sin escudo.svg",
"Replace this image - temple.png",
"Replace this image butterfly.png",
"Replace this image.svg",
"Replace this image1.svg",
"Resolution angle.png",
"Image-No portrait-text-BFD-test.svg",
"Insert image here.svg",
"No image available.png",
"NO IMAGE YET square.png",
"NO IMAGE YET.png",
"No Photo Available.svg",
"No Screenshot.svg",
"No-image-available.jpg",
"Null.png",
"PictureNeeded.gif",
"Place holder.jpg",
"Unbenannt.JPG",
"UploadACopyrightFreeImage.svg",
"UploadAnImage.gif",
"UploadAnImage.svg",
"UploadAnImageShort.svg",
"CarersLogo.gif",
"Diagram Needed.svg",
"No male portrait.svg",
"NoDVDcover copy.png",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Noimage.gif",
}
function i.IsPlaceholder(image)
-- change underscores to spaces
image = mw.ustring.gsub(image, "_", " ");
assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil')
-- if image starts with [[ then remove that and anything after |
if mw.ustring.sub(image,1,2) == "[[" then
image = mw.ustring.sub(image,3);
image = mw.ustring.gsub(image, "([^|]*)|.*", "%1");
assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil')
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil")
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
-- capitalise first letter
image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2);
for i,j in pairs(placeholder_image) do
if image == j then
return true
end
end
return false
end
function i.InfoboxImage(frame)
local image = frame.args["image"];
if image == "" or image == nil then
return "";
end
if image == " " then
return image;
end
if frame.args["suppressplaceholder"] ~= "no" then
if i.IsPlaceholder(image) == true then
return "";
end
end
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then
return "";
end
if mw.ustring.sub(image,1,2) == "[[" then
-- search for thumbnail images and add to tracking cat if found
local cat = "";
if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then
cat = "[[Category:Pages using infoboxes with thumbnail images]]";
end
return image .. cat;
elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then
return image;
elseif mw.ustring.sub(image,1,1) == "<" then
return image;
elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127).."UNIQ" then
-- Found strip marker at begining, so pass don't process at all
return image;
elseif mw.ustring.sub(image,4,9) == "`UNIQ-" then
-- Found strip marker at begining, so pass don't process at all
return image;
else
local result = "";
local page = frame.args["page"];
local size = frame.args["size"];
local maxsize = frame.args["maxsize"];
local sizedefault = frame.args["sizedefault"];
local alt = frame.args["alt"];
local link = frame.args["link"];
local title = frame.args["title"];
local border = frame.args["border"];
local upright = frame.args["upright"] or "";
local thumbtime = frame.args["thumbtime"] or "";
local center = frame.args["center"];
local class = frame.args["class"];
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
if maxsize ~= "" and maxsize ~= nil then
-- if no sizedefault then set to maxsize
if sizedefault == "" or sizedefault == nil then
sizedefault = maxsize
end
-- check to see if size bigger than maxsize
if size ~= "" and size ~= nil then
local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0;
local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0;
if sizenumber>maxsizenumber and maxsizenumber>0 then
size = maxsize;
end
end
end
-- add px to size if just a number
if (tonumber(size) or 0) > 0 then
size = size .. "px";
end
-- add px to sizedefault if just a number
if (tonumber(sizedefault) or 0) > 0 then
sizedefault = sizedefault .. "px";
end
result = "[[File:" .. image;
if page ~= "" and page ~= nil then
result = result .. "|page=" .. page;
end
if size ~= "" and size ~= nil then
result = result .. "|" .. size;
elseif sizedefault ~= "" and sizedefault ~= nil then
result = result .. "|" .. sizedefault;
else
result = result .. "|frameless";
end
if center == "yes" then
result = result .. "|center"
end
if alt ~= "" and alt ~= nil then
result = result .. "|alt=" .. alt;
end
if link ~= "" and link ~= nil then
result = result .. "|link=" .. link;
end
if border == "yes" then
result = result .. "|border";
end
if upright == "yes" then
result = result .. "|upright";
elseif upright ~= "" then
result = result .. "|upright=" .. upright;
end
if thumbtime ~= "" then
result = result .. "|thumbtime=" .. thumbtime;
end
if class ~= nil and class ~= "" then
result = result .. "|class=" .. class;
end
-- if alt value is a keyword then do not use as a description
if alt == "thumbnail" or alt == "thumb" or alt == "frameless" or alt == "left" or alt == "center" or alt == "right" or alt == "upright" or alt == "border" or mw.ustring.match(alt or "", '^[0-9]*px$', 1) ~= nil then
alt = nil;
end
if title ~= "" and title ~= nil then
-- does title param contain any templatestyles? If yes then set to blank.
if mw.ustring.match(frame:preprocess(title), 'UNIQ%-%-templatestyles', 1) ~= nil then
title = nil;
end
end
if title ~= "" and title ~= nil then
result = result .. "|" .. title;
end
result = result .. "]]";
return result;
end
end
return i;
0ee5fe75ba239fc5c9cedc81ca11bdc0be068542
Template:Documentation
10
55
112
2022-03-29T02:14:34Z
wikipedia>Bsherr
0
consistent with new substitution template format
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<!-- Add categories to the /doc subpage -->
</noinclude>
9e62b964e96c4e3d478edecbfcb3c0338ae8a276
Template:If empty
10
131
270
2022-04-03T20:56:41Z
wikipedia>Wugapodes
0
Changed protection settings for "[[Template:If empty]]": [[WP:High-risk templates|Highly visible template]]: used on 2 million pages and permanently cascade protected; matches module protection ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:If empty|main}}<noinclude>{{Documentation}}</noinclude>
745940b7bdde8a1585c887ee4ee5ce81d98461a4
Template:Module rating
10
175
367
2022-06-03T15:10:23Z
wikipedia>The Anome
0
Reverted edits by [[Special:Contribs/Dawn PScLim|Dawn PScLim]] ([[User talk:Dawn PScLim|talk]]) to last version by Alexis Jazz
wikitext
text/x-wiki
<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc|<!--do not show protection level of the module on the doc page, use the second and optionally third parameter if the doc page is also protected -->{{#if:{{{2|}}}|{{Pp|{{{2}}}|action={{{3|}}}}}}}|{{Module other|{{ombox
| type = notice
| image = {{#switch: {{{1|}}}
| pre-alpha | prealpha | pa = [[File:Ambox warning blue construction.svg|40x40px|link=|alt=Pre-alpha]]
| alpha | a = [[File:Alpha lowercase.svg|26x26px|link=|alt=Alpha]]
| beta | b = [[File:Greek lc beta.svg|40x40px|link=|alt=Beta]]
| release | r | general | g = [[File:Green check.svg|40x40px|link=|alt=Ready for use]]
| protected | protect | p = [[File:{{#switch:{{#invoke:Effective protection level|edit|{{#switch:{{SUBPAGENAME}}|doc|sandbox={{FULLBASEPAGENAME}}|{{FULLPAGENAME}}}}}}|autoconfirmed=Semi|extendedconfirmed=Extended|accountcreator|templateeditor=Template|#default=Full}}-protection-shackle.svg|40x40px|link=|alt=Protected]]
| semiprotected | semiprotect | semi =[[File:Semi-protection-shackle.svg|40x40px|link=|alt=Semi-protected]]
}}
| style =
| textstyle =
| text = {{#switch: {{{1|}}}
| pre-alpha | prealpha | pa = This module is rated as [[:Category:Modules in pre-alpha development|pre-alpha]]. It is unfinished, and may or may not be in active development. It should not be used from article namespace pages. Modules remain pre-alpha until the original editor (or someone who takes one over if it is abandoned for some time) is satisfied with the basic structure.<!--
-->{{#switch: {{SUBPAGENAME}}|doc|sandbox=<!-- No category for /doc or /sandbox subpages -->
| {{#ifeq: {{{nocat|}}} | true | <!-- No category if user sets nocat=true --> | [[Category:Modules in pre-alpha development|{{PAGENAME}}]] }}
}}
| alpha | a = This module is rated as [[:Category:Modules in alpha|alpha]]. It is ready for third-party input, and may be used on a few pages to see if problems arise, but should be watched. Suggestions for new features or changes in their input and output mechanisms are welcome.<!--
-->{{#switch: {{SUBPAGENAME}}|doc|sandbox=<!-- No category for /doc or /sandbox subpages -->
| {{#ifeq: {{{nocat|}}} | true | <!-- No category if user sets nocat=true --> | [[Category:Modules in alpha|{{PAGENAME}}]] }}
}}
| beta | b = This module is rated as [[:Category:Modules in beta|beta]], and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected.<!--
-->{{#switch: {{SUBPAGENAME}}|doc|sandbox=<!-- No category for /doc or /sandbox subpages -->
| {{#ifeq: {{{nocat|}}} | true | <!-- No category if user sets nocat=true --> | [[Category:Modules in beta|{{PAGENAME}}]] }}
}}
| release | r | general | g = This module is rated as [[:Category:Modules for general use|ready for general use]]. It has reached a mature form and is thought to be relatively bug-free and ready for use wherever appropriate. It is ready to mention on help pages and other Wikipedia resources as an option for new users to learn. To reduce server load and bad output, it should be improved by [[Wikipedia:Template sandbox and test cases|sandbox testing]] rather than repeated trial-and-error editing.<!--
-->{{#switch: {{SUBPAGENAME}}|doc|sandbox=<!-- No category for /doc or /sandbox subpages -->
| {{#ifeq: {{{nocat|}}} | true | <!-- No category if user sets nocat=true --> | [[Category:Modules for general use|{{PAGENAME}}]] }}
}}
| protected | protect | p = This module is [[:Category:Modules subject to page protection|subject to page protection]]. It is a [[Wikipedia:High-risk templates|highly visible module]] in use by a very large number of pages, or is [[Wikipedia:Substitution|substituted]] very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is [[Wikipedia:Protection policy|protected]] from editing.<!--
-->{{#switch: {{SUBPAGENAME}}|doc|sandbox=<!-- No category for /doc or /sandbox subpages -->
| {{#ifeq: {{{nocat|}}} | true | <!-- No category if user sets nocat=true --> | [[Category:Modules subject to page protection|{{PAGENAME}}]] }}
}}
| semiprotected | semiprotect | semi = This module is [[:Category:Modules subject to page protection|subject to page protection]]. It is a [[Wikipedia:High-risk templates|highly visible module]] in use by a very large number of pages, or is [[Wikipedia:Substitution|substituted]] very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is [[WP:SEMI|semi-protected]] from editing.<!--
-->{{#switch: {{SUBPAGENAME}}|doc|sandbox=<!-- No category for /doc or /sandbox subpages -->
| {{#ifeq: {{{nocat|}}} | true | <!-- No category if user sets nocat=true --> | [[Category:Modules subject to page protection|{{PAGENAME}}]] }}
}}
| #default = {{error|Module rating is invalid or not specified.}}
}}
}}|{{error|Error: {{tl|Module rating}} must be placed in the Module namespace.}} [[Category:Pages with templates in the wrong namespace]]|demospace={{{demospace|<noinclude>module</noinclude>}}}}}}}</includeonly><noinclude>
{{module rating|release|nocat=true|demospace=module}}
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go in Wikidata. -->
</noinclude>
bbd244b3ea2e13ec4c1c810ae44f2f3789a93efc
Template:Clear
10
130
268
2022-06-13T15:31:11Z
wikipedia>Xaosflux
0
Changed protection settings for "[[Template:Clear]]": [[WP:High-risk templates|Highly visible template]]: 3MM+ uses ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
wikitext
text/x-wiki
<div style="clear:{{{1|both}}};"></div><noinclude>
{{documentation}}
</noinclude>
38bab3e3d7fbd3d6800d46556e60bc6bac494d72
Module:Uses TemplateStyles/config
828
157
322
2022-06-16T15:10:06Z
wikipedia>Pppery
0
Matching reality rather than 2018 me's wishful thinking
Scribunto
text/plain
local cfg = {} -- Don’t touch this line.
-- Subpage blacklist: these subpages will not be categorized (except for the
-- error category, which is always added if there is an error).
-- For example “Template:Foo/doc” matches the `doc = true` rule, so it will have
-- no categories. “Template:Foo” and “Template:Foo/documentation” match no rules,
-- so they *will* have categories. All rules should be in the
-- ['<subpage name>'] = true,
-- format.
cfg['subpage_blacklist'] = {
['doc'] = true,
['sandbox'] = true,
['sandbox2'] = true,
['testcases'] = true,
}
-- Sandbox title: if the stylesheet’s title is <template>/<stylesheet>.css, the
-- stylesheet’s sandbox is expected to be at <template>/<sandbox_title>/<stylesheet>.css
-- Set to nil to disable sandbox links.
cfg['sandbox_title'] = 'sandbox'
-- Error category: this category is added if the module call contains errors
-- (e.g. no stylesheet listed). A category name without namespace, or nil
-- to disable categorization (not recommended).
cfg['error_category'] = 'Uses TemplateStyles templates with errors'
-- Default category: this category is added if no custom category is specified
-- in module/template call. A category name without namespace, or nil
-- to disable categorization.
cfg['default_category'] = 'Templates using TemplateStyles'
-- Protection conflict category: this category is added if the protection level
-- of any stylesheet is lower than the protection level of the template. A category name
-- without namespace, or nil to disable categorization (not recommended).
cfg['protection_conflict_category'] = 'Templates using TemplateStyles with a different protection level'
-- Hierarchy of protection levels, used to determine whether one protection level is lower
-- than another and thus should populate protection_conflict_category. No protection is treated as zero
cfg['protection_hierarchy'] = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
-- Padlock pattern: Lua pattern to search on protected stylesheets for, or nil
-- to disable padlock check.
cfg['padlock_pattern'] = '{{pp-'
-- Missing padlock category: this category is added if a protected stylesheet
-- doesn’t contain any padlock template (specified by the above Lua pattern).
-- A category name without namespace (no nil allowed) if the pattern is not nil,
-- unused (and thus may be nil) otherwise.
cfg['missing_padlock_category'] = 'Templates using TemplateStyles without padlocks'
return cfg -- Don’t touch this line.
58e7a37c44f6ea3f6b8af54a559d696cc7256493
Module:Uses TemplateStyles
828
156
320
2022-06-16T15:13:38Z
wikipedia>Pppery
0
Matching reality rather than 2018 me's wishful thinking
Scribunto
text/plain
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local TNT = require('Module:TNT')
local p = {}
local function format(msg, ...)
return TNT.format('I18n/Uses TemplateStyles', msg, ...)
end
local function getConfig()
return mw.loadData('Module:Uses TemplateStyles/config')
end
local function renderBox(tStyles)
local boxArgs = {
type = 'notice',
small = true,
image = string.format('[[File:Farm-Fresh css add.svg|32px|alt=%s]]', format('logo-alt'))
}
if #tStyles < 1 then
boxArgs.text = string.format('<strong class="error">%s</strong>', format('error-emptylist'))
else
local cfg = getConfig()
local tStylesLinks = {}
for i, ts in ipairs(tStyles) do
local link = string.format('[[:%s]]', ts)
local sandboxLink = nil
local tsTitle = mw.title.new(ts)
if tsTitle and cfg['sandbox_title'] then
local tsSandboxTitle = mw.title.new(string.format(
'%s:%s/%s/%s', tsTitle.nsText, tsTitle.baseText, cfg['sandbox_title'], tsTitle.subpageText))
if tsSandboxTitle and tsSandboxTitle.exists then
sandboxLink = format('sandboxlink', link, ':' .. tsSandboxTitle.prefixedText)
end
end
tStylesLinks[i] = sandboxLink or link
end
local tStylesList = mList.makeList('bulleted', tStylesLinks)
boxArgs.text = format(
mw.title.getCurrentTitle():inNamespaces(828,829) and 'header-module' or 'header-template') ..
'\n' .. tStylesList
end
return mMessageBox.main('mbox', boxArgs)
end
local function renderTrackingCategories(args, tStyles, titleObj)
if yesno(args.nocat) then
return ''
end
local cfg = getConfig()
local cats = {}
-- Error category
if #tStyles < 1 and cfg['error_category'] then
cats[#cats + 1] = cfg['error_category']
end
-- TemplateStyles category
titleObj = titleObj or mw.title.getCurrentTitle()
if (titleObj.namespace == 10 or titleObj.namespace == 828)
and not cfg['subpage_blacklist'][titleObj.subpageText]
then
local category = args.category or cfg['default_category']
if category then
cats[#cats + 1] = category
end
if not yesno(args.noprotcat) and (cfg['protection_conflict_category'] or cfg['padlock_pattern']) then
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
local addedLevelCat = false
local addedPadlockCat = false
for i, ts in ipairs(tStyles) do
local tsTitleObj = mw.title.new(ts)
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
if cfg['padlock_pattern'] and tsProt and not addedPadlockCat then
local content = tsTitleObj:getContent()
if not content:find(cfg['padlock_pattern']) then
cats[#cats + 1] = cfg['missing_padlock_category']
addedPadlockCat = true
end
end
if cfg['protection_conflict_category'] and currentProt and tsProt ~= currentProt and not addedLevelCat then
currentProt = cfg['protection_hierarchy'][currentProt] or 0
tsProt = cfg['protection_hierarchy'][tsProt] or 0
if tsProt < currentProt then
addedLevelCat = true
cats[#cats + 1] = cfg['protection_conflict_category']
end
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
function p._main(args, cfg)
local tStyles = mTableTools.compressSparseArray(args)
local box = renderBox(tStyles)
local trackingCategories = renderTrackingCategories(args, tStyles)
return box .. trackingCategories
end
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
return p
71ca57c37849f38e3c5ee30061bdae730963e48e
Module:Message box/configuration
828
13
28
2022-07-11T18:19:26Z
wikipedia>Izno
0
add templatestyles, remove a variable or two as a result
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Message box configuration --
-- --
-- This module contains configuration data for [[Module:Message box]]. --
--------------------------------------------------------------------------------
return {
ambox = {
types = {
speedy = {
class = 'ambox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ambox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ambox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ambox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ambox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ambox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ambox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
allowSmall = true,
smallParam = 'left',
smallClass = 'mbox-small-left',
substCheck = true,
classes = {'metadata', 'ambox'},
imageEmptyCell = true,
imageCheckBlank = true,
imageSmallSize = '20x20px',
imageCellDiv = true,
useCollapsibleTextFields = true,
imageRightNone = true,
sectionDefault = 'article',
allowMainspaceCategories = true,
templateCategory = 'Article message templates',
templateCategoryRequireName = true,
templateErrorCategory = 'Article message templates with missing parameters',
templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
removalNotice = '<small>[[Help:Maintenance template removal|Learn how and when to remove this template message]]</small>',
templatestyles = 'Module:Message box/ambox.css'
},
cmbox = {
types = {
speedy = {
class = 'cmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'cmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'cmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'cmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'cmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'cmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'cmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'cmbox'},
imageEmptyCell = true,
templatestyles = 'Module:Message box/cmbox.css'
},
fmbox = {
types = {
warning = {
class = 'fmbox-warning',
image = 'Ambox warning pn.svg'
},
editnotice = {
class = 'fmbox-editnotice',
image = 'Information icon4.svg'
},
system = {
class = 'fmbox-system',
image = 'Information icon4.svg'
}
},
default = 'system',
showInvalidTypeError = true,
classes = {'fmbox'},
imageEmptyCell = false,
imageRightNone = false,
templatestyles = 'Module:Message box/fmbox.css'
},
imbox = {
types = {
speedy = {
class = 'imbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'imbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'imbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'imbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'imbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'imbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
license = {
class = 'imbox-license licensetpl',
image = 'Imbox license.png' -- @todo We need an SVG version of this
},
featured = {
class = 'imbox-featured',
image = 'Cscr-featured.svg'
},
notice = {
class = 'imbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'imbox'},
imageEmptyCell = true,
below = true,
templateCategory = 'File message boxes',
templatestyles = 'Module:Message box/imbox.css'
},
ombox = {
types = {
speedy = {
class = 'ombox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ombox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ombox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ombox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ombox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ombox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ombox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'ombox'},
allowSmall = true,
imageEmptyCell = true,
imageRightNone = true,
templatestyles = 'Module:Message box/ombox.css'
},
tmbox = {
types = {
speedy = {
class = 'tmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'tmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'tmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'tmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'tmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'tmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'tmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'tmbox'},
allowSmall = true,
imageRightNone = true,
imageEmptyCell = true,
templateCategory = 'Talk message boxes',
templatestyles = 'Module:Message box/tmbox.css'
}
}
b6f0151037e6867b577c8cca32ff297e48697a10
Module:Message box/ombox.css
828
81
164
2022-07-11T18:40:17Z
wikipedia>Izno
0
and move mbox-small to 720px here as well
text
text/plain
/* {{pp|small=y}} */
.ombox {
margin: 4px 0;
border-collapse: collapse;
border: 1px solid #a2a9b1; /* Default "notice" gray */
background-color: #f8f9fa;
box-sizing: border-box;
}
/* For the "small=yes" option. */
.ombox.mbox-small {
font-size: 88%;
line-height: 1.25em;
}
.ombox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
.ombox-delete {
border: 2px solid #b32424; /* Red */
}
.ombox-content {
border: 1px solid #f28500; /* Orange */
}
.ombox-style {
border: 1px solid #fc3; /* Yellow */
}
.ombox-move {
border: 1px solid #9932cc; /* Purple */
}
.ombox-protection {
border: 2px solid #a2a9b1; /* Gray-gold */
}
.ombox .mbox-text {
border: none;
/* @noflip */
padding: 0.25em 0.9em;
width: 100%;
}
.ombox .mbox-image {
border: none;
/* @noflip */
padding: 2px 0 2px 0.9em;
text-align: center;
}
.ombox .mbox-imageright {
border: none;
/* @noflip */
padding: 2px 0.9em 2px 0;
text-align: center;
}
/* An empty narrow cell */
.ombox .mbox-empty-cell {
border: none;
padding: 0;
width: 1px;
}
.ombox .mbox-invalid-type {
text-align: center;
}
@media (min-width: 720px) {
.ombox {
margin: 4px 10%;
}
.ombox.mbox-small {
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin: 4px 0 4px 1em;
width: 238px;
}
}
8fe3df4bb607e699eab2dbd23bd4a1a446391002
Template:Warning
10
60
122
2022-07-15T07:27:49Z
wikipedia>Izno
0
remove hard coded width 80%
wikitext
text/x-wiki
{{Mbox
| name = Warning
| demospace = {{{demospace|}}}
| style = {{#if:{{{style|}}} |{{{style}}} }}
| subst = <includeonly>{{subst:substcheck}}</includeonly>
| type = content
| image = {{#if:{{{image|}}}| [[File:{{{image}}}|{{{imagesize|40px}}}|Warning]] }}
| small = {{{small|}}}
| smallimage = {{#if:{{{image|}}}| [[File:{{{image}}}|30px|Warning]]}}
| imageright = {{#if:{{{imageright|}}} |{{{imageright}}} |{{#if:{{{shortcut|{{{shortcut1|}}}}}} |{{Ombox/shortcut|{{{shortcut|{{{shortcut1|}}}}}}|{{{shortcut2|}}}|{{{shortcut3|}}}|{{{shortcut4|}}}|{{{shortcut5|}}}}}}} }}
| textstyle = {{{textstyle|text-align: {{#if:{{{center|}}}|center|{{{align|left}}}}};}}}
| text = {{#if:{{{header|{{{heading|{{{title|}}}}}}}}} |<div style="{{{headstyle|text-align: {{#if:{{{center|}}}|center|left}};}}}">'''{{{header|{{{heading|{{{title|}}}}}}}}}'''</div>}}<!--
-->{{{text|{{{content|{{{reason|{{{1}}}}}}}}}}}}
}}<noinclude>
<!-- Add categories to the /doc subpage; interwikis go to Wikidata. -->
{{Documentation}}
</noinclude>
3af84e728da2ec54b8431a52af171256c929741e
Module:Text
828
139
286
2022-07-21T16:43:48Z
wikipedia>Hike395
0
update date
Scribunto
text/plain
local yesNo = require("Module:Yesno")
local Text = { serial = "2022-07-21",
suite = "Text" }
--[=[
Text utilities
]=]
-- local globals
local PatternCJK = false
local PatternCombined = false
local PatternLatin = false
local PatternTerminated = false
local QuoteLang = false
local QuoteType = false
local RangesLatin = false
local SeekQuote = false
local function initLatinData()
if not RangesLatin then
RangesLatin = { { 7, 687 },
{ 7531, 7578 },
{ 7680, 7935 },
{ 8194, 8250 } }
end
if not PatternLatin then
local range
PatternLatin = "^["
for i = 1, #RangesLatin do
range = RangesLatin[ i ]
PatternLatin = PatternLatin ..
mw.ustring.char( range[ 1 ], 45, range[ 2 ] )
end -- for i
PatternLatin = PatternLatin .. "]*$"
end
end
local function initQuoteData()
-- Create quote definitions
if not QuoteLang then
QuoteLang =
{ af = "bd",
ar = "la",
be = "labd",
bg = "bd",
ca = "la",
cs = "bd",
da = "bd",
de = "bd",
dsb = "bd",
et = "bd",
el = "lald",
en = "ld",
es = "la",
eu = "la",
-- fa = "la",
fi = "rd",
fr = "laSPC",
ga = "ld",
he = "ldla",
hr = "bd",
hsb = "bd",
hu = "bd",
hy = "labd",
id = "rd",
is = "bd",
it = "ld",
ja = "x300C",
ka = "bd",
ko = "ld",
lt = "bd",
lv = "bd",
nl = "ld",
nn = "la",
no = "la",
pl = "bdla",
pt = "lald",
ro = "bdla",
ru = "labd",
sk = "bd",
sl = "bd",
sq = "la",
sr = "bx",
sv = "rd",
th = "ld",
tr = "ld",
uk = "la",
zh = "ld",
["de-ch"] = "la",
["en-gb"] = "lsld",
["en-us"] = "ld",
["fr-ch"] = "la",
["it-ch"] = "la",
["pt-br"] = "ldla",
["zh-tw"] = "x300C",
["zh-cn"] = "ld" }
end
if not QuoteType then
QuoteType =
{ bd = { { 8222, 8220 }, { 8218, 8217 } },
bdla = { { 8222, 8220 }, { 171, 187 } },
bx = { { 8222, 8221 }, { 8218, 8217 } },
la = { { 171, 187 }, { 8249, 8250 } },
laSPC = { { 171, 187 }, { 8249, 8250 }, true },
labd = { { 171, 187 }, { 8222, 8220 } },
lald = { { 171, 187 }, { 8220, 8221 } },
ld = { { 8220, 8221 }, { 8216, 8217 } },
ldla = { { 8220, 8221 }, { 171, 187 } },
lsld = { { 8216, 8217 }, { 8220, 8221 } },
rd = { { 8221, 8221 }, { 8217, 8217 } },
x300C = { { 0x300C, 0x300D },
{ 0x300E, 0x300F } } }
end
end -- initQuoteData()
local function fiatQuote( apply, alien, advance )
-- Quote text
-- Parameter:
-- apply -- string, with text
-- alien -- string, with language code
-- advance -- number, with level 1 or 2
local r = apply and tostring(apply) or ""
alien = alien or "en"
advance = tonumber(advance) or 0
local suite
initQuoteData()
local slang = alien:match( "^(%l+)-" )
suite = QuoteLang[alien] or slang and QuoteLang[slang] or QuoteLang["en"]
if suite then
local quotes = QuoteType[ suite ]
if quotes then
local space
if quotes[ 3 ] then
space = " "
else
space = ""
end
quotes = quotes[ advance ]
if quotes then
r = mw.ustring.format( "%s%s%s%s%s",
mw.ustring.char( quotes[ 1 ] ),
space,
apply,
space,
mw.ustring.char( quotes[ 2 ] ) )
end
else
mw.log( "fiatQuote() " .. suite )
end
end
return r
end -- fiatQuote()
Text.char = function ( apply, again, accept )
-- Create string from codepoints
-- Parameter:
-- apply -- table (sequence) with numerical codepoints, or nil
-- again -- number of repetitions, or nil
-- accept -- true, if no error messages to be appended
-- Returns: string
local r = ""
apply = type(apply) == "table" and apply or {}
again = math.floor(tonumber(again) or 1)
if again < 1 then
return ""
end
local bad = { }
local codes = { }
for _, v in ipairs( apply ) do
local n = tonumber(v)
if not n or (n < 32 and n ~= 9 and n ~= 10) then
table.insert(bad, tostring(v))
else
table.insert(codes, math.floor(n))
end
end
if #bad > 0 then
if not accept then
r = tostring( mw.html.create( "span" )
:addClass( "error" )
:wikitext( "bad codepoints: " .. table.concat( bad, " " )) )
end
return r
end
if #codes > 0 then
r = mw.ustring.char( unpack( codes ) )
if again > 1 then
r = r:rep(again)
end
end
return r
end -- Text.char()
local function trimAndFormat(args, fmt)
local result = {}
if type(args) ~= 'table' then
args = {args}
end
for _, v in ipairs(args) do
v = mw.text.trim(tostring(v))
if v ~= "" then
table.insert(result,fmt and mw.ustring.format(fmt, v) or v)
end
end
return result
end
Text.concatParams = function ( args, apply, adapt )
-- Concat list items into one string
-- Parameter:
-- args -- table (sequence) with numKey=string
-- apply -- string (optional); separator (default: "|")
-- adapt -- string (optional); format including "%s"
-- Returns: string
local collect = { }
return table.concat(trimAndFormat(args,adapt), apply or "|")
end -- Text.concatParams()
Text.containsCJK = function ( s )
-- Is any CJK code within?
-- Parameter:
-- s -- string
-- Returns: true, if CJK detected
s = s and tostring(s) or ""
if not patternCJK then
patternCJK = mw.ustring.char( 91,
4352, 45, 4607,
11904, 45, 42191,
43072, 45, 43135,
44032, 45, 55215,
63744, 45, 64255,
65072, 45, 65103,
65381, 45, 65500,
131072, 45, 196607,
93 )
end
return mw.ustring.find( s, patternCJK ) ~= nil
end -- Text.containsCJK()
Text.removeDelimited = function (s, prefix, suffix)
-- Remove all text in s delimited by prefix and suffix (inclusive)
-- Arguments:
-- s = string to process
-- prefix = initial delimiter
-- suffix = ending delimiter
-- Returns: stripped string
s = s and tostring(s) or ""
prefix = prefix and tostring(prefix) or ""
suffix = suffix and tostring(suffix) or ""
local prefixLen = mw.ustring.len(prefix)
local suffixLen = mw.ustring.len(suffix)
if prefixLen == 0 or suffixLen == 0 then
return s
end
local i = s:find(prefix, 1, true)
local r = s
local j
while i do
j = r:find(suffix, i + prefixLen)
if j then
r = r:sub(1, i - 1)..r:sub(j+suffixLen)
else
r = r:sub(1, i - 1)
end
i = r:find(prefix, 1, true)
end
return r
end
Text.getPlain = function ( adjust )
-- Remove wikisyntax from string, except templates
-- Parameter:
-- adjust -- string
-- Returns: string
local r = Text.removeDelimited(adjust,"<!--","-->")
r = r:gsub( "(</?%l[^>]*>)", "" )
:gsub( "'''", "" )
:gsub( "''", "" )
:gsub( " ", " " )
return r
end -- Text.getPlain()
Text.isLatinRange = function (s)
-- Are characters expected to be latin or symbols within latin texts?
-- Arguments:
-- s = string to analyze
-- Returns: true, if valid for latin only
s = s and tostring(s) or "" --- ensure input is always string
initLatinData()
return mw.ustring.match(s, PatternLatin) ~= nil
end -- Text.isLatinRange()
Text.isQuote = function ( s )
-- Is this character any quotation mark?
-- Parameter:
-- s = single character to analyze
-- Returns: true, if s is quotation mark
s = s and tostring(s) or ""
if s == "" then
return false
end
if not SeekQuote then
SeekQuote = mw.ustring.char( 34, -- "
39, -- '
171, -- laquo
187, -- raquo
8216, -- lsquo
8217, -- rsquo
8218, -- sbquo
8220, -- ldquo
8221, -- rdquo
8222, -- bdquo
8249, -- lsaquo
8250, -- rsaquo
0x300C, -- CJK
0x300D, -- CJK
0x300E, -- CJK
0x300F ) -- CJK
end
return mw.ustring.find( SeekQuote, s, 1, true ) ~= nil
end -- Text.isQuote()
Text.listToText = function ( args, adapt )
-- Format list items similar to mw.text.listToText()
-- Parameter:
-- args -- table (sequence) with numKey=string
-- adapt -- string (optional); format including "%s"
-- Returns: string
return mw.text.listToText(trimAndFormat(args, adapt))
end -- Text.listToText()
Text.quote = function ( apply, alien, advance )
-- Quote text
-- Parameter:
-- apply -- string, with text
-- alien -- string, with language code, or nil
-- advance -- number, with level 1 or 2, or nil
-- Returns: quoted string
apply = apply and tostring(apply) or ""
local mode, slang
if type( alien ) == "string" then
slang = mw.text.trim( alien ):lower()
else
slang = mw.title.getCurrentTitle().pageLanguage
if not slang then
-- TODO FIXME: Introduction expected 2017-04
slang = mw.language.getContentLanguage():getCode()
end
end
if advance == 2 then
mode = 2
else
mode = 1
end
return fiatQuote( mw.text.trim( apply ), slang, mode )
end -- Text.quote()
Text.quoteUnquoted = function ( apply, alien, advance )
-- Quote text, if not yet quoted and not empty
-- Parameter:
-- apply -- string, with text
-- alien -- string, with language code, or nil
-- advance -- number, with level 1 or 2, or nil
-- Returns: string; possibly quoted
local r = mw.text.trim( apply and tostring(apply) or "" )
local s = mw.ustring.sub( r, 1, 1 )
if s ~= "" and not Text.isQuote( s, advance ) then
s = mw.ustring.sub( r, -1, 1 )
if not Text.isQuote( s ) then
r = Text.quote( r, alien, advance )
end
end
return r
end -- Text.quoteUnquoted()
Text.removeDiacritics = function ( adjust )
-- Remove all diacritics
-- Parameter:
-- adjust -- string
-- Returns: string; all latin letters should be ASCII
-- or basic greek or cyrillic or symbols etc.
local cleanup, decomposed
if not PatternCombined then
PatternCombined = mw.ustring.char( 91,
0x0300, 45, 0x036F,
0x1AB0, 45, 0x1AFF,
0x1DC0, 45, 0x1DFF,
0xFE20, 45, 0xFE2F,
93 )
end
decomposed = mw.ustring.toNFD( adjust and tostring(adjust) or "" )
cleanup = mw.ustring.gsub( decomposed, PatternCombined, "" )
return mw.ustring.toNFC( cleanup )
end -- Text.removeDiacritics()
Text.sentenceTerminated = function ( analyse )
-- Is string terminated by dot, question or exclamation mark?
-- Quotation, link termination and so on granted
-- Parameter:
-- analyse -- string
-- Returns: true, if sentence terminated
local r
if not PatternTerminated then
PatternTerminated = mw.ustring.char( 91,
12290,
65281,
65294,
65311 )
.. "!%.%?…][\"'%]‹›«»‘’“”]*$"
end
if mw.ustring.find( analyse, PatternTerminated ) then
r = true
else
r = false
end
return r
end -- Text.sentenceTerminated()
Text.ucfirstAll = function ( adjust)
-- Capitalize all words
-- Arguments:
-- adjust = string to adjust
-- Returns: string with all first letters in upper case
adjust = adjust and tostring(adjust) or ""
local r = mw.text.decode(adjust,true)
local i = 1
local c, j, m
m = (r ~= adjust)
r = " "..r
while i do
i = mw.ustring.find( r, "%W%l", i )
if i then
j = i + 1
c = mw.ustring.upper( mw.ustring.sub( r, j, j ) )
r = string.format( "%s%s%s",
mw.ustring.sub( r, 1, i ),
c,
mw.ustring.sub( r, i + 2 ) )
i = j
end
end -- while i
r = r:sub( 2 )
if m then
r = mw.text.encode(r)
end
return r
end -- Text.ucfirstAll()
Text.uprightNonlatin = function ( adjust )
-- Ensure non-italics for non-latin text parts
-- One single greek letter might be granted
-- Precondition:
-- adjust -- string
-- Returns: string with non-latin parts enclosed in <span>
local r
initLatinData()
if mw.ustring.match( adjust, PatternLatin ) then
-- latin only, horizontal dashes, quotes
r = adjust
else
local c
local j = false
local k = 1
local m = false
local n = mw.ustring.len( adjust )
local span = "%s%s<span dir='auto' style='font-style:normal'>%s</span>"
local flat = function ( a )
-- isLatin
local range
for i = 1, #RangesLatin do
range = RangesLatin[ i ]
if a >= range[ 1 ] and a <= range[ 2 ] then
return true
end
end -- for i
end -- flat()
local focus = function ( a )
-- char is not ambivalent
local r = ( a > 64 )
if r then
r = ( a < 8192 or a > 8212 )
else
r = ( a == 38 or a == 60 ) -- '&' '<'
end
return r
end -- focus()
local form = function ( a )
return string.format( span,
r,
mw.ustring.sub( adjust, k, j - 1 ),
mw.ustring.sub( adjust, j, a ) )
end -- form()
r = ""
for i = 1, n do
c = mw.ustring.codepoint( adjust, i, i )
if focus( c ) then
if flat( c ) then
if j then
if m then
if i == m then
-- single greek letter.
j = false
end
m = false
end
if j then
local nx = i - 1
local s = ""
for ix = nx, 1, -1 do
c = mw.ustring.sub( adjust, ix, ix )
if c == " " or c == "(" then
nx = nx - 1
s = c .. s
else
break -- for ix
end
end -- for ix
r = form( nx ) .. s
j = false
k = i
end
end
elseif not j then
j = i
if c >= 880 and c <= 1023 then
-- single greek letter?
m = i + 1
else
m = false
end
end
elseif m then
m = m + 1
end
end -- for i
if j and ( not m or m < n ) then
r = form( n )
else
r = r .. mw.ustring.sub( adjust, k )
end
end
return r
end -- Text.uprightNonlatin()
Text.test = function ( about )
local r
if about == "quote" then
initQuoteData()
r = { }
r.QuoteLang = QuoteLang
r.QuoteType = QuoteType
end
return r
end -- Text.test()
-- Export
local p = { }
for _, func in ipairs({'containsCJK','isLatinRange','isQuote','sentenceTerminated'}) do
p[func] = function (frame)
return Text[func]( frame.args[ 1 ] or "" ) and "1" or ""
end
end
for _, func in ipairs({'getPlain','removeDiacritics','ucfirstAll','uprightNonlatin'}) do
p[func] = function (frame)
return Text[func]( frame.args[ 1 ] or "" )
end
end
function p.char( frame )
local params = frame:getParent().args
local story = params[ 1 ]
local codes, lenient, multiple
if not story then
params = frame.args
story = params[ 1 ]
end
if story then
local items = mw.text.split( mw.text.trim(story), "%s+" )
if #items > 0 then
local j
lenient = (yesNo(params.errors) == false)
codes = { }
multiple = tonumber( params[ "*" ] )
for _, v in ipairs( items ) do
j = tonumber((v:sub( 1, 1 ) == "x" and "0" or "") .. v)
table.insert( codes, j or v )
end
end
end
return Text.char( codes, multiple, lenient )
end
function p.concatParams( frame )
local args
local template = frame.args.template
if type( template ) == "string" then
template = mw.text.trim( template )
template = ( template == "1" )
end
if template then
args = frame:getParent().args
else
args = frame.args
end
return Text.concatParams( args,
frame.args.separator,
frame.args.format )
end
function p.listToFormat(frame)
local lists = {}
local pformat = frame.args["format"]
local sep = frame.args["sep"] or ";"
-- Parameter parsen: Listen
for k, v in pairs(frame.args) do
local knum = tonumber(k)
if knum then lists[knum] = v end
end
-- Listen splitten
local maxListLen = 0
for i = 1, #lists do
lists[i] = mw.text.split(lists[i], sep)
if #lists[i] > maxListLen then maxListLen = #lists[i] end
end
-- Ergebnisstring generieren
local result = ""
local result_line = ""
for i = 1, maxListLen do
result_line = pformat
for j = 1, #lists do
result_line = mw.ustring.gsub(result_line, "%%s", lists[j][i], 1)
end
result = result .. result_line
end
return result
end
function p.listToText( frame )
local args
local template = frame.args.template
if type( template ) == "string" then
template = mw.text.trim( template )
template = ( template == "1" )
end
if template then
args = frame:getParent().args
else
args = frame.args
end
return Text.listToText( args, frame.args.format )
end
function p.quote( frame )
local slang = frame.args[2]
if type( slang ) == "string" then
slang = mw.text.trim( slang )
if slang == "" then
slang = false
end
end
return Text.quote( frame.args[ 1 ] or "",
slang,
tonumber( frame.args[3] ) )
end
function p.quoteUnquoted( frame )
local slang = frame.args[2]
if type( slang ) == "string" then
slang = mw.text.trim( slang )
if slang == "" then
slang = false
end
end
return Text.quoteUnquoted( frame.args[ 1 ] or "",
slang,
tonumber( frame.args[3] ) )
end
function p.zip(frame)
local lists = {}
local seps = {}
local defaultsep = frame.args["sep"] or ""
local innersep = frame.args["isep"] or ""
local outersep = frame.args["osep"] or ""
-- Parameter parsen
for k, v in pairs(frame.args) do
local knum = tonumber(k)
if knum then lists[knum] = v else
if string.sub(k, 1, 3) == "sep" then
local sepnum = tonumber(string.sub(k, 4))
if sepnum then seps[sepnum] = v end
end
end
end
-- sofern keine expliziten Separatoren angegeben sind, den Standardseparator verwenden
for i = 1, math.max(#seps, #lists) do
if not seps[i] then seps[i] = defaultsep end
end
-- Listen splitten
local maxListLen = 0
for i = 1, #lists do
lists[i] = mw.text.split(lists[i], seps[i])
if #lists[i] > maxListLen then maxListLen = #lists[i] end
end
local result = ""
for i = 1, maxListLen do
if i ~= 1 then result = result .. outersep end
for j = 1, #lists do
if j ~= 1 then result = result .. innersep end
result = result .. (lists[j][i] or "")
end
end
return result
end
function p.failsafe()
return Text.serial
end
p.Text = function ()
return Text
end -- p.Text
return p
07f1fc4d39342fd92bdae1c5463bbfede7eeda1a
Template:Para
10
177
371
2022-07-22T08:06:17Z
wikipedia>TheDJ
0
breakup super long words, so we do not overflow the viewport.
wikitext
text/x-wiki
<code class="tpl-para" style="word-break:break-word;{{SAFESUBST:<noinclude />#if:{{{plain|}}}|border: none; background-color: inherit;}} {{SAFESUBST:<noinclude />#if:{{{plain|}}}{{{mxt|}}}{{{green|}}}{{{!mxt|}}}{{{red|}}}|color: {{SAFESUBST:<noinclude />#if:{{{mxt|}}}{{{green|}}}|#006400|{{SAFESUBST:<noinclude />#if:{{{!mxt|}}}{{{red|}}}|#8B0000|inherit}}}};}} {{SAFESUBST:<noinclude />#if:{{{style|}}}|{{{style}}}}}">|{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{1}}}=}}{{{2|}}}</code><noinclude>
{{Documentation}}
<!--Categories and interwikis go near the bottom of the /doc subpage.-->
</noinclude>
06006deea2ed5d552aab61b4332321ab749ae7e8
Template:Plain text
10
149
306
2022-08-01T20:08:40Z
wikipedia>Neveselbert
0
Reverting edit(s) by [[Special:Contributions/Neveselbert|Neveselbert]] ([[User_talk:Neveselbert|talk]]) to rev. 995473403 by Scottywong: Reverting [[WP:AGF|good faith]] edits [[w:en:WP:RW|(RW 16.1)]]
wikitext
text/x-wiki
<noinclude>{{pp-template|small=yes}}</noinclude>{{#invoke:Plain text|main|{{{1|}}}}}<noinclude>
{{documentation}}
</noinclude>
a314b48913b9772c90a2ace218da4d833852e757
Template:Used in system
10
179
375
2022-08-20T15:58:28Z
wikipedia>Pppery
0
Not an improvement - there's already a well-established edit request process starting with clicking "view source" and we don't need a duplicative process for the specific set of templates that are used in system messages
wikitext
text/x-wiki
{{#invoke:High-use|main|1=|2={{{2|}}}|system={{#if:{{{1|}}}|{{{1}}}|in system messages}}<noinclude>|nocat=true</noinclude>}}<noinclude>
{{documentation}}<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
0abe278369db6cbbe319e7452d7644e27e11c532
Module:Hatnote
828
29
60
2022-09-05T18:18:32Z
wikipedia>Nihiltres
0
Reordered helper functions (first by export status, then alphabetically) and migrated p.quote upstream from [[Module:Redirect hatnote]] (includes contributions by Tamzin and Nihiltres)
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote --
-- --
-- This module produces hatnote links and links to related articles. It --
-- implements the {{hatnote}} and {{format link}} meta-templates and includes --
-- helper functions for other Lua hatnote modules. --
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local yesno -- lazily initialise [[Module:Yesno]]
local formatLink -- lazily initialise [[Module:Format link]] ._formatLink
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
function p.defaultClasses(inline)
-- Provides the default hatnote classes as a space-separated string; useful
-- for hatnote-manipulation modules like [[Module:Hatnote group]].
return
(inline == 1 and 'hatnote-inline' or 'hatnote') .. ' ' ..
'navigation-not-searchable'
end
function p.disambiguate(page, disambiguator)
-- Formats a page title with a disambiguation parenthetical,
-- i.e. "Example" → "Example (disambiguation)".
checkType('disambiguate', 1, page, 'string')
checkType('disambiguate', 2, disambiguator, 'string', true)
disambiguator = disambiguator or 'disambiguation'
return mw.ustring.format('%s (%s)', page, disambiguator)
end
function p.findNamespaceId(link, removeColon)
-- Finds the namespace id (namespace number) of a link or a pagename. This
-- function will not work if the link is enclosed in double brackets. Colons
-- are trimmed from the start of the link by default. To skip colon
-- trimming, set the removeColon parameter to false.
checkType('findNamespaceId', 1, link, 'string')
checkType('findNamespaceId', 2, removeColon, 'boolean', true)
if removeColon ~= false then
link = removeInitialColon(link)
end
local namespace = link:match('^(.-):')
if namespace then
local nsTable = mw.site.namespaces[namespace]
if nsTable then
return nsTable.id
end
end
return 0
end
function p.makeWikitextError(msg, helpLink, addTrackingCategory, title)
-- Formats an error message to be returned to wikitext. If
-- addTrackingCategory is not false after being returned from
-- [[Module:Yesno]], and if we are not on a talk page, a tracking category
-- is added.
checkType('makeWikitextError', 1, msg, 'string')
checkType('makeWikitextError', 2, helpLink, 'string', true)
yesno = require('Module:Yesno')
title = title or mw.title.getCurrentTitle()
-- Make the help link text.
local helpText
if helpLink then
helpText = ' ([[' .. helpLink .. '|help]])'
else
helpText = ''
end
-- Make the category text.
local category
if not title.isTalkPage -- Don't categorise talk pages
and title.namespace ~= 2 -- Don't categorise userspace
and yesno(addTrackingCategory) ~= false -- Allow opting out
then
category = 'Hatnote templates with errors'
category = mw.ustring.format(
'[[%s:%s]]',
mw.site.namespaces[14].name,
category
)
else
category = ''
end
return mw.ustring.format(
'<strong class="error">Error: %s%s.</strong>%s',
msg,
helpText,
category
)
end
local curNs = mw.title.getCurrentTitle().namespace
p.missingTargetCat =
--Default missing target category, exported for use in related modules
((curNs == 0) or (curNs == 14)) and
'Articles with hatnote templates targeting a nonexistent page' or nil
function p.quote(title)
--Wraps titles in quotation marks. If the title starts/ends with a quotation
--mark, kerns that side as with {{-'}}
local quotationMarks = {
["'"]=true, ['"']=true, ['“']=true, ["‘"]=true, ['”']=true, ["’"]=true
}
local quoteLeft, quoteRight = -- Test if start/end are quotation marks
quotationMarks[string.sub(title, 1, 1)],
quotationMarks[string.sub(title, -1, -1)]
if quoteLeft or quoteRight then
title = mw.html.create("span"):wikitext(title)
end
if quoteLeft then title:css("padding-left", "0.15em") end
if quoteRight then title:css("padding-right", "0.15em") end
return '"' .. tostring(title) .. '"'
end
--------------------------------------------------------------------------------
-- Hatnote
--
-- Produces standard hatnote text. Implements the {{hatnote}} template.
--------------------------------------------------------------------------------
function p.hatnote(frame)
local args = getArgs(frame)
local s = args[1]
if not s then
return p.makeWikitextError(
'no text specified',
'Template:Hatnote#Errors',
args.category
)
end
return p._hatnote(s, {
extraclasses = args.extraclasses,
selfref = args.selfref
})
end
function p._hatnote(s, options)
checkType('_hatnote', 1, s, 'string')
checkType('_hatnote', 2, options, 'table', true)
options = options or {}
local inline = options.inline
local hatnote = mw.html.create(inline == 1 and 'span' or 'div')
local extraclasses
if type(options.extraclasses) == 'string' then
extraclasses = options.extraclasses
end
hatnote
:attr('role', 'note')
:addClass(p.defaultClasses(inline))
:addClass(extraclasses)
:addClass(options.selfref and 'selfref' or nil)
:wikitext(s)
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Hatnote/styles.css' }
} .. tostring(hatnote)
end
return p
3ae1ed7094c5005ca0896395ec9a587287a0bef1
Module:URL
828
140
288
2022-09-11T18:55:11Z
wikipedia>Paine Ellsworth
0
per edit request on talk page - update
Scribunto
text/plain
--
-- This module implements {{URL}}
--
-- See unit tests at [[Module:URL/testcases]]
local p = {}
local function safeUri(s)
local success, uri = pcall(function()
return mw.uri.new(s)
end)
if success then
return uri
end
end
local function extractUrl(args)
for name, val in pairs(args) do
if name ~= 2 and name ~= "msg" then
local url = name .. "=" .. val;
url = mw.ustring.gsub(url, '^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])', 'http%1://%3')
local uri = safeUri(url);
if uri and uri.host then
return url
end
end
end
end
function p._url(url, text, msg)
url = mw.text.trim(url or '')
text = mw.text.trim(text or '')
local nomsg = (msg or ''):sub(1,1):lower() == "n" or msg == 'false' -- boolean: true if msg is "false" or starts with n or N
if url == '' then
if text == '' then
if nomsg then
return nil
else
return mw.getCurrentFrame():expandTemplate{ title = 'tlx', args = { 'URL', "''example.com''", "''optional display text''" } }
end
else
return text
end
end
-- If the URL contains any unencoded spaces, encode them, because MediaWiki will otherwise interpret a space as the end of the URL.
url = mw.ustring.gsub(url, '%s', function(s) return mw.uri.encode(s, 'PATH') end)
-- If there is an empty query string or fragment id, remove it as it will cause mw.uri.new to throw an error
url = mw.ustring.gsub(url, '#$', '')
url = mw.ustring.gsub(url, '%?$', '')
-- If it's an HTTP[S] URL without the double slash, fix it.
url = mw.ustring.gsub(url, '^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])', 'http%1://%3')
local uri = safeUri(url)
-- Handle URL's without a protocol and URL's that are protocol-relative,
-- e.g. www.example.com/foo or www.example.com:8080/foo, and //www.example.com/foo
if uri and (not uri.protocol or (uri.protocol and not uri.host)) and url:sub(1, 2) ~= '//' then
url = 'http://' .. url
uri = safeUri(url)
end
if text == '' then
if uri then
if uri.path == '/' then uri.path = '' end
local port = ''
if uri.port then port = ':' .. uri.port end
text = mw.ustring.lower(uri.host or '') .. port .. (uri.relativePath or '')
-- Add <wbr> before _/.-# sequences
text = mw.ustring.gsub(text,"(/+)","<wbr/>%1") -- This entry MUST be the first. "<wbr/>" has a "/" in it, you know.
text = mw.ustring.gsub(text,"(%.+)","<wbr/>%1")
-- text = mw.ustring.gsub(text,"(%-+)","<wbr/>%1") -- DISABLED for now
text = mw.ustring.gsub(text,"(%#+)","<wbr/>%1")
text = mw.ustring.gsub(text,"(_+)","<wbr/>%1")
else -- URL is badly-formed, so just display whatever was passed in
text = url
end
end
return mw.ustring.format('<span class="url">[%s %s]</span>', url, text)
end
--[[
The main entry point for calling from Template:URL.
--]]
function p.url(frame)
local templateArgs = frame.args
local parentArgs = frame:getParent().args
local url = templateArgs[1] or parentArgs[1]
local text = templateArgs[2] or parentArgs[2] or ''
local msg = templateArgs.msg or parentArgs.msg or ''
url = url or extractUrl(templateArgs) or extractUrl(parentArgs) or ''
return p._url(url, text, msg)
end
--[[
The entry point for calling from the forked Template:URL2.
This function returns no message by default.
It strips out wiki-link markup, html tags, and everything after a space.
--]]
function p.url2(frame)
local templateArgs = frame.args
local parentArgs = frame:getParent().args
local url = templateArgs[1] or parentArgs[1]
local text = templateArgs[2] or parentArgs[2] or ''
-- default to no message
local msg = templateArgs.msg or parentArgs.msg or 'no'
url = url or extractUrl(templateArgs) or extractUrl(parentArgs) or ''
-- if the url came from a Wikidata call, it might have a pen icon appended
-- we want to keep that and add it back at the end.
local u1, penicon = mw.ustring.match( url, "(.*)( <span class='penicon.*)" )
if penicon then url = u1 end
-- strip out html tags and [ ] from url
url = (url or ''):gsub("<[^>]*>", ""):gsub("[%[%]]", "")
-- truncate anything after a space
url = url:gsub("%%20", " "):gsub(" .*", "")
return (p._url(url, text, msg) or "") .. (penicon or "")
end
return p
8d7a4c6fe04a01815e940475cf64b28e1ef48cfb
Template:Parameter names example
10
153
314
2022-09-15T17:36:18Z
wikipedia>Aidan9382
0
Hatnote should ideally be moved into documentation as to allow users to edit it regardless of the protection on the main template
wikitext
text/x-wiki
<includeonly>{{#invoke:Parameter names example|main}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
de1e29d6ebc113e9d1649ea6a976625885db8a2f
Module:Protection banner
828
33
68
2022-10-21T08:07:11Z
wikipedia>WOSlinker
0
use require('strict') instead of require('Module:No globals')
Scribunto
text/plain
-- This module implements {{pp-meta}} and its daughter templates such as
-- {{pp-dispute}}, {{pp-vandalism}} and {{pp-sock}}.
-- Initialise necessary modules.
require('strict')
local makeFileLink = require('Module:File link')._main
local effectiveProtectionLevel = require('Module:Effective protection level')._main
local effectiveProtectionExpiry = require('Module:Effective protection expiry')._main
local yesno = require('Module:Yesno')
-- Lazily initialise modules and objects we don't always need.
local getArgs, makeMessageBox, lang
-- Set constants.
local CONFIG_MODULE = 'Module:Protection banner/config'
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function makeCategoryLink(cat, sort)
if cat then
return string.format(
'[[%s:%s|%s]]',
mw.site.namespaces[14].name,
cat,
sort
)
end
end
-- Validation function for the expiry and the protection date
local function validateDate(dateString, dateType)
if not lang then
lang = mw.language.getContentLanguage()
end
local success, result = pcall(lang.formatDate, lang, 'U', dateString)
if success then
result = tonumber(result)
if result then
return result
end
end
error(string.format(
'invalid %s: %s',
dateType,
tostring(dateString)
), 4)
end
local function makeFullUrl(page, query, display)
return string.format(
'[%s %s]',
tostring(mw.uri.fullUrl(page, query)),
display
)
end
-- Given a directed graph formatted as node -> table of direct successors,
-- get a table of all nodes reachable from a given node (though always
-- including the given node).
local function getReachableNodes(graph, start)
local toWalk, retval = {[start] = true}, {}
while true do
-- Can't use pairs() since we're adding and removing things as we're iterating
local k = next(toWalk) -- This always gets the "first" key
if k == nil then
return retval
end
toWalk[k] = nil
retval[k] = true
for _,v in ipairs(graph[k]) do
if not retval[v] then
toWalk[v] = true
end
end
end
end
--------------------------------------------------------------------------------
-- Protection class
--------------------------------------------------------------------------------
local Protection = {}
Protection.__index = Protection
Protection.supportedActions = {
edit = true,
move = true,
autoreview = true,
upload = true
}
Protection.bannerConfigFields = {
'text',
'explanation',
'tooltip',
'alt',
'link',
'image'
}
function Protection.new(args, cfg, title)
local obj = {}
obj._cfg = cfg
obj.title = title or mw.title.getCurrentTitle()
-- Set action
if not args.action then
obj.action = 'edit'
elseif Protection.supportedActions[args.action] then
obj.action = args.action
else
error(string.format(
'invalid action: %s',
tostring(args.action)
), 3)
end
-- Set level
obj.level = args.demolevel or effectiveProtectionLevel(obj.action, obj.title)
if not obj.level or (obj.action == 'move' and obj.level == 'autoconfirmed') then
-- Users need to be autoconfirmed to move pages anyway, so treat
-- semi-move-protected pages as unprotected.
obj.level = '*'
end
-- Set expiry
local effectiveExpiry = effectiveProtectionExpiry(obj.action, obj.title)
if effectiveExpiry == 'infinity' then
obj.expiry = 'indef'
elseif effectiveExpiry ~= 'unknown' then
obj.expiry = validateDate(effectiveExpiry, 'expiry date')
end
-- Set reason
if args[1] then
obj.reason = mw.ustring.lower(args[1])
if obj.reason:find('|') then
error('reasons cannot contain the pipe character ("|")', 3)
end
end
-- Set protection date
if args.date then
obj.protectionDate = validateDate(args.date, 'protection date')
end
-- Set banner config
do
obj.bannerConfig = {}
local configTables = {}
if cfg.banners[obj.action] then
configTables[#configTables + 1] = cfg.banners[obj.action][obj.reason]
end
if cfg.defaultBanners[obj.action] then
configTables[#configTables + 1] = cfg.defaultBanners[obj.action][obj.level]
configTables[#configTables + 1] = cfg.defaultBanners[obj.action].default
end
configTables[#configTables + 1] = cfg.masterBanner
for i, field in ipairs(Protection.bannerConfigFields) do
for j, t in ipairs(configTables) do
if t[field] then
obj.bannerConfig[field] = t[field]
break
end
end
end
end
return setmetatable(obj, Protection)
end
function Protection:isUserScript()
-- Whether the page is a user JavaScript or CSS page.
local title = self.title
return title.namespace == 2 and (
title.contentModel == 'javascript' or title.contentModel == 'css'
)
end
function Protection:isProtected()
return self.level ~= '*'
end
function Protection:shouldShowLock()
-- Whether we should output a banner/padlock
return self:isProtected() and not self:isUserScript()
end
-- Whether this page needs a protection category.
Protection.shouldHaveProtectionCategory = Protection.shouldShowLock
function Protection:isTemporary()
return type(self.expiry) == 'number'
end
function Protection:makeProtectionCategory()
if not self:shouldHaveProtectionCategory() then
return ''
end
local cfg = self._cfg
local title = self.title
-- Get the expiry key fragment.
local expiryFragment
if self.expiry == 'indef' then
expiryFragment = self.expiry
elseif type(self.expiry) == 'number' then
expiryFragment = 'temp'
end
-- Get the namespace key fragment.
local namespaceFragment = cfg.categoryNamespaceKeys[title.namespace]
if not namespaceFragment and title.namespace % 2 == 1 then
namespaceFragment = 'talk'
end
-- Define the order that key fragments are tested in. This is done with an
-- array of tables containing the value to be tested, along with its
-- position in the cfg.protectionCategories table.
local order = {
{val = expiryFragment, keypos = 1},
{val = namespaceFragment, keypos = 2},
{val = self.reason, keypos = 3},
{val = self.level, keypos = 4},
{val = self.action, keypos = 5}
}
--[[
-- The old protection templates used an ad-hoc protection category system,
-- with some templates prioritising namespaces in their categories, and
-- others prioritising the protection reason. To emulate this in this module
-- we use the config table cfg.reasonsWithNamespacePriority to set the
-- reasons for which namespaces have priority over protection reason.
-- If we are dealing with one of those reasons, move the namespace table to
-- the end of the order table, i.e. give it highest priority. If not, the
-- reason should have highest priority, so move that to the end of the table
-- instead.
--]]
table.insert(order, table.remove(order, self.reason and cfg.reasonsWithNamespacePriority[self.reason] and 2 or 3))
--[[
-- Define the attempt order. Inactive subtables (subtables with nil "value"
-- fields) are moved to the end, where they will later be given the key
-- "all". This is to cut down on the number of table lookups in
-- cfg.protectionCategories, which grows exponentially with the number of
-- non-nil keys. We keep track of the number of active subtables with the
-- noActive parameter.
--]]
local noActive, attemptOrder
do
local active, inactive = {}, {}
for i, t in ipairs(order) do
if t.val then
active[#active + 1] = t
else
inactive[#inactive + 1] = t
end
end
noActive = #active
attemptOrder = active
for i, t in ipairs(inactive) do
attemptOrder[#attemptOrder + 1] = t
end
end
--[[
-- Check increasingly generic key combinations until we find a match. If a
-- specific category exists for the combination of key fragments we are
-- given, that match will be found first. If not, we keep trying different
-- key fragment combinations until we match using the key
-- "all-all-all-all-all".
--
-- To generate the keys, we index the key subtables using a binary matrix
-- with indexes i and j. j is only calculated up to the number of active
-- subtables. For example, if there were three active subtables, the matrix
-- would look like this, with 0 corresponding to the key fragment "all", and
-- 1 corresponding to other key fragments.
--
-- j 1 2 3
-- i
-- 1 1 1 1
-- 2 0 1 1
-- 3 1 0 1
-- 4 0 0 1
-- 5 1 1 0
-- 6 0 1 0
-- 7 1 0 0
-- 8 0 0 0
--
-- Values of j higher than the number of active subtables are set
-- to the string "all".
--
-- A key for cfg.protectionCategories is constructed for each value of i.
-- The position of the value in the key is determined by the keypos field in
-- each subtable.
--]]
local cats = cfg.protectionCategories
for i = 1, 2^noActive do
local key = {}
for j, t in ipairs(attemptOrder) do
if j > noActive then
key[t.keypos] = 'all'
else
local quotient = i / 2 ^ (j - 1)
quotient = math.ceil(quotient)
if quotient % 2 == 1 then
key[t.keypos] = t.val
else
key[t.keypos] = 'all'
end
end
end
key = table.concat(key, '|')
local attempt = cats[key]
if attempt then
return makeCategoryLink(attempt, title.text)
end
end
return ''
end
function Protection:isIncorrect()
local expiry = self.expiry
return not self:shouldHaveProtectionCategory()
or type(expiry) == 'number' and expiry < os.time()
end
function Protection:isTemplateProtectedNonTemplate()
local action, namespace = self.action, self.title.namespace
return self.level == 'templateeditor'
and (
(action ~= 'edit' and action ~= 'move')
or (namespace ~= 10 and namespace ~= 828)
)
end
function Protection:makeCategoryLinks()
local msg = self._cfg.msg
local ret = {self:makeProtectionCategory()}
if self:isIncorrect() then
ret[#ret + 1] = makeCategoryLink(
msg['tracking-category-incorrect'],
self.title.text
)
end
if self:isTemplateProtectedNonTemplate() then
ret[#ret + 1] = makeCategoryLink(
msg['tracking-category-template'],
self.title.text
)
end
return table.concat(ret)
end
--------------------------------------------------------------------------------
-- Blurb class
--------------------------------------------------------------------------------
local Blurb = {}
Blurb.__index = Blurb
Blurb.bannerTextFields = {
text = true,
explanation = true,
tooltip = true,
alt = true,
link = true
}
function Blurb.new(protectionObj, args, cfg)
return setmetatable({
_cfg = cfg,
_protectionObj = protectionObj,
_args = args
}, Blurb)
end
-- Private methods --
function Blurb:_formatDate(num)
-- Formats a Unix timestamp into dd Month, YYYY format.
lang = lang or mw.language.getContentLanguage()
local success, date = pcall(
lang.formatDate,
lang,
self._cfg.msg['expiry-date-format'] or 'j F Y',
'@' .. tostring(num)
)
if success then
return date
end
end
function Blurb:_getExpandedMessage(msgKey)
return self:_substituteParameters(self._cfg.msg[msgKey])
end
function Blurb:_substituteParameters(msg)
if not self._params then
local parameterFuncs = {}
parameterFuncs.CURRENTVERSION = self._makeCurrentVersionParameter
parameterFuncs.EDITREQUEST = self._makeEditRequestParameter
parameterFuncs.EXPIRY = self._makeExpiryParameter
parameterFuncs.EXPLANATIONBLURB = self._makeExplanationBlurbParameter
parameterFuncs.IMAGELINK = self._makeImageLinkParameter
parameterFuncs.INTROBLURB = self._makeIntroBlurbParameter
parameterFuncs.INTROFRAGMENT = self._makeIntroFragmentParameter
parameterFuncs.PAGETYPE = self._makePagetypeParameter
parameterFuncs.PROTECTIONBLURB = self._makeProtectionBlurbParameter
parameterFuncs.PROTECTIONDATE = self._makeProtectionDateParameter
parameterFuncs.PROTECTIONLEVEL = self._makeProtectionLevelParameter
parameterFuncs.PROTECTIONLOG = self._makeProtectionLogParameter
parameterFuncs.TALKPAGE = self._makeTalkPageParameter
parameterFuncs.TOOLTIPBLURB = self._makeTooltipBlurbParameter
parameterFuncs.TOOLTIPFRAGMENT = self._makeTooltipFragmentParameter
parameterFuncs.VANDAL = self._makeVandalTemplateParameter
self._params = setmetatable({}, {
__index = function (t, k)
local param
if parameterFuncs[k] then
param = parameterFuncs[k](self)
end
param = param or ''
t[k] = param
return param
end
})
end
msg = msg:gsub('${(%u+)}', self._params)
return msg
end
function Blurb:_makeCurrentVersionParameter()
-- A link to the page history or the move log, depending on the kind of
-- protection.
local pagename = self._protectionObj.title.prefixedText
if self._protectionObj.action == 'move' then
-- We need the move log link.
return makeFullUrl(
'Special:Log',
{type = 'move', page = pagename},
self:_getExpandedMessage('current-version-move-display')
)
else
-- We need the history link.
return makeFullUrl(
pagename,
{action = 'history'},
self:_getExpandedMessage('current-version-edit-display')
)
end
end
function Blurb:_makeEditRequestParameter()
local mEditRequest = require('Module:Submit an edit request')
local action = self._protectionObj.action
local level = self._protectionObj.level
-- Get the edit request type.
local requestType
if action == 'edit' then
if level == 'autoconfirmed' then
requestType = 'semi'
elseif level == 'extendedconfirmed' then
requestType = 'extended'
elseif level == 'templateeditor' then
requestType = 'template'
end
end
requestType = requestType or 'full'
-- Get the display value.
local display = self:_getExpandedMessage('edit-request-display')
return mEditRequest._link{type = requestType, display = display}
end
function Blurb:_makeExpiryParameter()
local expiry = self._protectionObj.expiry
if type(expiry) == 'number' then
return self:_formatDate(expiry)
else
return expiry
end
end
function Blurb:_makeExplanationBlurbParameter()
-- Cover special cases first.
if self._protectionObj.title.namespace == 8 then
-- MediaWiki namespace
return self:_getExpandedMessage('explanation-blurb-nounprotect')
end
-- Get explanation blurb table keys
local action = self._protectionObj.action
local level = self._protectionObj.level
local talkKey = self._protectionObj.title.isTalkPage and 'talk' or 'subject'
-- Find the message in the explanation blurb table and substitute any
-- parameters.
local explanations = self._cfg.explanationBlurbs
local msg
if explanations[action][level] and explanations[action][level][talkKey] then
msg = explanations[action][level][talkKey]
elseif explanations[action][level] and explanations[action][level].default then
msg = explanations[action][level].default
elseif explanations[action].default and explanations[action].default[talkKey] then
msg = explanations[action].default[talkKey]
elseif explanations[action].default and explanations[action].default.default then
msg = explanations[action].default.default
else
error(string.format(
'could not find explanation blurb for action "%s", level "%s" and talk key "%s"',
action,
level,
talkKey
), 8)
end
return self:_substituteParameters(msg)
end
function Blurb:_makeImageLinkParameter()
local imageLinks = self._cfg.imageLinks
local action = self._protectionObj.action
local level = self._protectionObj.level
local msg
if imageLinks[action][level] then
msg = imageLinks[action][level]
elseif imageLinks[action].default then
msg = imageLinks[action].default
else
msg = imageLinks.edit.default
end
return self:_substituteParameters(msg)
end
function Blurb:_makeIntroBlurbParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('intro-blurb-expiry')
else
return self:_getExpandedMessage('intro-blurb-noexpiry')
end
end
function Blurb:_makeIntroFragmentParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('intro-fragment-expiry')
else
return self:_getExpandedMessage('intro-fragment-noexpiry')
end
end
function Blurb:_makePagetypeParameter()
local pagetypes = self._cfg.pagetypes
return pagetypes[self._protectionObj.title.namespace]
or pagetypes.default
or error('no default pagetype defined', 8)
end
function Blurb:_makeProtectionBlurbParameter()
local protectionBlurbs = self._cfg.protectionBlurbs
local action = self._protectionObj.action
local level = self._protectionObj.level
local msg
if protectionBlurbs[action][level] then
msg = protectionBlurbs[action][level]
elseif protectionBlurbs[action].default then
msg = protectionBlurbs[action].default
elseif protectionBlurbs.edit.default then
msg = protectionBlurbs.edit.default
else
error('no protection blurb defined for protectionBlurbs.edit.default', 8)
end
return self:_substituteParameters(msg)
end
function Blurb:_makeProtectionDateParameter()
local protectionDate = self._protectionObj.protectionDate
if type(protectionDate) == 'number' then
return self:_formatDate(protectionDate)
else
return protectionDate
end
end
function Blurb:_makeProtectionLevelParameter()
local protectionLevels = self._cfg.protectionLevels
local action = self._protectionObj.action
local level = self._protectionObj.level
local msg
if protectionLevels[action][level] then
msg = protectionLevels[action][level]
elseif protectionLevels[action].default then
msg = protectionLevels[action].default
elseif protectionLevels.edit.default then
msg = protectionLevels.edit.default
else
error('no protection level defined for protectionLevels.edit.default', 8)
end
return self:_substituteParameters(msg)
end
function Blurb:_makeProtectionLogParameter()
local pagename = self._protectionObj.title.prefixedText
if self._protectionObj.action == 'autoreview' then
-- We need the pending changes log.
return makeFullUrl(
'Special:Log',
{type = 'stable', page = pagename},
self:_getExpandedMessage('pc-log-display')
)
else
-- We need the protection log.
return makeFullUrl(
'Special:Log',
{type = 'protect', page = pagename},
self:_getExpandedMessage('protection-log-display')
)
end
end
function Blurb:_makeTalkPageParameter()
return string.format(
'[[%s:%s#%s|%s]]',
mw.site.namespaces[self._protectionObj.title.namespace].talk.name,
self._protectionObj.title.text,
self._args.section or 'top',
self:_getExpandedMessage('talk-page-link-display')
)
end
function Blurb:_makeTooltipBlurbParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('tooltip-blurb-expiry')
else
return self:_getExpandedMessage('tooltip-blurb-noexpiry')
end
end
function Blurb:_makeTooltipFragmentParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('tooltip-fragment-expiry')
else
return self:_getExpandedMessage('tooltip-fragment-noexpiry')
end
end
function Blurb:_makeVandalTemplateParameter()
return mw.getCurrentFrame():expandTemplate{
title="vandal-m",
args={self._args.user or self._protectionObj.title.baseText}
}
end
-- Public methods --
function Blurb:makeBannerText(key)
-- Validate input.
if not key or not Blurb.bannerTextFields[key] then
error(string.format(
'"%s" is not a valid banner config field',
tostring(key)
), 2)
end
-- Generate the text.
local msg = self._protectionObj.bannerConfig[key]
if type(msg) == 'string' then
return self:_substituteParameters(msg)
elseif type(msg) == 'function' then
msg = msg(self._protectionObj, self._args)
if type(msg) ~= 'string' then
error(string.format(
'bad output from banner config function with key "%s"'
.. ' (expected string, got %s)',
tostring(key),
type(msg)
), 4)
end
return self:_substituteParameters(msg)
end
end
--------------------------------------------------------------------------------
-- BannerTemplate class
--------------------------------------------------------------------------------
local BannerTemplate = {}
BannerTemplate.__index = BannerTemplate
function BannerTemplate.new(protectionObj, cfg)
local obj = {}
obj._cfg = cfg
-- Set the image filename.
local imageFilename = protectionObj.bannerConfig.image
if imageFilename then
obj._imageFilename = imageFilename
else
-- If an image filename isn't specified explicitly in the banner config,
-- generate it from the protection status and the namespace.
local action = protectionObj.action
local level = protectionObj.level
local namespace = protectionObj.title.namespace
local reason = protectionObj.reason
-- Deal with special cases first.
if (
namespace == 10
or namespace == 828
or reason and obj._cfg.indefImageReasons[reason]
)
and action == 'edit'
and level == 'sysop'
and not protectionObj:isTemporary()
then
-- Fully protected modules and templates get the special red "indef"
-- padlock.
obj._imageFilename = obj._cfg.msg['image-filename-indef']
else
-- Deal with regular protection types.
local images = obj._cfg.images
if images[action] then
if images[action][level] then
obj._imageFilename = images[action][level]
elseif images[action].default then
obj._imageFilename = images[action].default
end
end
end
end
return setmetatable(obj, BannerTemplate)
end
function BannerTemplate:renderImage()
local filename = self._imageFilename
or self._cfg.msg['image-filename-default']
or 'Transparent.gif'
return makeFileLink{
file = filename,
size = (self.imageWidth or 20) .. 'px',
alt = self._imageAlt,
link = self._imageLink,
caption = self.imageCaption
}
end
--------------------------------------------------------------------------------
-- Banner class
--------------------------------------------------------------------------------
local Banner = setmetatable({}, BannerTemplate)
Banner.__index = Banner
function Banner.new(protectionObj, blurbObj, cfg)
local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
obj.imageWidth = 40
obj.imageCaption = blurbObj:makeBannerText('alt') -- Large banners use the alt text for the tooltip.
obj._reasonText = blurbObj:makeBannerText('text')
obj._explanationText = blurbObj:makeBannerText('explanation')
obj._page = protectionObj.title.prefixedText -- Only makes a difference in testing.
return setmetatable(obj, Banner)
end
function Banner:__tostring()
-- Renders the banner.
makeMessageBox = makeMessageBox or require('Module:Message box').main
local reasonText = self._reasonText or error('no reason text set', 2)
local explanationText = self._explanationText
local mbargs = {
page = self._page,
type = 'protection',
image = self:renderImage(),
text = string.format(
"'''%s'''%s",
reasonText,
explanationText and '<br />' .. explanationText or ''
)
}
return makeMessageBox('mbox', mbargs)
end
--------------------------------------------------------------------------------
-- Padlock class
--------------------------------------------------------------------------------
local Padlock = setmetatable({}, BannerTemplate)
Padlock.__index = Padlock
function Padlock.new(protectionObj, blurbObj, cfg)
local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
obj.imageWidth = 20
obj.imageCaption = blurbObj:makeBannerText('tooltip')
obj._imageAlt = blurbObj:makeBannerText('alt')
obj._imageLink = blurbObj:makeBannerText('link')
obj._indicatorName = cfg.padlockIndicatorNames[protectionObj.action]
or cfg.padlockIndicatorNames.default
or 'pp-default'
return setmetatable(obj, Padlock)
end
function Padlock:__tostring()
local frame = mw.getCurrentFrame()
-- The nowiki tag helps prevent whitespace at the top of articles.
return frame:extensionTag{name = 'nowiki'} .. frame:extensionTag{
name = 'indicator',
args = {name = self._indicatorName},
content = self:renderImage()
}
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p = {}
function p._exportClasses()
-- This is used for testing purposes.
return {
Protection = Protection,
Blurb = Blurb,
BannerTemplate = BannerTemplate,
Banner = Banner,
Padlock = Padlock,
}
end
function p._main(args, cfg, title)
args = args or {}
cfg = cfg or require(CONFIG_MODULE)
local protectionObj = Protection.new(args, cfg, title)
local ret = {}
-- If a page's edit protection is equally or more restrictive than its
-- protection from some other action, then don't bother displaying anything
-- for the other action (except categories).
if not yesno(args.catonly) and (protectionObj.action == 'edit' or
args.demolevel or
not getReachableNodes(
cfg.hierarchy,
protectionObj.level
)[effectiveProtectionLevel('edit', protectionObj.title)])
then
-- Initialise the blurb object
local blurbObj = Blurb.new(protectionObj, args, cfg)
-- Render the banner
if protectionObj:shouldShowLock() then
ret[#ret + 1] = tostring(
(yesno(args.small) and Padlock or Banner)
.new(protectionObj, blurbObj, cfg)
)
end
end
-- Render the categories
if yesno(args.category) ~= false then
ret[#ret + 1] = protectionObj:makeCategoryLinks()
end
return table.concat(ret)
end
function p.main(frame, cfg)
cfg = cfg or require(CONFIG_MODULE)
-- Find default args, if any.
local parent = frame.getParent and frame:getParent()
local defaultArgs = parent and cfg.wrappers[parent:getTitle():gsub('/sandbox$', '')]
-- Find user args, and use the parent frame if we are being called from a
-- wrapper template.
getArgs = getArgs or require('Module:Arguments').getArgs
local userArgs = getArgs(frame, {
parentOnly = defaultArgs,
frameOnly = not defaultArgs
})
-- Build the args table. User-specified args overwrite default args.
local args = {}
for k, v in pairs(defaultArgs or {}) do
args[k] = v
end
for k, v in pairs(userArgs) do
args[k] = v
end
return p._main(args, cfg)
end
return p
894f0884d4c2da1ce19d385b96f59af654b0946a
Module:Section link
828
189
395
2022-10-22T09:09:53Z
wikipedia>WOSlinker
0
use require('strict') instead of require('Module:No globals')
Scribunto
text/plain
-- This module implements {{section link}}.
require('strict');
local checkType = require('libraryUtil').checkType
local p = {}
local function makeSectionLink(page, section, display)
display = display or section
page = page or ''
-- MediaWiki doesn't allow these in `page`, so only need to do for `section`
if type(section) == 'string' then
section = string.gsub(section, "{", "{")
section = string.gsub(section, "}", "}")
end
return string.format('[[%s#%s|%s]]', page, section, display)
end
local function normalizeTitle(title)
title = mw.ustring.gsub(mw.ustring.gsub(title, "'", ""), '"', '')
title = mw.ustring.gsub(title, "%b<>", "")
return mw.title.new(title).prefixedText
end
function p._main(page, sections, options, title)
-- Validate input.
checkType('_main', 1, page, 'string', true)
checkType('_main', 3, options, 'table', true)
if sections == nil then
sections = {}
elseif type(sections) == 'string' then
sections = {sections}
elseif type(sections) ~= 'table' then
error(string.format(
"type error in argument #2 to '_main' " ..
"(string, table or nil expected, got %s)",
type(sections)
), 2)
end
options = options or {}
title = title or mw.title.getCurrentTitle()
-- Deal with blank page names elegantly
if page and not page:find('%S') then
page = nil
options.nopage = true
end
-- Make the link(s).
local isShowingPage = not options.nopage
if #sections <= 1 then
local linkPage = page or ''
local section = sections[1] or 'Notes'
local display = '§ ' .. section
if isShowingPage then
page = page or title.prefixedText
if options.display and options.display ~= '' then
if normalizeTitle(options.display) == normalizeTitle(page) then
display = options.display .. ' ' .. display
else
error(string.format(
'Display title "%s" was ignored since it is ' ..
"not equivalent to the page's actual title",
options.display
), 0)
end
else
display = page .. ' ' .. display
end
end
return makeSectionLink(linkPage, section, display)
else
-- Multiple sections. First, make a list of the links to display.
local ret = {}
for i, section in ipairs(sections) do
ret[i] = makeSectionLink(page, section)
end
-- Assemble the list of links into a string with mw.text.listToText.
-- We use the default separator for mw.text.listToText, but a custom
-- conjunction. There is also a special case conjunction if we only
-- have two links.
local conjunction
if #sections == 2 then
conjunction = '​ and '
else
conjunction = ', and '
end
ret = mw.text.listToText(ret, nil, conjunction)
-- Add the intro text.
local intro = '§§ '
if isShowingPage then
intro = (page or title.prefixedText) .. ' ' .. intro
end
ret = intro .. ret
return ret
end
end
function p.main(frame)
local yesno = require('Module:Yesno')
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Section link',
valueFunc = function (key, value)
value = value:match('^%s*(.-)%s*$') -- Trim whitespace
-- Allow blank first parameters, as the wikitext template does this.
if value ~= '' or key == 1 then
return value
end
end
})
for k, v in pairs(args) do -- replace underscores in the positional parameter values
if 'number' == type(k) then
if not yesno (args['keep-underscores']) then -- unless |keep-underscores=yes
args[k] = mw.uri.decode (v, 'WIKI'); -- percent-decode; replace underscores with space characters
else
args[k] = mw.uri.decode (v, 'PATH'); -- percent-decode; retain underscores
end
end
end
-- Sort the arguments.
local page
local sections, options = {}, {}
for k, v in pairs(args) do
if k == 1 then
-- Doing this in the loop because of a bug in [[Module:Arguments]]
-- when using pairs with deleted arguments.
page = mw.text.decode(v, true)
elseif type(k) == 'number' then
sections[k] = v
else
options[k] = v
end
end
options.nopage = yesno (options.nopage); -- make boolean
-- Extract section from page, if present
if page then
local p, s = page:match('^(.-)#(.*)$')
if p then page, sections[1] = p, s end
end
-- Compress the sections array.
local function compressArray(t)
local nums, ret = {}, {}
for num in pairs(t) do
nums[#nums + 1] = num
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[i] = t[num]
end
return ret
end
sections = compressArray(sections)
return p._main(page, sections, options)
end
return p
5cc61d43dc601ca43e9472500fc5cd09ca7cea44
Module:Message box
828
12
26
2022-10-23T04:26:44Z
wikipedia>Legoktm
0
Replace [[Module:No globals]] with require( "strict" )
Scribunto
text/plain
require('strict')
local getArgs
local yesno = require('Module:Yesno')
local lang = mw.language.getContentLanguage()
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
-- Find if the box has been wrongly substituted.
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText
if self.isSmall then
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
talkText = string.format('([[%s|talk]])', talkLink)
else
talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <span class='date-container'><i>(<span class='date'>%s</span>)</i></span>", date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage
or 'Imbox notice.png', imageSize)
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
-- set templatestyles
self.base_templatestyles = cfg.templatestyles
self.templatestyles = args.templatestyles
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
local frame = mw.getCurrentFrame()
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.base_templatestyles },
})
-- Add support for a single custom templatestyles sheet. Undocumented as
-- need should be limited and many templates using mbox are substed; we
-- don't want to spread templatestyles sheets around to arbitrary places
if self.templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.templatestyles },
})
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):addClass('mbox-image-div')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:addClass('mbox-invalid-type')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
bdb0ecc9f26f26b9c0ce12a066a183ac9d4f0705
Template:Mlx
10
192
401
2022-12-10T23:52:31Z
wikipedia>HouseBlaster
0
HouseBlaster moved page [[Template:Mlx]] to [[Template:Module link expanded]]: harmonize with [[Template:template link expanded]]
wikitext
text/x-wiki
#REDIRECT [[Template:Module link expanded]]
{{Redirect category shell|
{{R from move}}
}}
3a80cf77e735d41b1611f1bd7f028ce9941330a2
Template:Plainlist/styles.css
10
87
176
2022-12-11T06:59:53Z
wikipedia>Izno
0
add this reset from mobile.css
text
text/plain
/* {{pp-template|small=yes}} */
.plainlist ol,
.plainlist ul {
line-height: inherit;
list-style: none;
margin: 0;
padding: 0; /* Reset Minerva default */
}
.plainlist ol li,
.plainlist ul li {
margin-bottom: 0;
}
51706efa229ff8794c0d94f260a208e7c5e6ec30
Module:Shortcut
828
68
138
2022-12-13T23:41:34Z
wikipedia>Izno
0
use module:list for plainlist, move templatestyles to module space
Scribunto
text/plain
-- This module implements {{shortcut}}.
-- Set constants
local CONFIG_MODULE = 'Module:Shortcut/config'
-- Load required modules
local checkType = require('libraryUtil').checkType
local yesno = require('Module:Yesno')
local p = {}
local function message(msg, ...)
return mw.message.newRawMessage(msg, ...):plain()
end
local function makeCategoryLink(cat)
return string.format('[[%s:%s]]', mw.site.namespaces[14].name, cat)
end
function p._main(shortcuts, options, frame, cfg)
checkType('_main', 1, shortcuts, 'table')
checkType('_main', 2, options, 'table', true)
options = options or {}
frame = frame or mw.getCurrentFrame()
cfg = cfg or mw.loadData(CONFIG_MODULE)
local templateMode = options.template and yesno(options.template)
local redirectMode = options.redirect and yesno(options.redirect)
local isCategorized = not options.category or yesno(options.category) ~= false
-- Validate shortcuts
for i, shortcut in ipairs(shortcuts) do
if type(shortcut) ~= 'string' or #shortcut < 1 then
error(message(cfg['invalid-shortcut-error'], i), 2)
end
end
-- Make the list items. These are the shortcuts plus any extra lines such
-- as options.msg.
local listItems = {}
for i, shortcut in ipairs(shortcuts) do
local templatePath, prefix
if templateMode then
-- Namespace detection
local titleObj = mw.title.new(shortcut, 10)
if titleObj.namespace == 10 then
templatePath = titleObj.fullText
else
templatePath = shortcut
end
prefix = options['pre' .. i] or options.pre or ''
end
if options.target and yesno(options.target) then
listItems[i] = templateMode
and string.format("{{%s[[%s|%s]]}}", prefix, templatePath, shortcut)
or string.format("[[%s]]", shortcut)
else
listItems[i] = frame:expandTemplate{
title = 'No redirect',
args = templateMode and {templatePath, shortcut} or {shortcut, shortcut}
}
if templateMode then
listItems[i] = string.format("{{%s%s}}", prefix, listItems[i])
end
end
end
table.insert(listItems, options.msg)
-- Return an error if we have nothing to display
if #listItems < 1 then
local msg = cfg['no-content-error']
msg = string.format('<strong class="error">%s</strong>', msg)
if isCategorized and cfg['no-content-error-category'] then
msg = msg .. makeCategoryLink(cfg['no-content-error-category'])
end
return msg
end
local root = mw.html.create()
root:wikitext(frame:extensionTag{ name = 'templatestyles', args = { src = 'Module:Shortcut/styles.css'} })
-- Anchors
local anchorDiv = root
:tag('div')
:addClass('module-shortcutanchordiv')
for i, shortcut in ipairs(shortcuts) do
local anchor = mw.uri.anchorEncode(shortcut)
anchorDiv:tag('span'):attr('id', anchor)
end
-- Shortcut heading
local shortcutHeading
do
local nShortcuts = #shortcuts
if nShortcuts > 0 then
local headingMsg = options['shortcut-heading'] or
redirectMode and cfg['redirect-heading'] or
cfg['shortcut-heading']
shortcutHeading = message(headingMsg, nShortcuts)
shortcutHeading = frame:preprocess(shortcutHeading)
end
end
-- Shortcut box
local shortcutList = root
:tag('div')
:addClass('module-shortcutboxplain noprint')
:attr('role', 'note')
if options.float and options.float:lower() == 'left' then
shortcutList:addClass('module-shortcutboxleft')
end
if options.clear and options.clear ~= '' then
shortcutList:css('clear', options.clear)
end
if shortcutHeading then
shortcutList
:tag('div')
:addClass('module-shortcutlist')
:wikitext(shortcutHeading)
end
local ubl = require('Module:List').unbulleted(listItems)
shortcutList:wikitext(ubl)
return tostring(root)
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame)
-- Separate shortcuts from options
local shortcuts, options = {}, {}
for k, v in pairs(args) do
if type(k) == 'number' then
shortcuts[k] = v
else
options[k] = v
end
end
-- Compress the shortcut array, which may contain nils.
local function compressArray(t)
local nums, ret = {}, {}
for k in pairs(t) do
nums[#nums + 1] = k
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[i] = t[num]
end
return ret
end
shortcuts = compressArray(shortcuts)
return p._main(shortcuts, options, frame)
end
return p
03fd46a265e549852a9ed3d3a9249b247d84cb4f
Template:Mbox
10
9
20
2022-12-18T05:46:16Z
wikipedia>TadejM
0
wikitext
text/x-wiki
{{#invoke:Message box|mbox}}<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! -->
</noinclude>
5bfb2becf8bed35974b47e3ff8660dc14bee40c7
Template:Short description
10
6
14
2022-12-23T23:04:16Z
wikipedia>Fayenatic london
0
remove categories for several more namespaces, see [[Wikipedia:Categories for discussion/Log/2022 December 15#Pages with short description]]
wikitext
text/x-wiki
{{#ifeq:{{lc:{{{1|}}}}}|none|<nowiki /><!--Prevents whitespace issues when used with adjacent newlines-->|<div class="shortdescription nomobile noexcerpt noprint searchaux" style="display:none">{{{1|}}}{{SHORTDESC:{{{1|}}}|{{{2|}}}}}</div>}}<includeonly>{{#ifeq:{{{pagetype}}}|Disambiguation pages||{{#ifeq:{{pagetype |defaultns = all |user=exclude}}|exclude||{{#ifeq:{{#switch: {{NAMESPACENUMBER}} | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 100 | 101 | 118 | 119 | 828 | 829 | = exclude|#default=}}|exclude||[[Category:{{{pagetype|{{pagetype |defaultns = extended |plural=y}}}}} with short description]]}}}}}}</includeonly><!-- Start tracking
-->{{#invoke:Check for unknown parameters|check|unknown={{Main other|[[Category:Pages using short description with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Short description]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | pagetype | bot |plural }}<!--
-->{{#ifexpr: {{#invoke:String|len|{{{1|}}}}}>100 | [[Category:{{{pagetype|{{pagetype |defaultns = extended |plural=y}}}}} with long short description]]}}<!--
--><includeonly>{{#if:{{{1|}}}||[[Category:Pages with empty short description]]}}</includeonly><!--
-->{{Short description/lowercasecheck|{{{1|}}}}}<!--
-->{{Main other |{{SDcat |sd={{{1|}}} }} }}<noinclude>
{{Documentation}}
</noinclude>
f175a6d61b40a87adb43e2dd4f73c7979759b34c
Template:Hlist/styles.css
10
164
336
2022-12-26T18:00:17Z
wikipedia>Izno
0
actually remove that block, someone can dig for authorship
sanitized-css
text/css
/* {{pp-protected|reason=match parent|small=yes}} */
/*
* hlist styles are defined in core and Minerva and differ in Minerva. The
* current definitions here (2023-01-01) are sufficient to override Minerva
* without use of the hlist-separated class. The most problematic styles were
* related to margin, padding, and the bullet. Check files listed at
* [[MediaWiki talk:Common.css/to do#hlist-separated]]
*/
/*
* TODO: When the majority of readership supports it (or some beautiful world
* in which grade C support is above the minimum threshold), use :is()
*/
.hlist dl,
.hlist ol,
.hlist ul {
margin: 0;
padding: 0;
}
/* Display list items inline */
.hlist dd,
.hlist dt,
.hlist li {
/*
* don't trust the note that says margin doesn't work with inline
* removing margin: 0 makes dds have margins again
* We also want to reset margin-right in Minerva
*/
margin: 0;
display: inline;
}
/* Display requested top-level lists inline */
.hlist.inline,
.hlist.inline dl,
.hlist.inline ol,
.hlist.inline ul,
/* Display nested lists inline */
.hlist dl dl,
.hlist dl ol,
.hlist dl ul,
.hlist ol dl,
.hlist ol ol,
.hlist ol ul,
.hlist ul dl,
.hlist ul ol,
.hlist ul ul {
display: inline;
}
/* Hide empty list items */
.hlist .mw-empty-li {
display: none;
}
/* TODO: :not() can maybe be used here to remove the later rule. naive test
* seems to work. more testing needed. like so:
*.hlist dt:not(:last-child)::after {
* content: ": ";
*}
*.hlist dd:not(:last-child)::after,
*.hlist li:not(:last-child)::after {
* content: " · ";
* font-weight: bold;
*}
*/
/* Generate interpuncts */
.hlist dt::after {
content: ": ";
}
.hlist dd::after,
.hlist li::after {
content: " · ";
font-weight: bold;
}
.hlist dd:last-child::after,
.hlist dt:last-child::after,
.hlist li:last-child::after {
content: none;
}
/* Add parentheses around nested lists */
.hlist dd dd:first-child::before,
.hlist dd dt:first-child::before,
.hlist dd li:first-child::before,
.hlist dt dd:first-child::before,
.hlist dt dt:first-child::before,
.hlist dt li:first-child::before,
.hlist li dd:first-child::before,
.hlist li dt:first-child::before,
.hlist li li:first-child::before {
content: " (";
font-weight: normal;
}
.hlist dd dd:last-child::after,
.hlist dd dt:last-child::after,
.hlist dd li:last-child::after,
.hlist dt dd:last-child::after,
.hlist dt dt:last-child::after,
.hlist dt li:last-child::after,
.hlist li dd:last-child::after,
.hlist li dt:last-child::after,
.hlist li li:last-child::after {
content: ")";
font-weight: normal;
}
/* Put ordinals in front of ordered list items */
.hlist ol {
counter-reset: listitem;
}
.hlist ol > li {
counter-increment: listitem;
}
.hlist ol > li::before {
content: " " counter(listitem) "\a0";
}
.hlist dd ol > li:first-child::before,
.hlist dt ol > li:first-child::before,
.hlist li ol > li:first-child::before {
content: " (" counter(listitem) "\a0";
}
8c9dd9c9c00f30eead17fe10f51d183333e81f33
Module:Infobox
828
123
254
2022-12-27T21:29:12Z
wikipedia>Izno
0
merge hlist here
Scribunto
text/plain
local p = {}
local args = {}
local origArgs = {}
local root
local empty_row_categories = {}
local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'
local has_rows = false
local lists = {
plainlist_t = {
patterns = {
'^plainlist$',
'%splainlist$',
'^plainlist%s',
'%splainlist%s'
},
found = false,
styles = 'Plainlist/styles.css'
},
hlist_t = {
patterns = {
'^hlist$',
'%shlist$',
'^hlist%s',
'%shlist%s'
},
found = false,
styles = 'Hlist/styles.css'
}
}
local function has_list_class(args_to_check)
for _, list in pairs(lists) do
if not list.found then
for _, arg in pairs(args_to_check) do
for _, pattern in ipairs(list.patterns) do
if mw.ustring.find(arg or '', pattern) then
list.found = true
break
end
end
if list.found then break end
end
end
end
end
local function fixChildBoxes(sval, tt)
local function notempty( s ) return s and s:match( '%S' ) end
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
-- start moving templatestyles and categories inside of table rows
local slast = ''
while slast ~= s do
slast = s
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')
end
-- end moving templatestyles and categories inside of table rows
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' ..
subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' ..
subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
-- the next two lines add a newline at the end of lists for the PHP parser
-- [[Special:Diff/849054481]]
-- remove when [[:phab:T191516]] is fixed or OBE
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
return s
else
return sval
end
end
-- Cleans empty tables
local function cleanInfobox()
root = tostring(root)
if has_rows == false then
root = mw.ustring.gsub(root, '<table[^<>]*>%s*</table>', '')
end
end
-- Returns the union of the values of two tables, as a sequence.
local function union(t1, t2)
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local function getArgNums(prefix)
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
local function addRow(rowArgs)
if rowArgs.header and rowArgs.header ~= '_BLANK_' then
has_rows = true
has_list_class({ rowArgs.rowclass, rowArgs.class, args.headerclass })
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:tag('th')
:attr('colspan', '2')
:addClass('infobox-header')
:addClass(rowArgs.class)
:addClass(args.headerclass)
-- @deprecated next; target .infobox-<name> .infobox-header
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
if rowArgs.data then
root:wikitext(
'[[Category:Pages using infobox templates with ignored data cells]]'
)
end
elseif rowArgs.data and rowArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ rowArgs.rowclass, rowArgs.class })
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:addClass('infobox-label')
-- @deprecated next; target .infobox-<name> .infobox-label
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
dataCell
:attr('colspan', not rowArgs.label and '2' or nil)
:addClass(not rowArgs.label and 'infobox-full-data' or 'infobox-data')
:addClass(rowArgs.class)
-- @deprecated next; target .infobox-<name> .infobox(-full)-data
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
else
table.insert(empty_row_categories, rowArgs.data or '')
end
end
local function renderTitle()
if not args.title then return end
has_rows = true
has_list_class({args.titleclass})
root
:tag('caption')
:addClass('infobox-title')
:addClass(args.titleclass)
-- @deprecated next; target .infobox-<name> .infobox-title
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
has_rows = true
has_list_class({ args.aboveclass })
root
:tag('tr')
:tag('th')
:attr('colspan', '2')
:addClass('infobox-above')
:addClass(args.aboveclass)
-- @deprecated next; target .infobox-<name> .infobox-above
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
has_rows = true
has_list_class({ args.belowclass })
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-below')
:addClass(args.belowclass)
-- @deprecated next; target .infobox-<name> .infobox-below
:cssText(args.belowstyle)
:wikitext(fixChildBoxes(args.below,'td'))
end
local function addSubheaderRow(subheaderArgs)
if subheaderArgs.data and
subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ subheaderArgs.rowclass, subheaderArgs.class })
local row = root:tag('tr')
row:addClass(subheaderArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-subheader')
:addClass(subheaderArgs.class)
:cssText(subheaderArgs.datastyle)
:cssText(subheaderArgs.rowcellstyle)
:wikitext(fixChildBoxes(subheaderArgs.data, 'td'))
else
table.insert(empty_row_categories, subheaderArgs.data or '')
end
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addSubheaderRow({
data = args['subheader' .. tostring(num)],
-- @deprecated next; target .infobox-<name> .infobox-subheader
datastyle = args.subheaderstyle,
rowcellstyle = args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function addImageRow(imageArgs)
if imageArgs.data and
imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ imageArgs.rowclass, imageArgs.class })
local row = root:tag('tr')
row:addClass(imageArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-image')
:addClass(imageArgs.class)
:cssText(imageArgs.datastyle)
:wikitext(fixChildBoxes(imageArgs.data, 'td'))
else
table.insert(empty_row_categories, imageArgs.data or '')
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:addClass('infobox-caption')
-- @deprecated next; target .infobox-<name> .infobox-caption
:cssText(args.captionstyle)
:wikitext(caption)
end
addImageRow({
data = tostring(data),
-- @deprecated next; target .infobox-<name> .infobox-image
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
-- When autoheaders are turned on, preprocesses the rows
local function preprocessRows()
if not args.autoheaders then return end
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
local lastheader
for k, num in ipairs(rownums) do
if args['header' .. tostring(num)] then
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
lastheader = num
elseif args['data' .. tostring(num)] and
args['data' .. tostring(num)]:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
local data = args['data' .. tostring(num)]
if data:gsub(category_in_empty_row_pattern, ''):match('%S') then
lastheader = nil
end
end
end
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
end
-- Gets the union of the header and data argument numbers,
-- and renders them all in order
local function renderRows()
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
-- @deprecated next; target .infobox-<name> rowclass
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
has_rows = true
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-navbar')
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(require('Module:Italic title')._main({}))
end
end
-- Categories in otherwise empty rows are collected in empty_row_categories.
-- This function adds them to the module output. It is not affected by
-- args.decat because this module should not prevent module-external categories
-- from rendering.
local function renderEmptyRowCategories()
for _, s in ipairs(empty_row_categories) do
root:wikitext(s)
end
end
-- Render tracking categories. args.decat == turns off tracking categories.
local function renderTrackingCategories()
if args.decat == 'yes' then return end
if args.child == 'yes' then
if args.title then
root:wikitext(
'[[Category:Pages using embedded infobox templates with the title parameter]]'
)
end
elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles using infobox templates with no data rows]]')
end
end
--[=[
Loads the templatestyles for the infobox.
TODO: FINISH loading base templatestyles here rather than in
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.
See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.
]=]
local function loadTemplateStyles()
local frame = mw.getCurrentFrame()
local hlist_templatestyles = ''
if lists.hlist_t.found then
hlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.hlist_t.styles }
}
end
local plainlist_templatestyles = ''
if lists.plainlist_t.found then
plainlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.plainlist_t.styles }
}
end
-- See function description
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
}
local templatestyles = ''
if args['templatestyles'] then
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] then
child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] then
grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
-- hlist -> plainlist -> base is best-effort to preserve old Common.css ordering.
-- this ordering is not a guarantee because the rows of interest invoking
-- each class may not be on a specific page
hlist_templatestyles,
plainlist_templatestyles,
base_templatestyles,
templatestyles,
child_templatestyles,
grandchild_templatestyles
})
end
-- common functions between the child and non child cases
local function structure_infobox_common()
renderSubheaders()
renderImages()
preprocessRows()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderEmptyRowCategories()
renderTrackingCategories()
cleanInfobox()
end
-- Specify the overall layout of the infobox, with special settings if the
-- infobox is used as a 'child' inside another infobox.
local function _infobox()
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass(args.subbox == 'yes' and 'infobox-subbox' or 'infobox')
:addClass(args.bodyclass)
-- @deprecated next; target .infobox-<name>
:cssText(args.bodystyle)
has_list_class({ args.bodyclass })
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
structure_infobox_common()
return loadTemplateStyles() .. root
end
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
local function preprocessSingleArg(argName)
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
-- Assign the parameters with the given prefixes to the args table, in order, in
-- batches of the step size specified. This is to prevent references etc. from
-- appearing in the wrong order. The prefixTable should be an array containing
-- tables, each of which has two possible fields, a "prefix" string and a
-- "depend" table. The function always parses parameters containing the "prefix"
-- string, but only parses parameters in the "depend" table if the prefix
-- parameter is present and non-blank.
local function preprocessArgs(prefixTable, step)
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or
(v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present
-- and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
-- Do another loop if any arguments are found, even blank ones.
moreArgumentsExist = true
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present
-- and not blank, or we are processing "prefix1" and "prefix" is
-- present and not blank, and if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so
-- that references etc. will display in the expected places. Parameters that
-- depend on another parameter are only processed if that parameter is present,
-- to avoid phantom references appearing in article reference lists.
local function parseDataParameters()
preprocessSingleArg('autoheaders')
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
-- different behaviour for italics if blank or absent
args['italic title'] = origArgs['italic title']
preprocessSingleArg('decat')
preprocessSingleArg('templatestyles')
preprocessSingleArg('child templatestyles')
preprocessSingleArg('grandchild templatestyles')
end
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
function p.infobox(frame)
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
parseDataParameters()
return _infobox()
end
-- For calling via #invoke within a template
function p.infoboxTemplate(frame)
origArgs = {}
for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
parseDataParameters()
return _infobox()
end
return p
0ddb7e5c8426d67cd589b710efb9912ddfb67fea
Template:Flatlist
10
120
248
2022-12-29T17:46:45Z
wikipedia>Izno
0
templatestyles obviates the need for hlist-separated
wikitext
text/x-wiki
<templatestyles src="Hlist/styles.css"/><div class="hlist {{{class|}}}" {{#if:{{{style|}}}{{{indent|}}}|style="{{#if:{{{indent|}}}|margin-left: {{#expr:{{{indent}}}*1.6}}em;}} {{{style|}}}"}}>{{#if:{{{1|}}}|
{{{1}}}
</div>}}<noinclude></div>
{{documentation}}
</noinclude>
cf60aa4aef920d48fa394e786f72fe5f6dcd3169
Module:List
828
20
42
2022-12-29T17:57:56Z
wikipedia>Izno
0
add templatestyles for hlist
Scribunto
text/plain
local libUtil = require('libraryUtil')
local checkType = libUtil.checkType
local mTableTools = require('Module:TableTools')
local p = {}
local listTypes = {
['bulleted'] = true,
['unbulleted'] = true,
['horizontal'] = true,
['ordered'] = true,
['horizontal_ordered'] = true
}
function p.makeListData(listType, args)
-- Constructs a data table to be passed to p.renderList.
local data = {}
-- Classes and TemplateStyles
data.classes = {}
data.templatestyles = ''
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(data.classes, 'hlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Hlist/styles.css' }
}
elseif listType == 'unbulleted' then
table.insert(data.classes, 'plainlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Plainlist/styles.css' }
}
end
table.insert(data.classes, args.class)
-- Main div style
data.style = args.style
-- Indent for horizontal lists
if listType == 'horizontal' or listType == 'horizontal_ordered' then
local indent = tonumber(args.indent)
indent = indent and indent * 1.6 or 0
if indent > 0 then
data.marginLeft = indent .. 'em'
end
end
-- List style types for ordered lists
-- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
-- type is either set by the "type" attribute or the "list-style-type" CSS
-- property.
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listStyleType = args.list_style_type or args['list-style-type']
data.type = args['type']
-- Detect invalid type attributes and attempt to convert them to
-- list-style-type CSS properties.
if data.type
and not data.listStyleType
and not tostring(data.type):find('^%s*[1AaIi]%s*$')
then
data.listStyleType = data.type
data.type = nil
end
end
-- List tag type
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listTag = 'ol'
else
data.listTag = 'ul'
end
-- Start number for ordered lists
data.start = args.start
if listType == 'horizontal_ordered' then
-- Apply fix to get start numbers working with horizontal ordered lists.
local startNum = tonumber(data.start)
if startNum then
data.counterReset = 'listitem ' .. tostring(startNum - 1)
end
end
-- List style
-- ul_style and ol_style are included for backwards compatibility. No
-- distinction is made for ordered or unordered lists.
data.listStyle = args.list_style
-- List items
-- li_style is included for backwards compatibility. item_style was included
-- to be easier to understand for non-coders.
data.itemStyle = args.item_style or args.li_style
data.items = {}
for _, num in ipairs(mTableTools.numKeys(args)) do
local item = {}
item.content = args[num]
item.style = args['item' .. tostring(num) .. '_style']
or args['item_style' .. tostring(num)]
item.value = args['item' .. tostring(num) .. '_value']
or args['item_value' .. tostring(num)]
table.insert(data.items, item)
end
return data
end
function p.renderList(data)
-- Renders the list HTML.
-- Return the blank string if there are no list items.
if type(data.items) ~= 'table' or #data.items < 1 then
return ''
end
-- Render the main div tag.
local root = mw.html.create('div')
for _, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{['margin-left'] = data.marginLeft}
if data.style then
root:cssText(data.style)
end
-- Render the list tag.
local list = root:tag(data.listTag or 'ul')
list
:attr{start = data.start, type = data.type}
:css{
['counter-reset'] = data.counterReset,
['list-style-type'] = data.listStyleType
}
if data.listStyle then
list:cssText(data.listStyle)
end
-- Render the list items
for _, t in ipairs(data.items or {}) do
local item = list:tag('li')
if data.itemStyle then
item:cssText(data.itemStyle)
end
if t.style then
item:cssText(t.style)
end
item
:attr{value = t.value}
:wikitext(t.content)
end
return data.templatestyles .. tostring(root)
end
function p.renderTrackingCategories(args)
local isDeprecated = false -- Tracks deprecated parameters.
for k, v in pairs(args) do
k = tostring(k)
if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
isDeprecated = true
break
end
end
local ret = ''
if isDeprecated then
ret = ret .. '[[Category:List templates with deprecated parameters]]'
end
return ret
end
function p.makeList(listType, args)
if not listType or not listTypes[listType] then
error(string.format(
"bad argument #1 to 'makeList' ('%s' is not a valid list type)",
tostring(listType)
), 2)
end
checkType('makeList', 2, args, 'table')
local data = p.makeListData(listType, args)
local list = p.renderList(data)
local trackingCategories = p.renderTrackingCategories(args)
return list .. trackingCategories
end
for listType in pairs(listTypes) do
p[listType] = function (frame)
local mArguments = require('Module:Arguments')
local origArgs = mArguments.getArgs(frame, {
valueFunc = function (key, value)
if not value or not mw.ustring.find(value, '%S') then return nil end
if mw.ustring.find(value, '^%s*[%*#;:]') then
return value
else
return value:match('^%s*(.-)%s*$')
end
return nil
end
})
-- Copy all the arguments to a new table, for faster indexing.
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.makeList(listType, args)
end
end
return p
7a4f36a6e9cd56370bdd8207d23694124821dc1a
Module:Detect singular
828
137
282
2023-01-02T22:05:13Z
wikipedia>Hike395
0
decode HTML entities
Scribunto
text/plain
local p = {}
local getArgs = require('Module:Arguments').getArgs
local yesNo = require('Module:Yesno')
local getPlain = require('Module:Text').Text().getPlain
-- function to determine whether "sub" occurs in "s"
local function plainFind(s, sub)
return mw.ustring.find(s, sub, 1, true)
end
-- function to count the number of times "pattern" (a regex) occurs in "s"
local function countMatches(s, pattern)
local _, count = mw.ustring.gsub(s, pattern, '')
return count
end
local singular = 1
local likelyPlural = 2
local plural = 3
-- Determine whether a string is singular or plural (i.e., it represents one
-- item or many)
-- Arguments:
-- origArgs[1]: string to process
-- origArgs.no_comma: if false, use commas to detect plural (default false)
-- origArgs.parse_links: if false, treat wikilinks as opaque singular objects (default false)
-- Returns:
-- singular, likelyPlural, or plural (see constants above), or nil for completely unknown
function p._main(origArgs)
origArgs = type(origArgs) == 'table' and origArgs or {}
local args = {}
-- canonicalize boolean arguments
for key, default in pairs({no_comma=false,parse_links=false,any_comma=false,no_and=false}) do
if origArgs[key] == nil then
args[key] = default
else
args[key] = yesNo(origArgs[key],default)
end
end
local checkComma = not args.no_comma
local checkAnd = not args.no_and
local rewriteLinks = not args.parse_links
local anyComma = args.any_comma
local s = origArgs[1] -- the input string
if not s then
return nil -- empty input returns nil
end
s = tostring(s)
s = mw.text.decode(s,true) --- replace HTML entities (to avoid spurious semicolons)
if plainFind(s,'data-plural="0"') then -- magic data string to return true
return singular
end
if plainFind(s,'data-plural="1"') then -- magic data string to return false
return plural
end
-- count number of list items
local numListItems = countMatches(s,'<%s*li')
-- if exactly one, then singular, if more than one, then plural
if numListItems == 1 then
return singular
end
if numListItems > 1 then
return plural
end
-- if "list of" occurs inside of wlink, then it's plural
if mw.ustring.find(s:lower(), '%[%[[^%]]*list of[^%]]+%]%]') then
return plural
end
-- fix for trailing br tags passed through [[template:marriage]]
s = mw.ustring.gsub(s, '<%s*br[^>]*>%s*(</div>)', '%1')
-- replace all wikilinks with fixed string
if rewriteLinks then
s = mw.ustring.gsub(s,'%b[]','WIKILINK')
end
-- Five conditions: any one of them can make the string a likely plural or plural
local hasBreak = mw.ustring.find(s,'<%s*br')
-- For the last 4, evaluate on string stripped of wikimarkup
s = getPlain(s)
local hasBullets = countMatches(s,'%*+') > 1
local multipleQids = mw.ustring.find(s,'Q%d+[%p%s]+Q%d+') -- has multiple QIDs in a row
if hasBullets or multipleQids then
return plural
end
local commaPattern = anyComma and '[,;]' or '%D[,;]%D' -- semi-colon similar to comma
local hasComma = checkComma and mw.ustring.find(s, commaPattern)
local hasAnd = checkAnd and mw.ustring.find(s,'[,%s]and%s')
if hasBreak or hasComma or hasAnd then
return likelyPlural
end
return singular
end
function p._pluralize(args)
args = type(args) == 'table' and args or {}
local singularForm = args[3] or args.singular or ""
local pluralForm = args[4] or args.plural or ""
local likelyForm = args.likely or pluralForm
local link = args[5] or args.link
if link then
link = tostring(link)
singularForm = '[['..link..'|'..singularForm..']]'
pluralForm = '[['..link..'|'..pluralForm..']]'
likelyForm = '[['..link..'|'..likelyForm..']]'
end
if args[2] then
return pluralForm
end
local detect = p._main(args)
if detect == nil then
return "" -- return blank on complete failure
end
if detect == singular then
return singularForm
elseif detect == likelyPlural then
return likelyForm
else
return pluralForm
end
end
function p.main(frame)
local args = getArgs(frame)
-- For template, return 1 if singular, blank if plural or empty
local result = p._main(args)
if result == nil then
return 1
end
return result == singular and 1 or ""
end
function p.pluralize(frame)
local args = getArgs(frame)
return p._pluralize(args)
end
return p
6afb2e8c0bd8ddff094e2861b836521ee4a5a779
Module:Citation/CS1/styles.css
828
118
244
2023-01-14T14:43:34Z
wikipedia>Trappist the monk
0
sync from sandbox;
sanitized-css
text/css
/* Protection icon
the following line controls the page-protection icon in the upper right corner
it must remain within this comment
{{sandbox other||{{pp-template}}}}
*/
/* Overrides
Some wikis do not override user agent default styles for HTML <cite> and <q>,
unlike en.wp. On en.wp, keep these the same as [[MediaWiki:Common.css]].
The word-wrap and :target styles were moved here from Common.css.
On en.wp, keep these the same as [[Template:Citation/styles.css]].
*/
cite.citation {
font-style: inherit; /* Remove italics for <cite> */
/* Break long urls, etc., rather than overflowing box */
word-wrap: break-word;
}
.citation q {
quotes: '"' '"' "'" "'"; /* Straight quote marks for <q> */
}
/* Highlight linked elements (such as clicked references) in blue */
.citation:target {
/* ignore the linter - all browsers of interest implement this */
background-color: rgba(0, 127, 255, 0.133);
}
/* ID and URL access
Both core and Common.css have selector .mw-parser-output a[href$=".pdf"].external
for PDF pages. All TemplateStyles pages are hoisted to .mw-parser-output. We need
to have specificity equal to a[href$=".pdf"].external for locks to override PDF icon.
That's essentially 2 classes and 1 element.
the .id-lock-... selectors are for use by non-citation templates like
{{Catalog lookup link}} which do not have to handle PDF links
*/
.id-lock-free a,
.citation .cs1-lock-free a {
background: url(//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg)
right 0.1em center/9px no-repeat;
}
.id-lock-limited a,
.id-lock-registration a,
.citation .cs1-lock-limited a,
.citation .cs1-lock-registration a {
background: url(//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg)
right 0.1em center/9px no-repeat;
}
.id-lock-subscription a,
.citation .cs1-lock-subscription a {
background: url(//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg)
right 0.1em center/9px no-repeat;
}
/* Wikisource
Wikisource icon when |chapter= or |title= is wikilinked to Wikisource
as in cite wikisource
*/
.cs1-ws-icon a {
background: url(//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg)
right 0.1em center/12px no-repeat;
}
/* Errors and maintenance */
.cs1-code {
/* <code>...</code> style override: mediawiki's css definition is specified here:
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/
69cd73811f7aadd093050dbf20ed70ef0b42a713/skins%2Fcommon%2FcommonElements.css#L199
*/
color: inherit;
background: inherit;
border: none;
padding: inherit;
}
.cs1-hidden-error {
display: none;
color: #d33;
}
.cs1-visible-error {
color: #d33;
}
.cs1-maint {
display: none;
color: #3a3;
margin-left: 0.3em;
}
/* Small text size
Set small text size in one place. 0.95 (here) * 0.9 (from references list) is
~0.85, which is the lower bound for size for accessibility. Old styling for this
was just 0.85. We could write the rule so that when this template is inside
references/reflist, only then does it multiply by 0.95; else multiply by 0.85 */
.cs1-format {
font-size: 95%;
}
/* kerning */
.cs1-kern-left {
padding-left: 0.2em;
}
.cs1-kern-right {
padding-right: 0.2em;
}
/* selflinks – avoid bold font style when cs1|2 template links to the current page */
.citation .mw-selflink {
font-weight: inherit;
}
7c96feb084b1883e7b6522660da6a14bdcc94752
Module:Citation/CS1/COinS
828
117
242
2023-01-14T14:43:36Z
wikipedia>Trappist the monk
0
sync from sandbox;
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local has_accept_as_written, is_set, in_array, remove_wiki_link, strip_apostrophe_markup; -- functions in Module:Citation/CS1/Utilities
local cfg; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
--[[--------------------------< M A K E _ C O I N S _ T I T L E >----------------------------------------------
Makes a title for COinS from Title and / or ScriptTitle (or any other name-script pairs)
Apostrophe markup (bold, italics) is stripped from each value so that the COinS metadata isn't corrupted with strings
of %27%27...
]]
local function make_coins_title (title, script)
title = has_accept_as_written (title);
if is_set (title) then
title = strip_apostrophe_markup (title); -- strip any apostrophe markup
else
title = ''; -- if not set, make sure title is an empty string
end
if is_set (script) then
script = script:gsub ('^%l%l%s*:%s*', ''); -- remove language prefix if present (script value may now be empty string)
script = strip_apostrophe_markup (script); -- strip any apostrophe markup
else
script = ''; -- if not set, make sure script is an empty string
end
if is_set (title) and is_set (script) then
script = ' ' .. script; -- add a space before we concatenate
end
return title .. script; -- return the concatenation
end
--[[--------------------------< E S C A P E _ L U A _ M A G I C _ C H A R S >----------------------------------
Returns a string where all of Lua's magic characters have been escaped. This is important because functions like
string.gsub() treat their pattern and replace strings as patterns, not literal strings.
]]
local function escape_lua_magic_chars (argument)
argument = argument:gsub("%%", "%%%%"); -- replace % with %%
argument = argument:gsub("([%^%$%(%)%.%[%]%*%+%-%?])", "%%%1"); -- replace all other Lua magic pattern characters
return argument;
end
--[[--------------------------< G E T _ C O I N S _ P A G E S >------------------------------------------------
Extract page numbers from external wikilinks in any of the |page=, |pages=, or |at= parameters for use in COinS.
]]
local function get_coins_pages (pages)
local pattern;
if not is_set (pages) then return pages; end -- if no page numbers then we're done
while true do
pattern = pages:match("%[(%w*:?//[^ ]+%s+)[%w%d].*%]"); -- pattern is the opening bracket, the URL and following space(s): "[url "
if nil == pattern then break; end -- no more URLs
pattern = escape_lua_magic_chars (pattern); -- pattern is not a literal string; escape Lua's magic pattern characters
pages = pages:gsub(pattern, ""); -- remove as many instances of pattern as possible
end
pages = pages:gsub("[%[%]]", ""); -- remove the brackets
pages = pages:gsub("–", "-" ); -- replace endashes with hyphens
pages = pages:gsub("&%w+;", "-" ); -- and replace HTML entities (– etc.) with hyphens; do we need to replace numerical entities like   and the like?
return pages;
end
--[=[-------------------------< C O I N S _ R E P L A C E _ M A T H _ S T R I P M A R K E R >------------------
There are three options for math markup rendering that depend on the editor's math preference settings. These
settings are at [[Special:Preferences#mw-prefsection-rendering]] and are
PNG images
TeX source
MathML with SVG or PNG fallback
All three are heavy with HTML and CSS which doesn't belong in the metadata.
Without this function, the metadata saved in the raw wikitext contained the rendering determined by the settings
of the last editor to save the page.
This function gets the rendered form of an equation according to the editor's preference before the page is saved. It
then searches the rendering for the text equivalent of the rendered equation and replaces the rendering with that so
that the page is saved without extraneous HTML/CSS markup and with a reasonably readable text form of the equation.
When a replacement is made, this function returns true and the value with replacement; otherwise false and the initial
value. To replace multipe equations it is necessary to call this function from within a loop.
]=]
local function coins_replace_math_stripmarker (value)
local stripmarker = cfg.stripmarkers['math'];
local rendering = value:match (stripmarker); -- is there a math stripmarker
if not rendering then -- when value doesn't have a math stripmarker, abandon this test
return false, value;
end
rendering = mw.text.unstripNoWiki (rendering); -- convert stripmarker into rendered value (or nil? ''? when math render error)
if rendering:match ('alt="[^"]+"') then -- if PNG math option
rendering = rendering:match ('alt="([^"]+)"'); -- extract just the math text
elseif rendering:match ('$%s+.+%s+%$') then -- if TeX math option; $ is legit character that is escapes as \$
rendering = rendering:match ('$%s+(.+)%s+%$') -- extract just the math text
elseif rendering:match ('<annotation[^>]+>.+</annotation>') then -- if MathML math option
rendering = rendering:match ('<annotation[^>]+>(.+)</annotation>') -- extract just the math text
else
return false, value; -- had math stripmarker but not one of the three defined forms
end
return true, value:gsub (stripmarker, rendering, 1);
end
--[[--------------------------< C O I N S _ C L E A N U P >----------------------------------------------------
Cleanup parameter values for the metadata by removing or replacing invisible characters and certain HTML entities.
2015-12-10: there is a bug in mw.text.unstripNoWiki (). It replaces math stripmarkers with the appropriate content
when it shouldn't. See https://phabricator.wikimedia.org/T121085 and Wikipedia_talk:Lua#stripmarkers_and_mw.text.unstripNoWiki.28.29
TODO: move the replacement patterns and replacement values into a table in /Configuration similar to the invisible
characters table?
]]
local function coins_cleanup (value)
local replaced = true; -- default state to get the do loop running
while replaced do -- loop until all math stripmarkers replaced
replaced, value = coins_replace_math_stripmarker (value); -- replace math stripmarker with text representation of the equation
end
value = value:gsub (cfg.stripmarkers['math'], "MATH RENDER ERROR"); -- one or more couldn't be replaced; insert vague error message
value = mw.text.unstripNoWiki (value); -- replace nowiki stripmarkers with their content
value = value:gsub ('<span class="nowrap" style="padding%-left:0%.1em;">'(s?)</span>', "'%1"); -- replace {{'}} or {{'s}} with simple apostrophe or apostrophe-s
value = value:gsub (' ', ' '); -- replace entity with plain space
value = value:gsub ('\226\128\138', ' '); -- replace hair space with plain space
if not mw.ustring.find (value, cfg.indic_script) then -- don't remove zero-width joiner characters from indic script
value = value:gsub ('‍', ''); -- remove ‍ entities
value = mw.ustring.gsub (value, '[\226\128\141\226\128\139\194\173]', ''); -- remove zero-width joiner, zero-width space, soft hyphen
end
value = value:gsub ('[\009\010\013 ]+', ' '); -- replace horizontal tab, line feed, carriage return with plain space
return value;
end
--[[--------------------------< C O I N S >--------------------------------------------------------------------
COinS metadata (see <http://ocoins.info/>) allows automated tools to parse the citation information.
]]
local function COinS(data, class)
if 'table' ~= type(data) or nil == next(data) then
return '';
end
for k, v in pairs (data) do -- spin through all of the metadata parameter values
if 'ID_list' ~= k and 'Authors' ~= k then -- except the ID_list and Author tables (author nowiki stripmarker done when Author table processed)
data[k] = coins_cleanup (v);
end
end
local ctx_ver = "Z39.88-2004";
-- treat table strictly as an array with only set values.
local OCinSoutput = setmetatable( {}, {
__newindex = function(self, key, value)
if is_set(value) then
rawset( self, #self+1, table.concat{ key, '=', mw.uri.encode( remove_wiki_link( value ) ) } );
end
end
});
if in_array (class, {'arxiv', 'biorxiv', 'citeseerx', 'ssrn', 'journal', 'news', 'magazine'}) or
(in_array (class, {'conference', 'interview', 'map', 'press release', 'web'}) and is_set(data.Periodical)) or
('citation' == class and is_set(data.Periodical) and not is_set (data.Encyclopedia)) then
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:journal"; -- journal metadata identifier
if in_array (class, {'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) then -- set genre according to the type of citation template we are rendering
OCinSoutput["rft.genre"] = "preprint"; -- cite arxiv, cite biorxiv, cite citeseerx, cite ssrn
elseif 'conference' == class then
OCinSoutput["rft.genre"] = "conference"; -- cite conference (when Periodical set)
elseif 'web' == class then
OCinSoutput["rft.genre"] = "unknown"; -- cite web (when Periodical set)
else
OCinSoutput["rft.genre"] = "article"; -- journal and other 'periodical' articles
end
OCinSoutput["rft.jtitle"] = data.Periodical; -- journal only
OCinSoutput["rft.atitle"] = data.Title; -- 'periodical' article titles
-- these used only for periodicals
OCinSoutput["rft.ssn"] = data.Season; -- keywords: winter, spring, summer, fall
OCinSoutput["rft.quarter"] = data.Quarter; -- single digits 1->first quarter, etc.
OCinSoutput["rft.chron"] = data.Chron; -- free-form date components
OCinSoutput["rft.volume"] = data.Volume; -- does not apply to books
OCinSoutput["rft.issue"] = data.Issue;
OCinSoutput['rft.artnum'] = data.ArticleNumber; -- {{cite journal}} only
OCinSoutput["rft.pages"] = data.Pages; -- also used in book metadata
elseif 'thesis' ~= class then -- all others except cite thesis are treated as 'book' metadata; genre distinguishes
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:book"; -- book metadata identifier
if 'report' == class or 'techreport' == class then -- cite report and cite techreport
OCinSoutput["rft.genre"] = "report";
elseif 'conference' == class then -- cite conference when Periodical not set
OCinSoutput["rft.genre"] = "conference";
OCinSoutput["rft.atitle"] = data.Chapter; -- conference paper as chapter in proceedings (book)
elseif in_array (class, {'book', 'citation', 'encyclopaedia', 'interview', 'map'}) then
if is_set (data.Chapter) then
OCinSoutput["rft.genre"] = "bookitem";
OCinSoutput["rft.atitle"] = data.Chapter; -- book chapter, encyclopedia article, interview in a book, or map title
else
if 'map' == class or 'interview' == class then
OCinSoutput["rft.genre"] = 'unknown'; -- standalone map or interview
else
OCinSoutput["rft.genre"] = 'book'; -- book and encyclopedia
end
end
else -- {'audio-visual', 'AV-media-notes', 'DVD-notes', 'episode', 'interview', 'mailinglist', 'map', 'newsgroup', 'podcast', 'press release', 'serial', 'sign', 'speech', 'web'}
OCinSoutput["rft.genre"] = "unknown";
end
OCinSoutput["rft.btitle"] = data.Title; -- book only
OCinSoutput["rft.place"] = data.PublicationPlace; -- book only
OCinSoutput["rft.series"] = data.Series; -- book only
OCinSoutput["rft.pages"] = data.Pages; -- book, journal
OCinSoutput["rft.edition"] = data.Edition; -- book only
OCinSoutput["rft.pub"] = data.PublisherName; -- book and dissertation
else -- cite thesis
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:dissertation"; -- dissertation metadata identifier
OCinSoutput["rft.title"] = data.Title; -- dissertation (also patent but that is not yet supported)
OCinSoutput["rft.degree"] = data.Degree; -- dissertation only
OCinSoutput['rft.inst'] = data.PublisherName; -- book and dissertation
end
-- NB. Not currently supported are "info:ofi/fmt:kev:mtx:patent", "info:ofi/fmt:kev:mtx:dc", "info:ofi/fmt:kev:mtx:sch_svc", "info:ofi/fmt:kev:mtx:ctx"
-- and now common parameters (as much as possible)
OCinSoutput["rft.date"] = data.Date; -- book, journal, dissertation
for k, v in pairs( data.ID_list ) do -- what to do about these? For now assume that they are common to all?
if k == 'ISBN' then v = v:gsub( "[^-0-9X]", "" ); end
local id = cfg.id_handlers[k].COinS;
if string.sub( id or "", 1, 4 ) == 'info' then -- for ids that are in the info:registry
OCinSoutput["rft_id"] = table.concat{ id, "/", v };
elseif string.sub (id or "", 1, 3 ) == 'rft' then -- for isbn, issn, eissn, etc. that have defined COinS keywords
OCinSoutput[ id ] = v;
elseif 'url' == id then -- for urls that are assembled in ~/Identifiers; |asin= and |ol=
OCinSoutput["rft_id"] = table.concat ({data.ID_list[k], "#id-name=", cfg.id_handlers[k].label});
elseif id then -- when cfg.id_handlers[k].COinS is not nil so urls created here
OCinSoutput["rft_id"] = table.concat{ cfg.id_handlers[k].prefix, v, cfg.id_handlers[k].suffix or '', "#id-name=", cfg.id_handlers[k].label }; -- others; provide a URL and indicate identifier name as #fragment (human-readable, but transparent to browsers)
end
end
local last, first;
for k, v in ipairs( data.Authors ) do
last, first = coins_cleanup (v.last), coins_cleanup (v.first or ''); -- replace any nowiki stripmarkers, non-printing or invisible characters
if k == 1 then -- for the first author name only
if is_set(last) and is_set(first) then -- set these COinS values if |first= and |last= specify the first author name
OCinSoutput["rft.aulast"] = last; -- book, journal, dissertation
OCinSoutput["rft.aufirst"] = first; -- book, journal, dissertation
elseif is_set(last) then
OCinSoutput["rft.au"] = last; -- book, journal, dissertation -- otherwise use this form for the first name
end
else -- for all other authors
if is_set(last) and is_set(first) then
OCinSoutput["rft.au"] = table.concat{ last, ", ", first }; -- book, journal, dissertation
elseif is_set(last) then
OCinSoutput["rft.au"] = last; -- book, journal, dissertation
end
-- TODO: At present we do not report "et al.". Add anything special if this condition applies?
end
end
OCinSoutput.rft_id = data.URL;
OCinSoutput.rfr_id = table.concat{ "info:sid/", mw.site.server:match( "[^/]*$" ), ":", data.RawPage };
-- TODO: Add optional extra info:
-- rfr_dat=#REVISION<version> (referrer private data)
-- ctx_id=<data.RawPage>#<ref> (identifier for the context object)
-- ctx_tim=<ts> (timestamp in format yyyy-mm-ddThh:mm:ssTZD or yyyy-mm-dd)
-- ctx_enc=info:ofi/enc:UTF-8 (character encoding)
OCinSoutput = setmetatable( OCinSoutput, nil );
-- sort with version string always first, and combine.
-- table.sort( OCinSoutput );
table.insert( OCinSoutput, 1, "ctx_ver=" .. ctx_ver ); -- such as "Z39.88-2004"
return table.concat(OCinSoutput, "&");
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table and imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
cfg = cfg_table_ptr;
has_accept_as_written = utilities_page_ptr.has_accept_as_written; -- import functions from selected Module:Citation/CS1/Utilities module
is_set = utilities_page_ptr.is_set;
in_array = utilities_page_ptr.in_array;
remove_wiki_link = utilities_page_ptr.remove_wiki_link;
strip_apostrophe_markup = utilities_page_ptr.strip_apostrophe_markup;
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
make_coins_title = make_coins_title,
get_coins_pages = get_coins_pages,
COinS = COinS,
set_selected_modules = set_selected_modules,
}
55b7d6a7605b5e672604b0210feeb5286b799f8e
Module:Citation/CS1/Identifiers
828
116
240
2023-01-14T14:43:38Z
wikipedia>Trappist the monk
0
sync from sandbox;
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local has_accept_as_written, is_set, in_array, set_message, select_one, -- functions in Module:Citation/CS1/Utilities
substitute, make_wikilink;
local z; -- table of tables defined in Module:Citation/CS1/Utilities
local cfg; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
--[[--------------------------< P A G E S C O P E V A R I A B L E S >--------------------------------------
declare variables here that have page-wide scope that are not brought in from other modules; that are created here and used here
]]
local auto_link_urls = {}; -- holds identifier URLs for those identifiers that can auto-link |title=
--============================<< H E L P E R F U N C T I O N S >>============================================
--[[--------------------------< W I K I D A T A _ A R T I C L E _ N A M E _ G E T >----------------------------
as an aid to internationalizing identifier-label wikilinks, gets identifier article names from Wikidata.
returns :<lang code>:<article title> when <q> has an <article title> for <lang code>; nil else
for identifiers that do not have q, returns nil
for wikis that do not have mw.wikibase installed, returns nil
]]
local function wikidata_article_name_get (q)
if not is_set (q) or (q and not mw.wikibase) then -- when no q number or when a q number but mw.wikibase not installed on this wiki
return nil; -- abandon
end
local wd_article;
local this_wiki_code = cfg.this_wiki_code; -- Wikipedia subdomain; 'en' for en.wikipedia.org
wd_article = mw.wikibase.getSitelink (q, this_wiki_code .. 'wiki'); -- fetch article title from WD; nil when no title available at this wiki
if wd_article then
wd_article = table.concat ({':', this_wiki_code, ':', wd_article}); -- interwiki-style link without brackets if taken from WD; leading colon required
end
return wd_article; -- article title from WD; nil else
end
--[[--------------------------< L I N K _ L A B E L _ M A K E >------------------------------------------------
common function to create identifier link label from handler table or from Wikidata
returns the first available of
1. redirect from local wiki's handler table (if enabled)
2. Wikidata (if there is a Wikidata entry for this identifier in the local wiki's language)
3. label specified in the local wiki's handler table
]]
local function link_label_make (handler)
local wd_article;
if not (cfg.use_identifier_redirects and is_set (handler.redirect)) then -- redirect has priority so if enabled and available don't fetch from Wikidata because expensive
wd_article = wikidata_article_name_get (handler.q); -- if Wikidata has an article title for this wiki, get it;
end
return (cfg.use_identifier_redirects and is_set (handler.redirect) and handler.redirect) or wd_article or handler.link;
end
--[[--------------------------< E X T E R N A L _ L I N K _ I D >----------------------------------------------
Formats a wiki-style external link
]]
local function external_link_id (options)
local url_string = options.id;
local ext_link;
local this_wiki_code = cfg.this_wiki_code; -- Wikipedia subdomain; 'en' for en.wikipedia.org
local wd_article; -- article title from Wikidata
if options.encode == true or options.encode == nil then
url_string = mw.uri.encode (url_string, 'PATH');
end
if options.auto_link and is_set (options.access) then
auto_link_urls[options.auto_link] = table.concat ({options.prefix, url_string, options.suffix});
end
ext_link = mw.ustring.format ('[%s%s%s %s]', options.prefix, url_string, options.suffix or "", mw.text.nowiki (options.id));
if is_set (options.access) then
ext_link = substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[options.access].class, cfg.presentation[options.access].title, ext_link}); -- add the free-to-read / paywall lock
end
return table.concat ({
make_wikilink (link_label_make (options), options.label), -- redirect, Wikidata link, or locally specified link (in that order)
options.separator or ' ',
ext_link
});
end
--[[--------------------------< I N T E R N A L _ L I N K _ I D >----------------------------------------------
Formats a wiki-style internal link
TODO: Does not currently need to support options.access, options.encode, auto-linking and COinS (as in external_link_id),
but may be needed in the future for :m:Interwiki_map custom-prefixes like :arxiv:, :bibcode:, :DOI:, :hdl:, :ISSN:,
:JSTOR:, :Openlibrary:, :PMID:, :RFC:.
]]
local function internal_link_id (options)
local id = mw.ustring.gsub (options.id, '%d', cfg.date_names.local_digits); -- translate 'local' digits to Western 0-9
return table.concat (
{
make_wikilink (link_label_make (options), options.label), -- wiki-link the identifier label
options.separator or ' ', -- add the separator
make_wikilink (
table.concat (
{
options.prefix,
id, -- translated to Western digits
options.suffix or ''
}),
substitute (cfg.presentation['bdi'], {'', mw.text.nowiki (options.id)}) -- bdi tags to prevent Latin script identifiers from being reversed at RTL language wikis
); -- nowiki because MediaWiki still has magic links for ISBN and the like; TODO: is it really required?
});
end
--[[--------------------------< I S _ E M B A R G O E D >------------------------------------------------------
Determines if a PMC identifier's online version is embargoed. Compares the date in |pmc-embargo-date= against
today's date. If embargo date is in the future, returns the content of |pmc-embargo-date=; otherwise, returns
an empty string because the embargo has expired or because |pmc-embargo-date= was not set in this cite.
]]
local function is_embargoed (embargo)
if is_set (embargo) then
local lang = mw.getContentLanguage();
local good1, embargo_date, todays_date;
good1, embargo_date = pcall (lang.formatDate, lang, 'U', embargo);
todays_date = lang:formatDate ('U');
if good1 then -- if embargo date is a good date
if tonumber (embargo_date) >= tonumber (todays_date) then -- is embargo date is in the future?
return embargo; -- still embargoed
else
set_message ('maint_pmc_embargo'); -- embargo has expired; add main cat
return ''; -- unset because embargo has expired
end
end
end
return ''; -- |pmc-embargo-date= not set return empty string
end
--[=[-------------------------< I S _ V A L I D _ B I O R X I V _ D A T E >------------------------------------
returns true if:
2019-12-11T00:00Z <= biorxiv_date < today + 2 days
The dated form of biorxiv identifier has a start date of 2019-12-11. The Unix timestamp for that date is {{#time:U|2019-12-11}} = 1576022400
biorxiv_date is the date provided in those |biorxiv= parameter values that are dated at time 00:00:00 UTC
today is the current date at time 00:00:00 UTC plus 48 hours
if today is 2015-01-01T00:00:00 then
adding 24 hours gives 2015-01-02T00:00:00 – one second more than today
adding 24 hours gives 2015-01-03T00:00:00 – one second more than tomorrow
This function does not work if it is fed month names for languages other than English. Wikimedia #time: parser
apparently doesn't understand non-English date month names. This function will always return false when the date
contains a non-English month name because good1 is false after the call to lang_object.formatDate(). To get
around that call this function with date parts and create a YYYY-MM-DD format date.
]=]
local function is_valid_biorxiv_date (y, m, d)
local biorxiv_date = table.concat ({y, m, d}, '-'); -- make ymd date
local good1, good2;
local biorxiv_ts, tomorrow_ts; -- to hold Unix timestamps representing the dates
local lang_object = mw.getContentLanguage();
good1, biorxiv_ts = pcall (lang_object.formatDate, lang_object, 'U', biorxiv_date); -- convert biorxiv_date value to Unix timestamp
good2, tomorrow_ts = pcall (lang_object.formatDate, lang_object, 'U', 'today + 2 days' ); -- today midnight + 2 days is one second more than all day tomorrow
if good1 and good2 then -- lang.formatDate() returns a timestamp in the local script which tonumber() may not understand
biorxiv_ts = tonumber (biorxiv_ts) or lang_object:parseFormattedNumber (biorxiv_ts); -- convert to numbers for the comparison;
tomorrow_ts = tonumber (tomorrow_ts) or lang_object:parseFormattedNumber (tomorrow_ts);
else
return false; -- one or both failed to convert to Unix timestamp
end
return ((1576022400 <= biorxiv_ts) and (biorxiv_ts < tomorrow_ts)) -- 2012-12-11T00:00Z <= biorxiv_date < tomorrow's date
end
--[[--------------------------< IS _ V A L I D _ I S X N >-----------------------------------------------------
ISBN-10 and ISSN validator code calculates checksum across all ISBN/ISSN digits including the check digit.
ISBN-13 is checked in isbn().
If the number is valid the result will be 0. Before calling this function, ISBN/ISSN must be checked for length
and stripped of dashes, spaces and other non-ISxN characters.
]]
local function is_valid_isxn (isxn_str, len)
local temp = 0;
isxn_str = { isxn_str:byte(1, len) }; -- make a table of byte values '0' → 0x30 .. '9' → 0x39, 'X' → 0x58
len = len + 1; -- adjust to be a loop counter
for i, v in ipairs (isxn_str) do -- loop through all of the bytes and calculate the checksum
if v == string.byte ("X" ) then -- if checkdigit is X (compares the byte value of 'X' which is 0x58)
temp = temp + 10 * (len - i); -- it represents 10 decimal
else
temp = temp + tonumber (string.char (v) )*(len-i);
end
end
return temp % 11 == 0; -- returns true if calculation result is zero
end
--[[--------------------------< IS _ V A L I D _ I S X N _ 1 3 >-----------------------------------------------
ISBN-13 and ISMN validator code calculates checksum across all 13 ISBN/ISMN digits including the check digit.
If the number is valid, the result will be 0. Before calling this function, ISBN-13/ISMN must be checked for length
and stripped of dashes, spaces and other non-ISxN-13 characters.
]]
local function is_valid_isxn_13 (isxn_str)
local temp=0;
isxn_str = { isxn_str:byte(1, 13) }; -- make a table of byte values '0' → 0x30 .. '9' → 0x39
for i, v in ipairs (isxn_str) do
temp = temp + (3 - 2*(i % 2)) * tonumber (string.char (v) ); -- multiply odd index digits by 1, even index digits by 3 and sum; includes check digit
end
return temp % 10 == 0; -- sum modulo 10 is zero when ISBN-13/ISMN is correct
end
--[[--------------------------< N O R M A L I Z E _ L C C N >--------------------------------------------------
LCCN normalization (https://www.loc.gov/marc/lccn-namespace.html#normalization)
1. Remove all blanks.
2. If there is a forward slash (/) in the string, remove it, and remove all characters to the right of the forward slash.
3. If there is a hyphen in the string:
a. Remove it.
b. Inspect the substring following (to the right of) the (removed) hyphen. Then (and assuming that steps 1 and 2 have been carried out):
1. All these characters should be digits, and there should be six or less. (not done in this function)
2. If the length of the substring is less than 6, left-fill the substring with zeroes until the length is six.
Returns a normalized LCCN for lccn() to validate. There is no error checking (step 3.b.1) performed in this function.
]]
local function normalize_lccn (lccn)
lccn = lccn:gsub ("%s", ""); -- 1. strip whitespace
if nil ~= string.find (lccn, '/') then
lccn = lccn:match ("(.-)/"); -- 2. remove forward slash and all character to the right of it
end
local prefix
local suffix
prefix, suffix = lccn:match ("(.+)%-(.+)"); -- 3.a remove hyphen by splitting the string into prefix and suffix
if nil ~= suffix then -- if there was a hyphen
suffix = string.rep("0", 6-string.len (suffix)) .. suffix; -- 3.b.2 left fill the suffix with 0s if suffix length less than 6
lccn = prefix..suffix; -- reassemble the LCCN
end
return lccn;
end
--============================<< I D E N T I F I E R F U N C T I O N S >>====================================
--[[--------------------------< A R X I V >--------------------------------------------------------------------
See: https://arxiv.org/help/arxiv_identifier
format and error check arXiv identifier. There are three valid forms of the identifier:
the first form, valid only between date codes 9107 and 0703, is:
arXiv:<archive>.<class>/<date code><number><version>
where:
<archive> is a string of alpha characters - may be hyphenated; no other punctuation
<class> is a string of alpha characters - may be hyphenated; no other punctuation; not the same as |class= parameter which is not supported in this form
<date code> is four digits in the form YYMM where YY is the last two digits of the four-digit year and MM is the month number January = 01
first digit of YY for this form can only 9 and 0
<number> is a three-digit number
<version> is a 1 or more digit number preceded with a lowercase v; no spaces (undocumented)
the second form, valid from April 2007 through December 2014 is:
arXiv:<date code>.<number><version>
where:
<date code> is four digits in the form YYMM where YY is the last two digits of the four-digit year and MM is the month number January = 01
<number> is a four-digit number
<version> is a 1 or more digit number preceded with a lowercase v; no spaces
the third form, valid from January 2015 is:
arXiv:<date code>.<number><version>
where:
<date code> and <version> are as defined for 0704-1412
<number> is a five-digit number
]]
local function arxiv (options)
local id = options.id;
local class = options.Class; -- TODO: lowercase?
local handler = options.handler;
local year, month, version;
local err_msg = false; -- assume no error message
local text; -- output text
if id:match("^%a[%a%.%-]+/[90]%d[01]%d%d%d%d$") or id:match("^%a[%a%.%-]+/[90]%d[01]%d%d%d%dv%d+$") then -- test for the 9107-0703 format with or without version
year, month = id:match("^%a[%a%.%-]+/([90]%d)([01]%d)%d%d%d[v%d]*$");
year = tonumber (year);
month = tonumber (month);
if ((not (90 < year or 8 > year)) or (1 > month or 12 < month)) or -- if invalid year or invalid month
((91 == year and 7 > month) or (7 == year and 3 < month)) then -- if years ok, are starting and ending months ok?
err_msg = true; -- flag for error message
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%dv%d+$") then -- test for the 0704-1412 with or without version
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d[v%d]*$");
year = tonumber (year);
month = tonumber (month);
if ((7 > year) or (14 < year) or (1 > month or 12 < month)) or -- is year invalid or is month invalid? (doesn't test for future years)
((7 == year) and (4 > month)) then -- when year is 07, is month invalid (before April)?
err_msg = true; -- flag for error message
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%d%dv%d+$") then -- test for the 1501- format with or without version
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d%d[v%d]*$");
year = tonumber (year);
month = tonumber (month);
if ((15 > year) or (1 > month or 12 < month)) then -- is year invalid or is month invalid? (doesn't test for future years)
err_msg = true; -- flag for error message
end
else
err_msg = true; -- not a recognized format; flag for error message
end
if err_msg then
options.coins_list_t['ARXIV'] = nil; -- when error, unset so not included in COinS
end
local err_msg_t = {};
if err_msg then
set_message ('err_bad_arxiv');
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = handler.access});
if is_set (class) then
if id:match ('^%d+') then
text = table.concat ({text, ' [[//arxiv.org/archive/', class, ' ', class, ']]'}); -- external link within square brackets, not wikilink
else
set_message ('err_class_ignored');
end
end
return text;
end
--[[--------------------------< B I B C O D E >--------------------------------------------------------------------
Validates (sort of) and formats a bibcode ID.
Format for bibcodes is specified here: https://adsabs.harvard.edu/abs_doc/help_pages/data.html#bibcodes
But, this: 2015arXiv151206696F is apparently valid so apparently, the only things that really matter are length, 19 characters
and first four digits must be a year. This function makes these tests:
length must be 19 characters
characters in position
1–4 must be digits and must represent a year in the range of 1000 – next year
5 must be a letter
6–8 must be letter, digit, ampersand, or dot (ampersand cannot directly precede a dot; &. )
9–18 must be letter, digit, or dot
19 must be a letter or dot
]]
local function bibcode (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local err_type;
local err_msg = '';
local year;
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode,
access = access});
if 19 ~= id:len() then
err_type = cfg.err_msg_supl.length;
else
year = id:match ("^(%d%d%d%d)[%a][%w&%.][%w&%.][%w&%.][%w.]+[%a%.]$");
if not year then -- if nil then no pattern match
err_type = cfg.err_msg_supl.value; -- so value error
else
local next_year = tonumber (os.date ('%Y')) + 1; -- get the current year as a number and add one for next year
year = tonumber (year); -- convert year portion of bibcode to a number
if (1000 > year) or (year > next_year) then
err_type = cfg.err_msg_supl.year; -- year out of bounds
end
if id:find('&%.') then
err_type = cfg.err_msg_supl.journal; -- journal abbreviation must not have '&.' (if it does it's missing a letter)
end
end
end
if is_set (err_type) then -- if there was an error detected
set_message ('err_bad_bibcode', {err_type});
options.coins_list_t['BIBCODE'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< B I O R X I V >-----------------------------------------------------------------
Format bioRxiv ID and do simple error checking. Before 2019-12-11, biorXiv IDs were 10.1101/ followed by exactly
6 digits. After 2019-12-11, biorXiv IDs retained the six-digit identifier but prefixed that with a yyyy.mm.dd.
date and suffixed with an optional version identifier.
The bioRxiv ID is the string of characters:
https://doi.org/10.1101/078733 -> 10.1101/078733
or a date followed by a six-digit number followed by an optional version indicator 'v' and one or more digits:
https://www.biorxiv.org/content/10.1101/2019.12.11.123456v2 -> 10.1101/2019.12.11.123456v2
see https://www.biorxiv.org/about-biorxiv
]]
local function biorxiv (options)
local id = options.id;
local handler = options.handler;
local err_msg = true; -- flag; assume that there will be an error
local patterns = {
'^10.1101/%d%d%d%d%d%d$', -- simple 6-digit identifier (before 2019-12-11)
'^10.1101/(20[1-9]%d)%.([01]%d)%.([0-3]%d)%.%d%d%d%d%d%dv%d+$', -- y.m.d. date + 6-digit identifier + version (after 2019-12-11)
'^10.1101/(20[1-9]%d)%.([01]%d)%.([0-3]%d)%.%d%d%d%d%d%d$', -- y.m.d. date + 6-digit identifier (after 2019-12-11)
}
for _, pattern in ipairs (patterns) do -- spin through the patterns looking for a match
if id:match (pattern) then
local y, m, d = id:match (pattern); -- found a match, attempt to get year, month and date from the identifier
if m then -- m is nil when id is the six-digit form
if not is_valid_biorxiv_date (y, m, d) then -- validate the encoded date; TODO: don't ignore leap-year and actual month lengths ({{#time:}} is a poor date validator)
break; -- date fail; break out early so we don't unset the error message
end
end
err_msg = nil; -- we found a match so unset the error message
break; -- and done
end
end -- err_cat remains set here when no match
if err_msg then
options.coins_list_t['BIORXIV'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_biorxiv'); -- and set the error message
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator,
encode = handler.encode, access = handler.access});
end
--[[--------------------------< C I T E S E E R X >------------------------------------------------------------
CiteSeerX use their own notion of "doi" (not to be confused with the identifiers resolved via doi.org).
The description of the structure of this identifier can be found at Help_talk:Citation_Style_1/Archive_26#CiteSeerX_id_structure
]]
local function citeseerx (options)
local id = options.id;
local handler = options.handler;
local matched;
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode,
access = handler.access});
matched = id:match ("^10%.1%.1%.[1-9]%d?%d?%d?%.[1-9]%d?%d?%d?$");
if not matched then
set_message ('err_bad_citeseerx' );
options.coins_list_t['CITESEERX'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< D O I >------------------------------------------------------------------------
Formats a DOI and checks for DOI errors.
DOI names contain two parts: prefix and suffix separated by a forward slash.
Prefix: directory indicator '10.' followed by a registrant code
Suffix: character string of any length chosen by the registrant
This function checks a DOI name for: prefix/suffix. If the DOI name contains spaces or endashes, or, if it ends
with a period or a comma, this function will emit a bad_doi error message.
DOI names are case-insensitive and can incorporate any printable Unicode characters so the test for spaces, endash,
and terminal punctuation may not be technically correct but it appears, that in practice these characters are rarely
if ever used in DOI names.
https://www.doi.org/doi_handbook/2_Numbering.html -- 2.2 Syntax of a DOI name
https://www.doi.org/doi_handbook/2_Numbering.html#2.2.2 -- 2.2.2 DOI prefix
]]
local function doi (options)
local id = options.id;
local inactive = options.DoiBroken
local access = options.access;
local ignore_invalid = options.accept;
local handler = options.handler;
local err_flag;
local text;
if is_set (inactive) then
local inactive_year = inactive:match("%d%d%d%d") or ''; -- try to get the year portion from the inactive date
local inactive_month, good;
if is_set (inactive_year) then
if 4 < inactive:len() then -- inactive date has more than just a year (could be anything)
local lang_obj = mw.getContentLanguage(); -- get a language object for this wiki
good, inactive_month = pcall (lang_obj.formatDate, lang_obj, 'F', inactive); -- try to get the month name from the inactive date
if not good then
inactive_month = nil; -- something went wrong so make sure this is unset
end
end
else
inactive_year = nil; -- |doi-broken-date= has something but it isn't a date
end
if is_set (inactive_year) and is_set (inactive_month) then
set_message ('maint_doi_inactive_dated', {inactive_year, inactive_month, ' '});
elseif is_set (inactive_year) then
set_message ('maint_doi_inactive_dated', {inactive_year, '', ''});
else
set_message ('maint_doi_inactive');
end
inactive = " (" .. cfg.messages['inactive'] .. ' ' .. inactive .. ')';
end
local registrant = mw.ustring.match (id, '^10%.([^/]+)/[^%s–]-[^%.,]$'); -- registrant set when DOI has the proper basic form
local registrant_err_patterns = { -- these patterns are for code ranges that are not supported
'^[^1-3]%d%d%d%d%.%d%d*$', -- 5 digits with subcode (0xxxx, 40000+); accepts: 10000–39999
'^[^1-5]%d%d%d%d$', -- 5 digits without subcode (0xxxx, 60000+); accepts: 10000–59999
'^[^1-9]%d%d%d%.%d%d*$', -- 4 digits with subcode (0xxx); accepts: 1000–9999
'^[^1-9]%d%d%d$', -- 4 digits without subcode (0xxx); accepts: 1000–9999
'^%d%d%d%d%d%d+', -- 6 or more digits
'^%d%d?%d?$', -- less than 4 digits without subcode (3 digits with subcode is legitimate)
'^%d%d?%.[%d%.]+', -- 1 or 2 digits with subcode
'^5555$', -- test registrant will never resolve
'[^%d%.]', -- any character that isn't a digit or a dot
}
if not ignore_invalid then
if registrant then -- when DOI has proper form
for i, pattern in ipairs (registrant_err_patterns) do -- spin through error patterns
if registrant:match (pattern) then -- to validate registrant codes
err_flag = set_message ('err_bad_doi'); -- when found, mark this DOI as bad
break; -- and done
end
end
else
err_flag = set_message ('err_bad_doi'); -- invalid directory or malformed
end
else
set_message ('maint_doi_ignore');
end
if err_flag then
options.coins_list_t['DOI'] = nil; -- when error, unset so not included in COinS
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access,
auto_link = not (err_flag or is_set (inactive) or ignore_invalid) and 'doi' or nil -- do not auto-link when |doi-broken-date= has a value or when there is a DOI error or (to play it safe, after all, auto-linking is not essential) when invalid DOIs are ignored
}) .. (inactive or '');
return text;
end
--[[--------------------------< H D L >------------------------------------------------------------------------
Formats an HDL with minor error checking.
HDL names contain two parts: prefix and suffix separated by a forward slash.
Prefix: character string using any character in the UCS-2 character set except '/'
Suffix: character string of any length using any character in the UCS-2 character set chosen by the registrant
This function checks a HDL name for: prefix/suffix. If the HDL name contains spaces, endashes, or, if it ends
with a period or a comma, this function will emit a bad_hdl error message.
HDL names are case-insensitive and can incorporate any printable Unicode characters so the test for endashes and
terminal punctuation may not be technically correct but it appears, that in practice these characters are rarely
if ever used in HDLs.
Query string parameters are named here: https://www.handle.net/proxy_servlet.html. query strings are not displayed
but since '?' is an allowed character in an HDL, '?' followed by one of the query parameters is the only way we
have to detect the query string so that it isn't URL-encoded with the rest of the identifier.
]]
local function hdl (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local query_params = { -- list of known query parameters from https://www.handle.net/proxy_servlet.html
'noredirect',
'ignore_aliases',
'auth',
'cert',
'index',
'type',
'urlappend',
'locatt',
'action',
}
local hdl, suffix, param = id:match ('(.-)(%?(%a+).+)$'); -- look for query string
local found;
if hdl then -- when there are query strings, this is the handle identifier portion
for _, q in ipairs (query_params) do -- spin through the list of query parameters
if param:match ('^' .. q) then -- if the query string begins with one of the parameters
found = true; -- announce a find
break; -- and stop looking
end
end
end
if found then
id = hdl; -- found so replace id with the handle portion; this will be URL-encoded, suffix will not
else
suffix = ''; -- make sure suffix is empty string for concatenation else
end
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, suffix = suffix, separator = handler.separator, encode = handler.encode, access = access})
if nil == id:match("^[^%s–]-/[^%s–]-[^%.,]$") then -- HDL must contain a forward slash, must not contain spaces, endashes, and must not end with period or comma
set_message ('err_bad_hdl' );
options.coins_list_t['HDL'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< I S B N >----------------------------------------------------------------------
Determines whether an ISBN string is valid
]]
local function isbn (options)
local isbn_str = options.id;
local ignore_invalid = options.accept;
local handler = options.handler;
local function return_result (check, err_type) -- local function to handle the various returns
local ISBN = internal_link_id ({link = handler.link, label = handler.label, redirect = handler.redirect,
prefix = handler.prefix, id = isbn_str, separator = handler.separator});
if ignore_invalid then -- if ignoring ISBN errors
set_message ('maint_isbn_ignore'); -- add a maint category even when there is no error
else -- here when not ignoring
if not check then -- and there is an error
options.coins_list_t['ISBN'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_isbn', err_type); -- set an error message
return ISBN; -- return id text
end
end
return ISBN; -- return id text
end
if nil ~= isbn_str:match ('[^%s-0-9X]') then
return return_result (false, cfg.err_msg_supl.char); -- fail if isbn_str contains anything but digits, hyphens, or the uppercase X
end
local id = isbn_str:gsub ('[%s-]', ''); -- remove hyphens and whitespace
local len = id:len();
if len ~= 10 and len ~= 13 then
return return_result (false, cfg.err_msg_supl.length); -- fail if incorrect length
end
if len == 10 then
if id:match ('^%d*X?$') == nil then -- fail if isbn_str has 'X' anywhere but last position
return return_result (false, cfg.err_msg_supl.form);
end
if not is_valid_isxn (id, 10) then -- test isbn-10 for numerical validity
return return_result (false, cfg.err_msg_supl.check); -- fail if isbn-10 is not numerically valid
end
if id:find ('^63[01]') then -- 630xxxxxxx and 631xxxxxxx are (apparently) not valid isbn group ids but are used by amazon as numeric identifiers (asin)
return return_result (false, cfg.err_msg_supl.group); -- fail if isbn-10 begins with 630/1
end
return return_result (true, cfg.err_msg_supl.check); -- pass if isbn-10 is numerically valid
else
if id:match ('^%d+$') == nil then
return return_result (false, cfg.err_msg_supl.char); -- fail if ISBN-13 is not all digits
end
if id:match ('^97[89]%d*$') == nil then
return return_result (false, cfg.err_msg_supl.prefix); -- fail when ISBN-13 does not begin with 978 or 979
end
if id:match ('^9790') then
return return_result (false, cfg.err_msg_supl.group); -- group identifier '0' is reserved to ISMN
end
return return_result (is_valid_isxn_13 (id), cfg.err_msg_supl.check);
end
end
--[[--------------------------< A S I N >----------------------------------------------------------------------
Formats a link to Amazon. Do simple error checking: ASIN must be mix of 10 numeric or uppercase alpha
characters. If a mix, first character must be uppercase alpha; if all numeric, ASINs must be 10-digit
ISBN. If 10-digit ISBN, add a maintenance category so a bot or AWB script can replace |asin= with |isbn=.
Error message if not 10 characters, if not ISBN-10, if mixed and first character is a digit.
|asin=630....... and |asin=631....... are (apparently) not a legitimate ISBN though it checksums as one; these
do not cause this function to emit the maint_asin message
This function is positioned here because it calls isbn()
]]
local function asin (options)
local id = options.id;
local domain = options.ASINTLD;
local err_flag;
if not id:match("^[%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u]$") then
err_flag = set_message ('err_bad_asin'); -- ASIN is not a mix of 10 uppercase alpha and numeric characters
else
if id:match("^%d%d%d%d%d%d%d%d%d[%dX]$") then -- if 10-digit numeric (or 9 digits with terminal X)
if is_valid_isxn (id, 10) then -- see if ASIN value is or validates as ISBN-10
if not id:find ('^63[01]') then -- 630xxxxxxx and 631xxxxxxx are (apparently) not a valid isbn prefixes but are used by amazon as a numeric identifier
err_flag = set_message ('err_bad_asin'); -- ASIN has ISBN-10 form but begins with something other than 630/1 so probably an isbn
end
elseif not is_set (err_flag) then
err_flag = set_message ('err_bad_asin'); -- ASIN is not ISBN-10
end
elseif not id:match("^%u[%d%u]+$") then
err_flag = set_message ('err_bad_asin'); -- asin doesn't begin with uppercase alpha
end
end
if (not is_set (domain)) or in_array (domain, {'us'}) then -- default: United States
domain = "com";
elseif in_array (domain, {'jp', 'uk'}) then -- Japan, United Kingdom
domain = "co." .. domain;
elseif in_array (domain, {'z.cn'}) then -- China
domain = "cn";
elseif in_array (domain, {'au', 'br', 'mx', 'sg', 'tr'}) then -- Australia, Brazil, Mexico, Singapore, Turkey
domain = "com." .. domain;
elseif not in_array (domain, {'ae', 'ca', 'cn', 'de', 'es', 'fr', 'in', 'it', 'nl', 'pl', 'sa', 'se', 'co.jp', 'co.uk', 'com', 'com.au', 'com.br', 'com.mx', 'com.sg', 'com.tr'}) then -- Arabic Emirates, Canada, China, Germany, Spain, France, Indonesia, Italy, Netherlands, Poland, Saudi Arabia, Sweden (as of 2021-03 Austria (.at), Liechtenstein (.li) and Switzerland (.ch) still redirect to the German site (.de) with special settings, so don't maintain local ASINs for them)
err_flag = set_message ('err_bad_asin_tld'); -- unsupported asin-tld value
end
local handler = options.handler;
if not is_set (err_flag) then
options.coins_list_t['ASIN'] = handler.prefix .. domain .. "/dp/" .. id; -- asin for coins
else
options.coins_list_t['ASIN'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix .. domain .. "/dp/",
id = id, encode = handler.encode, separator = handler.separator})
end
--[[--------------------------< I S M N >----------------------------------------------------------------------
Determines whether an ISMN string is valid. Similar to ISBN-13, ISMN is 13 digits beginning 979-0-... and uses the
same check digit calculations. See https://www.ismn-international.org/download/Web_ISMN_Users_Manual_2008-6.pdf
section 2, pages 9–12.
ismn value not made part of COinS metadata because we don't have a url or isn't a COinS-defined identifier (rft.xxx)
or an identifier registered at info-uri.info (info:)
]]
local function ismn (options)
local id = options.id;
local handler = options.handler;
local text;
local valid_ismn = true;
local id_copy;
id_copy = id; -- save a copy because this testing is destructive
id = id:gsub ('[%s-]', ''); -- remove hyphens and white space
if 13 ~= id:len() or id:match ("^9790%d*$" ) == nil then -- ISMN must be 13 digits and begin with 9790
valid_ismn = false;
else
valid_ismn=is_valid_isxn_13 (id); -- validate ISMN
end
-- text = internal_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect, -- use this (or external version) when there is some place to link to
-- prefix = handler.prefix, id = id_copy, separator = handler.separator, encode = handler.encode})
text = table.concat ( -- because no place to link to yet
{
make_wikilink (link_label_make (handler), handler.label),
handler.separator,
id_copy
});
if false == valid_ismn then
options.coins_list_t['ISMN'] = nil; -- when error, unset so not included in COinS; not really necessary here because ismn not made part of COinS
set_message ('err_bad_ismn'); -- create an error message if the ISMN is invalid
end
return text;
end
--[[--------------------------< I S S N >----------------------------------------------------------------------
Validate and format an ISSN. This code fixes the case where an editor has included an ISSN in the citation but
has separated the two groups of four digits with a space. When that condition occurred, the resulting link looked
like this:
|issn=0819 4327 gives: [https://www.worldcat.org/issn/0819 4327 0819 4327] -- can't have spaces in an external link
This code now prevents that by inserting a hyphen at the ISSN midpoint. It also validates the ISSN for length
and makes sure that the checkdigit agrees with the calculated value. Incorrect length (8 digits), characters
other than 0-9 and X, or checkdigit / calculated value mismatch will all cause a check ISSN error message. The
ISSN is always displayed with a hyphen, even if the ISSN was given as a single group of 8 digits.
]]
local function issn (options)
local id = options.id;
local handler = options.handler;
local ignore_invalid = options.accept;
local issn_copy = id; -- save a copy of unadulterated ISSN; use this version for display if ISSN does not validate
local text;
local valid_issn = true;
id = id:gsub ('[%s-]', ''); -- remove hyphens and whitespace
if 8 ~= id:len() or nil == id:match ("^%d*X?$" ) then -- validate the ISSN: 8 digits long, containing only 0-9 or X in the last position
valid_issn = false; -- wrong length or improper character
else
valid_issn = is_valid_isxn (id, 8); -- validate ISSN
end
if true == valid_issn then
id = string.sub (id, 1, 4 ) .. "-" .. string.sub (id, 5 ); -- if valid, display correctly formatted version
else
id = issn_copy; -- if not valid, show the invalid ISSN with error message
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode})
if ignore_invalid then
set_message ('maint_issn_ignore');
else
if false == valid_issn then
options.coins_list_t['ISSN'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_issn', (options.hkey == 'EISSN') and 'e' or ''); -- create an error message if the ISSN is invalid
end
end
return text;
end
--[[--------------------------< J F M >-----------------------------------------------------------------------
A numerical identifier in the form nn.nnnn.nn
]]
local function jfm (options)
local id = options.id;
local handler = options.handler;
local id_num;
id_num = id:match ('^[Jj][Ff][Mm](.*)$'); -- identifier with jfm prefix; extract identifier
if is_set (id_num) then
set_message ('maint_jfm_format');
else -- plain number without JFM prefix
id_num = id; -- if here id does not have prefix
end
if id_num and id_num:match('^%d%d%.%d%d%d%d%.%d%d$') then
id = id_num; -- jfm matches pattern
else
set_message ('err_bad_jfm' ); -- set an error message
options.coins_list_t['JFM'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< J S T O R >--------------------------------------------------------------------
Format a JSTOR with some error checking
]]
local function jstor (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
if id:find ('[Jj][Ss][Tt][Oo][Rr]') or id:find ('^https?://') or id:find ('%s') then
set_message ('err_bad_jstor'); -- set an error message
options.coins_list_t['JSTOR'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access});
end
--[[--------------------------< L C C N >----------------------------------------------------------------------
Format LCCN link and do simple error checking. LCCN is a character string 8-12 characters long. The length of
the LCCN dictates the character type of the first 1-3 characters; the rightmost eight are always digits.
https://oclc-research.github.io/infoURI-Frozen/info-uri.info/info:lccn/reg.html
length = 8 then all digits
length = 9 then lccn[1] is lowercase alpha
length = 10 then lccn[1] and lccn[2] are both lowercase alpha or both digits
length = 11 then lccn[1] is lower case alpha, lccn[2] and lccn[3] are both lowercase alpha or both digits
length = 12 then lccn[1] and lccn[2] are both lowercase alpha
]]
local function lccn (options)
local lccn = options.id;
local handler = options.handler;
local err_flag; -- presume that LCCN is valid
local id = lccn; -- local copy of the LCCN
id = normalize_lccn (id); -- get canonical form (no whitespace, hyphens, forward slashes)
local len = id:len(); -- get the length of the LCCN
if 8 == len then
if id:match("[^%d]") then -- if LCCN has anything but digits (nil if only digits)
err_flag = set_message ('err_bad_lccn'); -- set an error message
end
elseif 9 == len then -- LCCN should be adddddddd
if nil == id:match("%l%d%d%d%d%d%d%d%d") then -- does it match our pattern?
err_flag = set_message ('err_bad_lccn'); -- set an error message
end
elseif 10 == len then -- LCCN should be aadddddddd or dddddddddd
if id:match("[^%d]") then -- if LCCN has anything but digits (nil if only digits) ...
if nil == id:match("^%l%l%d%d%d%d%d%d%d%d") then -- ... see if it matches our pattern
err_flag = set_message ('err_bad_lccn'); -- no match, set an error message
end
end
elseif 11 == len then -- LCCN should be aaadddddddd or adddddddddd
if not (id:match("^%l%l%l%d%d%d%d%d%d%d%d") or id:match("^%l%d%d%d%d%d%d%d%d%d%d")) then -- see if it matches one of our patterns
err_flag = set_message ('err_bad_lccn'); -- no match, set an error message
end
elseif 12 == len then -- LCCN should be aadddddddddd
if not id:match("^%l%l%d%d%d%d%d%d%d%d%d%d") then -- see if it matches our pattern
err_flag = set_message ('err_bad_lccn'); -- no match, set an error message
end
else
err_flag = set_message ('err_bad_lccn'); -- wrong length, set an error message
end
if not is_set (err_flag) and nil ~= lccn:find ('%s') then
err_flag = set_message ('err_bad_lccn'); -- lccn contains a space, set an error message
end
if is_set (err_flag) then
options.coins_list_t['LCCN'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = lccn, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< M R >--------------------------------------------------------------------------
A seven digit number; if not seven digits, zero-fill leading digits to make seven digits.
]]
local function mr (options)
local id = options.id;
local handler = options.handler;
local id_num;
local id_len;
id_num = id:match ('^[Mm][Rr](%d+)$'); -- identifier with mr prefix
if is_set (id_num) then
set_message ('maint_mr_format'); -- add maint cat
else -- plain number without mr prefix
id_num = id:match ('^%d+$'); -- if here id is all digits
end
id_len = id_num and id_num:len() or 0;
if (7 >= id_len) and (0 ~= id_len) then
id = string.rep ('0', 7-id_len) .. id_num; -- zero-fill leading digits
else
set_message ('err_bad_mr'); -- set an error message
options.coins_list_t['MR'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< O C L C >----------------------------------------------------------------------
Validate and format an OCLC ID. https://www.oclc.org/batchload/controlnumber.en.html {{dead link}}
archived at: https://web.archive.org/web/20161228233804/https://www.oclc.org/batchload/controlnumber.en.html
]]
local function oclc (options)
local id = options.id;
local handler = options.handler;
local number;
if id:match('^ocm%d%d%d%d%d%d%d%d$') then -- ocm prefix and 8 digits; 001 field (12 characters)
number = id:match('ocm(%d+)'); -- get the number
elseif id:match('^ocn%d%d%d%d%d%d%d%d%d$') then -- ocn prefix and 9 digits; 001 field (12 characters)
number = id:match('ocn(%d+)'); -- get the number
elseif id:match('^on%d%d%d%d%d%d%d%d%d%d+$') then -- on prefix and 10 or more digits; 001 field (12 characters)
number = id:match('^on(%d%d%d%d%d%d%d%d%d%d+)$'); -- get the number
elseif id:match('^%(OCoLC%)[1-9]%d*$') then -- (OCoLC) prefix and variable number digits; no leading zeros; 035 field
number = id:match('%(OCoLC%)([1-9]%d*)'); -- get the number
if 9 < number:len() then
number = nil; -- constrain to 1 to 9 digits; change this when OCLC issues 10-digit numbers
end
elseif id:match('^%d+$') then -- no prefix
number = id; -- get the number
if 10 < number:len() then
number = nil; -- constrain to 1 to 10 digits; change this when OCLC issues 11-digit numbers
end
end
if number then -- proper format
id = number; -- exclude prefix, if any, from external link
else
set_message ('err_bad_oclc') -- add an error message if the id is malformed
options.coins_list_t['OCLC'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< O P E N L I B R A R Y >--------------------------------------------------------
Formats an OpenLibrary link, and checks for associated errors.
]]
local function openlibrary (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local ident, code = id:gsub('^OL', ''):match("^(%d+([AMW]))$"); -- strip optional OL prefix followed immediately by digits followed by 'A', 'M', or 'W';
local err_flag;
local prefix = { -- these are appended to the handler.prefix according to code
['A']='authors/OL',
['M']='books/OL',
['W']='works/OL',
['X']='OL' -- not a code; spoof when 'code' in id is invalid
};
if not ident then
code = 'X'; -- no code or id completely invalid
ident = id; -- copy id to ident so that we display the flawed identifier
err_flag = set_message ('err_bad_ol');
end
if not is_set (err_flag) then
options.coins_list_t['OL'] = handler.prefix .. prefix[code] .. ident; -- experiment for ol coins
else
options.coins_list_t['OL'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix .. prefix[code],
id = ident, separator = handler.separator, encode = handler.encode,
access = access});
end
--[[--------------------------< O S T I >----------------------------------------------------------------------
Format OSTI and do simple error checking. OSTIs are sequential numbers beginning at 1 and counting up. This
code checks the OSTI to see that it contains only digits and is less than test_limit specified in the configuration;
the value in test_limit will need to be updated periodically as more OSTIs are issued.
NB. 1018 is the lowest OSTI number found in the wild (so far) and resolving OK on the OSTI site
]]
local function osti (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
if id:match("[^%d]") then -- if OSTI has anything but digits
set_message ('err_bad_osti'); -- set an error message
options.coins_list_t['OSTI'] = nil; -- when error, unset so not included in COinS
else -- OSTI is only digits
local id_num = tonumber (id); -- convert id to a number for range testing
if 1018 > id_num or handler.id_limit < id_num then -- if OSTI is outside test limit boundaries
set_message ('err_bad_osti'); -- set an error message
options.coins_list_t['OSTI'] = nil; -- when error, unset so not included in COinS
end
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access});
end
--[[--------------------------< P M C >------------------------------------------------------------------------
Format a PMC, do simple error checking, and check for embargoed articles.
The embargo parameter takes a date for a value. If the embargo date is in the future the PMC identifier will not
be linked to the article. If the embargo date is today or in the past, or if it is empty or omitted, then the
PMC identifier is linked to the article through the link at cfg.id_handlers['PMC'].prefix.
PMC embargo date testing is done in function is_embargoed () which is called earlier because when the citation
has |pmc=<value> but does not have a |url= then |title= is linked with the PMC link. Function is_embargoed ()
returns the embargo date if the PMC article is still embargoed, otherwise it returns an empty string.
PMCs are sequential numbers beginning at 1 and counting up. This code checks the PMC to see that it contains only digits and is less
than test_limit; the value in local variable test_limit will need to be updated periodically as more PMCs are issued.
]]
local function pmc (options)
local id = options.id;
local embargo = options.Embargo; -- TODO: lowercase?
local handler = options.handler;
local err_flag;
local id_num;
local text;
id_num = id:match ('^[Pp][Mm][Cc](%d+)$'); -- identifier with PMC prefix
if is_set (id_num) then
set_message ('maint_pmc_format');
else -- plain number without PMC prefix
id_num = id:match ('^%d+$'); -- if here id is all digits
end
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber (id_num); -- convert id_num to a number for range testing
if 1 > id_num or handler.id_limit < id_num then -- if PMC is outside test limit boundaries
err_flag = set_message ('err_bad_pmc'); -- set an error message
else
id = tostring (id_num); -- make sure id is a string
end
else -- when id format incorrect
err_flag = set_message ('err_bad_pmc'); -- set an error message
end
if is_set (embargo) and is_set (is_embargoed (embargo)) then -- is PMC is still embargoed?
text = table.concat ( -- still embargoed so no external link
{
make_wikilink (link_label_make (handler), handler.label),
handler.separator,
id,
});
else
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect, -- no embargo date or embargo has expired, ok to link to article
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = handler.access,
auto_link = not err_flag and 'pmc' or nil -- do not auto-link when PMC has error
});
end
if err_flag then
options.coins_list_t['PMC'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< P M I D >----------------------------------------------------------------------
Format PMID and do simple error checking. PMIDs are sequential numbers beginning at 1 and counting up. This
code checks the PMID to see that it contains only digits and is less than test_limit; the value in local variable
test_limit will need to be updated periodically as more PMIDs are issued.
]]
local function pmid (options)
local id = options.id;
local handler = options.handler;
if id:match("[^%d]") then -- if PMID has anything but digits
set_message ('err_bad_pmid'); -- set an error message
options.coins_list_t['PMID'] = nil; -- when error, unset so not included in COinS
else -- PMID is only digits
local id_num = tonumber (id); -- convert id to a number for range testing
if 1 > id_num or handler.id_limit < id_num then -- if PMID is outside test limit boundaries
set_message ('err_bad_pmid'); -- set an error message
options.coins_list_t['PMID'] = nil; -- when error, unset so not included in COinS
end
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< R F C >------------------------------------------------------------------------
Format RFC and do simple error checking. RFCs are sequential numbers beginning at 1 and counting up. This
code checks the RFC to see that it contains only digits and is less than test_limit specified in the configuration;
the value in test_limit will need to be updated periodically as more RFCs are issued.
An index of all RFCs is here: https://tools.ietf.org/rfc/
]]
local function rfc (options)
local id = options.id;
local handler = options.handler;
if id:match("[^%d]") then -- if RFC has anything but digits
set_message ('err_bad_rfc'); -- set an error message
options.coins_list_t['RFC'] = nil; -- when error, unset so not included in COinS
else -- RFC is only digits
local id_num = tonumber (id); -- convert id to a number for range testing
if 1 > id_num or handler.id_limit < id_num then -- if RFC is outside test limit boundaries
set_message ('err_bad_rfc'); -- set an error message
options.coins_list_t['RFC'] = nil; -- when error, unset so not included in COinS
end
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = handler.access});
end
--[[--------------------------< S 2 C I D >--------------------------------------------------------------------
Format an S2CID, do simple error checking
S2CIDs are sequential numbers beginning at 1 and counting up. This code checks the S2CID to see that it is only
digits and is less than test_limit; the value in local variable test_limit will need to be updated periodically
as more S2CIDs are issued.
]]
local function s2cid (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local id_num;
local text;
id_num = id:match ('^[1-9]%d*$'); -- id must be all digits; must not begin with 0; no open access flag
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber (id_num); -- convert id_num to a number for range testing
if handler.id_limit < id_num then -- if S2CID is outside test limit boundaries
set_message ('err_bad_s2cid'); -- set an error message
options.coins_list_t['S2CID'] = nil; -- when error, unset so not included in COinS
end
else -- when id format incorrect
set_message ('err_bad_s2cid'); -- set an error message
options.coins_list_t['S2CID'] = nil; -- when error, unset so not included in COinS
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access});
return text;
end
--[[--------------------------< S B N >------------------------------------------------------------------------
9-digit form of ISBN-10; uses same check-digit validation when SBN is prefixed with an additional '0' to make 10 digits
sbn value not made part of COinS metadata because we don't have a url or isn't a COinS-defined identifier (rft.xxx)
or an identifier registered at info-uri.info (info:)
]]
local function sbn (options)
local id = options.id;
local ignore_invalid = options.accept;
local handler = options.handler;
local function return_result (check, err_type) -- local function to handle the various returns
local SBN = internal_link_id ({link = handler.link, label = handler.label, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator});
if not ignore_invalid then -- if not ignoring SBN errors
if not check then
options.coins_list_t['SBN'] = nil; -- when error, unset so not included in COinS; not really necessary here because sbn not made part of COinS
set_message ('err_bad_sbn', {err_type}); -- display an error message
return SBN;
end
else
set_message ('maint_isbn_ignore'); -- add a maint category even when there is no error (ToDo: Possibly switch to separate message for SBNs only)
end
return SBN;
end
if id:match ('[^%s-0-9X]') then
return return_result (false, cfg.err_msg_supl.char); -- fail if SBN contains anything but digits, hyphens, or the uppercase X
end
local ident = id:gsub ('[%s-]', ''); -- remove hyphens and whitespace; they interfere with the rest of the tests
if 9 ~= ident:len() then
return return_result (false, cfg.err_msg_supl.length); -- fail if incorrect length
end
if ident:match ('^%d*X?$') == nil then
return return_result (false, cfg.err_msg_supl.form); -- fail if SBN has 'X' anywhere but last position
end
return return_result (is_valid_isxn ('0' .. ident, 10), cfg.err_msg_supl.check);
end
--[[--------------------------< S S R N >----------------------------------------------------------------------
Format an SSRN, do simple error checking
SSRNs are sequential numbers beginning at 100? and counting up. This code checks the SSRN to see that it is
only digits and is greater than 99 and less than test_limit; the value in local variable test_limit will need
to be updated periodically as more SSRNs are issued.
]]
local function ssrn (options)
local id = options.id;
local handler = options.handler;
local id_num;
local text;
id_num = id:match ('^%d+$'); -- id must be all digits
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber (id_num); -- convert id_num to a number for range testing
if 100 > id_num or handler.id_limit < id_num then -- if SSRN is outside test limit boundaries
set_message ('err_bad_ssrn'); -- set an error message
options.coins_list_t['SSRN'] = nil; -- when error, unset so not included in COinS
end
else -- when id format incorrect
set_message ('err_bad_ssrn'); -- set an error message
options.coins_list_t['SSRN'] = nil; -- when error, unset so not included in COinS
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = options.access});
return text;
end
--[[--------------------------< U S E N E T _ I D >------------------------------------------------------------
Validate and format a usenet message id. Simple error checking, looks for 'id-left@id-right' not enclosed in
'<' and/or '>' angle brackets.
]]
local function usenet_id (options)
local id = options.id;
local handler = options.handler;
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode})
if not id:match('^.+@.+$') or not id:match('^[^<].*[^>]$') then -- doesn't have '@' or has one or first or last character is '< or '>'
set_message ('err_bad_usenet_id') -- add an error message if the message id is invalid
options.coins_list_t['USENETID'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< Z B L >-----------------------------------------------------------------------
A numerical identifier in the form nnnn.nnnnn - leading zeros in the first quartet optional
format described here: http://emis.mi.sanu.ac.rs/ZMATH/zmath/en/help/search/
temporary format is apparently eight digits. Anything else is an error
]]
local function zbl (options)
local id = options.id;
local handler = options.handler;
if id:match('^%d%d%d%d%d%d%d%d$') then -- is this identifier using temporary format?
set_message ('maint_zbl'); -- yes, add maint cat
elseif not id:match('^%d?%d?%d?%d%.%d%d%d%d%d$') then -- not temporary, is it normal format?
set_message ('err_bad_zbl'); -- no, set an error message
options.coins_list_t['ZBL'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--============================<< I N T E R F A C E F U N C T I O N S >>==========================================
--[[--------------------------< E X T R A C T _ I D S >------------------------------------------------------------
Populates ID table from arguments using configuration settings. Loops through cfg.id_handlers and searches args for
any of the parameters listed in each cfg.id_handlers['...'].parameters. If found, adds the parameter and value to
the identifier list. Emits redundant error message if more than one alias exists in args
]]
local function extract_ids (args)
local id_list = {}; -- list of identifiers found in args
for k, v in pairs (cfg.id_handlers) do -- k is uppercase identifier name as index to cfg.id_handlers; e.g. cfg.id_handlers['ISBN'], v is a table
v = select_one (args, v.parameters, 'err_redundant_parameters' ); -- v.parameters is a table of aliases for k; here we pick one from args if present
if is_set (v) then id_list[k] = v; end -- if found in args, add identifier to our list
end
return id_list;
end
--[[--------------------------< E X T R A C T _ I D _ A C C E S S _ L E V E L S >--------------------------------------
Fetches custom id access levels from arguments using configuration settings. Parameters which have a predefined access
level (e.g. arxiv) do not use this function as they are directly rendered as free without using an additional parameter.
returns a table of k/v pairs where k is same as the identifier's key in cfg.id_handlers and v is the assigned (valid) keyword
access-level values must match the case used in cfg.keywords_lists['id-access'] (lowercase unless there is some special reason for something else)
]]
local function extract_id_access_levels (args, id_list)
local id_accesses_list = {};
for k, v in pairs (cfg.id_handlers) do
local access_param = v.custom_access; -- name of identifier's access-level parameter
if is_set (access_param) then
local access_level = args[access_param]; -- get the assigned value if there is one
if is_set (access_level) then
if not in_array (access_level, cfg.keywords_lists['id-access']) then -- exact match required
set_message ('err_invalid_param_val', {access_param, access_level});
access_level = nil; -- invalid so unset
end
if not is_set (id_list[k]) then -- identifier access-level must have a matching identifier
set_message ('err_param_access_requires_param', {k:lower()}); -- parameter name is uppercase in cfg.id_handlers (k); lowercase for error message
end
id_accesses_list[k] = cfg.keywords_xlate[access_level]; -- get translated keyword
end
end
end
return id_accesses_list;
end
--[[--------------------------< B U I L D _ I D _ L I S T >----------------------------------------------------
render the identifiers into a sorted sequence table
<ID_list_coins_t> is a table of k/v pairs where k is same as key in cfg.id_handlers and v is the assigned value
<options_t> is a table of various k/v option pairs provided in the call to new_build_id_list();
modified by this function and passed to all identifier rendering functions
<access_levels_t> is a table of k/v pairs where k is same as key in cfg.id_handlers and v is the assigned value (if valid)
returns a sequence table of sorted (by hkey - 'handler' key) rendered identifier strings
]]
local function build_id_list (ID_list_coins_t, options_t, access_levels_t)
local ID_list_t = {};
local accept;
local func_map = { --function map points to functions associated with hkey identifier
['ARXIV'] = arxiv,
['ASIN'] = asin,
['BIBCODE'] = bibcode,
['BIORXIV'] = biorxiv,
['CITESEERX'] = citeseerx,
['DOI'] = doi,
['EISSN'] = issn,
['HDL'] = hdl,
['ISBN'] = isbn,
['ISMN'] = ismn,
['ISSN'] = issn,
['JFM'] = jfm,
['JSTOR'] = jstor,
['LCCN'] = lccn,
['MR'] = mr,
['OCLC'] = oclc,
['OL'] = openlibrary,
['OSTI'] = osti,
['PMC'] = pmc,
['PMID'] = pmid,
['RFC'] = rfc,
['S2CID'] = s2cid,
['SBN'] = sbn,
['SSRN'] = ssrn,
['USENETID'] = usenet_id,
['ZBL'] = zbl,
}
for hkey, v in pairs (ID_list_coins_t) do
v, accept = has_accept_as_written (v); -- remove accept-as-written markup if present; accept is boolean true when markup removed; false else
-- every function gets the options table with value v and accept boolean
options_t.hkey = hkey; -- ~/Configuration handler key
options_t.id = v; -- add that identifier value to the options table
options_t.accept = accept; -- add the accept boolean flag
options_t.access = access_levels_t[hkey]; -- add the access level for those that have an |<identifier-access= parameter
options_t.handler = cfg.id_handlers[hkey];
options_t.coins_list_t = ID_list_coins_t; -- pointer to ID_list_coins_t; for |asin= and |ol=; also to keep erroneous values out of the citation's metadata
options_t.coins_list_t[hkey] = v; -- id value without accept-as-written markup for metadata
if options_t.handler.access and not in_array (options_t.handler.access, cfg.keywords_lists['id-access']) then
error (cfg.messages['unknown_ID_access'] .. options_t.handler.access); -- here when handler access key set to a value not listed in list of allowed id access keywords
end
if func_map[hkey] then
local id_text = func_map[hkey] (options_t); -- call the function to get identifier text and any error message
table.insert (ID_list_t, {hkey, id_text}); -- add identifier text to the output sequence table
else
error (cfg.messages['unknown_ID_key'] .. hkey); -- here when func_map doesn't have a function for hkey
end
end
local function comp (a, b) -- used by following table.sort()
return a[1]:lower() < b[1]:lower(); -- sort by hkey
end
table.sort (ID_list_t, comp); -- sequence table of tables sort
for k, v in ipairs (ID_list_t) do -- convert sequence table of tables to simple sequence table of strings
ID_list_t[k] = v[2]; -- v[2] is the identifier rendering from the call to the various functions in func_map{}
end
return ID_list_t;
end
--[[--------------------------< O P T I O N S _ C H E C K >----------------------------------------------------
check that certain option parameters have their associated identifier parameters with values
<ID_list_coins_t> is a table of k/v pairs where k is same as key in cfg.id_handlers and v is the assigned value
<ID_support_t> is a sequence table of tables created in citation0() where each subtable has four elements:
[1] is the support parameter's assigned value; empty string if not set
[2] is a text string same as key in cfg.id_handlers
[3] is cfg.error_conditions key used to create error message
[4] is original ID support parameter name used to create error message
returns nothing; on error emits an appropriate error message
]]
local function options_check (ID_list_coins_t, ID_support_t)
for _, v in ipairs (ID_support_t) do
if is_set (v[1]) and not ID_list_coins_t[v[2]] then -- when support parameter has a value but matching identifier parameter is missing or empty
set_message (v[3], (v[4])); -- emit the appropriate error message
end
end
end
--[[--------------------------< I D E N T I F I E R _ L I S T S _ G E T >--------------------------------------
Creates two identifier lists: a k/v table of identifiers and their values to be used locally and for use in the
COinS metadata, and a sequence table of the rendered identifier strings that will be included in the rendered
citation.
]]
local function identifier_lists_get (args_t, options_t, ID_support_t)
local ID_list_coins_t = extract_ids (args_t); -- get a table of identifiers and their values for use locally and for use in COinS
options_check (ID_list_coins_t, ID_support_t); -- ID support parameters must have matching identifier parameters
local ID_access_levels_t = extract_id_access_levels (args_t, ID_list_coins_t); -- get a table of identifier access levels
local ID_list_t = build_id_list (ID_list_coins_t, options_t, ID_access_levels_t); -- get a sequence table of rendered identifier strings
return ID_list_t, ID_list_coins_t; -- return the tables
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table and imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
cfg = cfg_table_ptr;
has_accept_as_written = utilities_page_ptr.has_accept_as_written; -- import functions from select Module:Citation/CS1/Utilities module
is_set = utilities_page_ptr.is_set;
in_array = utilities_page_ptr.in_array;
set_message = utilities_page_ptr.set_message;
select_one = utilities_page_ptr.select_one;
substitute = utilities_page_ptr.substitute;
make_wikilink = utilities_page_ptr.make_wikilink;
z = utilities_page_ptr.z; -- table of tables in Module:Citation/CS1/Utilities
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
auto_link_urls = auto_link_urls, -- table of identifier URLs to be used when auto-linking |title=
identifier_lists_get = identifier_lists_get, -- experiment to replace individual calls to build_id_list(), extract_ids, extract_id_access_levels
is_embargoed = is_embargoed;
set_selected_modules = set_selected_modules;
}
7de1cb3ecf620ae52d26ff9beaf2d8b1c95dedca
Module:Citation/CS1/Date validation
828
115
238
2023-01-14T14:43:40Z
wikipedia>Trappist the monk
0
sync from sandbox;
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local add_prop_cat, is_set, in_array, set_message, substitute, wrap_style; -- imported functions from selected Module:Citation/CS1/Utilities
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< F I L E - S C O P E D E C L A R A T I O N S >--------------------------------
File-scope variables are declared here
]]
local lang_object = mw.getContentLanguage(); -- used by is_valid_accessdate(), is_valid_year(), date_name_xlate(); TODO: move to ~/Configuration?
local year_limit; -- used by is_valid_year()
--[=[-------------------------< I S _ V A L I D _ A C C E S S D A T E >----------------------------------------
returns true if:
Wikipedia start date <= accessdate < today + 2 days
Wikipedia start date is 2001-01-15T00:00:00 UTC which is 979516800 seconds after 1970-01-01T00:00:00 UTC (the start of Unix time)
accessdate is the date provided in |access-date= at time 00:00:00 UTC
today is the current date at time 00:00:00 UTC plus 48 hours
if today is 2015-01-01T00:00:00 then
adding 24 hours gives 2015-01-02T00:00:00 – one second more than today
adding 24 hours gives 2015-01-03T00:00:00 – one second more than tomorrow
This function does not work if it is fed month names for languages other than English. Wikimedia #time: parser
apparently doesn't understand non-English date month names. This function will always return false when the date
contains a non-English month name because good1 is false after the call to lang.formatDate(). To get around that
call this function with YYYY-MM-DD format dates.
]=]
local function is_valid_accessdate (accessdate)
local good1, good2;
local access_ts, tomorrow_ts; -- to hold Unix time stamps representing the dates
good1, access_ts = pcall (lang_object.formatDate, lang_object, 'U', accessdate ); -- convert accessdate value to Unix timestamp
good2, tomorrow_ts = pcall (lang_object.formatDate, lang_object, 'U', 'today + 2 days' ); -- today midnight + 2 days is one second more than all day tomorrow
if good1 and good2 then -- lang.formatDate() returns a timestamp in the local script which which tonumber() may not understand
access_ts = tonumber (access_ts) or lang_object:parseFormattedNumber (access_ts); -- convert to numbers for the comparison;
tomorrow_ts = tonumber (tomorrow_ts) or lang_object:parseFormattedNumber (tomorrow_ts);
else
return false; -- one or both failed to convert to Unix time stamp
end
if 979516800 <= access_ts and access_ts < tomorrow_ts then -- Wikipedia start date <= accessdate < tomorrow's date
return true;
else
return false; -- accessdate out of range
end
end
--[[--------------------------< G E T _ M O N T H _ N U M B E R >----------------------------------------------
returns a number according to the month in a date: 1 for January, etc. Capitalization and spelling must be correct.
If not a valid month, returns 0
]]
local function get_month_number (month)
return cfg.date_names['local'].long[month] or cfg.date_names['local'].short[month] or -- look for local names first
cfg.date_names['en'].long[month] or cfg.date_names['en'].short[month] or -- failing that, look for English names
0; -- not a recognized month name
end
--[[--------------------------< G E T _ S E A S O N _ N U M B E R >--------------------------------------------
returns a number according to the sequence of seasons in a year: 21 for Spring, etc. Capitalization and spelling
must be correct. If not a valid season, returns 0.
21-24 = Spring, Summer, Autumn, Winter, independent of “Hemisphere”
returns 0 when <param> is not |date=
Season numbering is defined by Extended Date/Time Format (EDTF) specification (https://www.loc.gov/standards/datetime/)
which became part of ISO 8601 in 2019. See '§Sub-year groupings'. The standard defines various divisions using
numbers 21-41. cs1|2 only supports generic seasons. EDTF does support the distinction between north and south
hemisphere seasons but cs1|2 has no way to make that distinction.
These additional divisions not currently supported:
25-28 = Spring - Northern Hemisphere, Summer- Northern Hemisphere, Autumn - Northern Hemisphere, Winter - Northern Hemisphere
29-32 = Spring – Southern Hemisphere, Summer– Southern Hemisphere, Autumn – Southern Hemisphere, Winter - Southern Hemisphere
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
37-39 = Quadrimester 1, Quadrimester 2, Quadrimester 3 (4 months each)
40-41 = Semestral 1, Semestral-2 (6 months each)
]]
local function get_season_number (season, param)
if 'date' ~= param then
return 0; -- season dates only supported by |date=
end
return cfg.date_names['local'].season[season] or -- look for local names first
cfg.date_names['en'].season[season] or -- failing that, look for English names
0; -- not a recognized season name
end
--[[--------------------------< G E T _ Q U A R T E R _ N U M B E R >------------------------------------------
returns a number according to the sequence of quarters in a year: 33 for first quarter, etc. Capitalization and spelling
must be correct. If not a valid quarter, returns 0.
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
returns 0 when <param> is not |date=
Quarter numbering is defined by Extended Date/Time Format (EDTF) specification (https://www.loc.gov/standards/datetime/)
which became part of ISO 8601 in 2019. See '§Sub-year groupings'. The standard defines various divisions using
numbers 21-41. cs1|2 only supports generic seasons and quarters.
These additional divisions not currently supported:
37-39 = Quadrimester 1, Quadrimester 2, Quadrimester 3 (4 months each)
40-41 = Semestral 1, Semestral-2 (6 months each)
]]
local function get_quarter_number (quarter, param)
if 'date' ~= param then
return 0; -- quarter dates only supported by |date=
end
quarter = mw.ustring.gsub (quarter, ' +', ' '); -- special case replace multiple space chars with a single space char
return cfg.date_names['local'].quarter[quarter] or -- look for local names first
cfg.date_names['en'].quarter[quarter] or -- failing that, look for English names
0; -- not a recognized quarter name
end
--[[--------------------------< G E T _ P R O P E R _ N A M E _ N U M B E R >----------------------------------
returns a non-zero number if date contains a recognized proper-name. Capitalization and spelling must be correct.
returns 0 when <param> is not |date=
]]
local function get_proper_name_number (name, param)
if 'date' ~= param then
return 0; -- proper-name dates only supported by |date=
end
return cfg.date_names['local'].named[name] or -- look for local names dates first
cfg.date_names['en'].named[name] or -- failing that, look for English names
0; -- not a recognized named date
end
--[[--------------------------< G E T _ E L E M E N T _ N U M B E R <------------------------------------------
returns true if month or season or quarter or proper name is valid (properly spelled, capitalized, abbreviated)
]]
local function get_element_number (element, param)
local num;
local funcs = {get_month_number, get_season_number, get_quarter_number, get_proper_name_number}; -- list of functions to execute in order
for _, func in ipairs (funcs) do -- spin through the function list
num = func (element, param); -- call the function and get the returned number
if 0 ~= num then -- non-zero when valid month season quarter
return num; -- return that number
end
end
return nil; -- not valid
end
--[[--------------------------< I S _ V A L I D _ Y E A R >----------------------------------------------------
Function gets current year from the server and compares it to year from a citation parameter. Years more than one
year in the future are not acceptable.
Special case for |pmc-embargo-date=: years more than two years in the future are not acceptable
]]
local function is_valid_year (year, param)
if not is_set (year_limit) then
year_limit = tonumber(os.date("%Y"))+1; -- global variable so we only have to fetch it once
end
year = tonumber (year) or lang_object:parseFormattedNumber (year); -- convert to number for the comparison;
if 'pmc-embargo-date' == param then -- special case for |pmc-embargo-date=
return year and (year <= tonumber(os.date("%Y"))+2) or false; -- years more than two years in the future are not accepted
end
return year and (year <= year_limit) or false;
end
--[[--------------------------< I S _ V A L I D _ D A T E >----------------------------------------------------
Returns true if day is less than or equal to the number of days in month and year is no farther into the future
than next year; else returns false.
Assumes Julian calendar prior to year 1582 and Gregorian calendar thereafter. Accounts for Julian calendar leap
years before 1582 and Gregorian leap years after 1582. Where the two calendars overlap (1582 to approximately
1923) dates are assumed to be Gregorian.
]]
local function is_valid_date (year, month, day, param)
local days_in_month = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
local month_length;
if not is_valid_year (year, param) then -- no farther into the future than next year except |pmc-embargo-date= no more than two years in the future
return false;
end
month = tonumber (month); -- required for YYYY-MM-DD dates
if (2 == month) then -- if February
month_length = 28; -- then 28 days unless
if 1582 > tonumber(year) then -- Julian calendar
if 0 == (year%4) then -- is a leap year?
month_length = 29; -- if leap year then 29 days in February
end
else -- Gregorian calendar
if (0 == (year%4) and (0 ~= (year%100) or 0 == (year%400))) then -- is a leap year?
month_length = 29; -- if leap year then 29 days in February
end
end
else
month_length = days_in_month[month];
end
if tonumber (day) > month_length then
return false;
end
return true;
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ R A N G E _ S T Y L E >--------------------------
Months in a range are expected to have the same style: Jan–Mar or October–December but not February–Mar or Jul–August.
This function looks in cfg.date_names{} to see if both month names are listed in the long subtable or both are
listed in the short subtable. When both have the same style (both are listed in the same table), returns true; false else
]]
local function is_valid_month_range_style (month1, month2)
if (cfg.date_names.en.long[month1] and cfg.date_names.en.long[month2]) or -- are both English names listed in the long subtable?
(cfg.date_names.en.short[month1] and cfg.date_names.en.short[month2]) or -- are both English names listed in the short subtable?
(cfg.date_names['local'].long[month1] and cfg.date_names['local'].long[month2]) or -- are both local names listed in the long subtable?
(cfg.date_names['local'].short[month1] and cfg.date_names['local'].short[month2]) then -- are both local names listed in the short subtable?
return true;
end
return false; -- names are mixed
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ S E A S O N _ R A N G E >------------------------
Check a pair of months or seasons to see if both are valid members of a month or season pair.
Month pairs are expected to be left to right, earliest to latest in time.
All season ranges are accepted as valid because there are publishers out there who have published a Summer–Spring YYYY issue, hence treat as ok
]]
local function is_valid_month_season_range(range_start, range_end, param)
local range_start_number = get_month_number (range_start);
local range_end_number;
if 0 == range_start_number then -- is this a month range?
range_start_number = get_season_number (range_start, param); -- not a month; is it a season? get start season number
range_end_number = get_season_number (range_end, param); -- get end season number
if (0 ~= range_start_number) and (0 ~= range_end_number) and (range_start_number ~= range_end_number) then
return true; -- any season pairing is accepted except when both are the same
end
return false; -- range_start and/or range_end is not a season
end
-- here when range_start is a month
range_end_number = get_month_number (range_end); -- get end month number
if range_start_number < range_end_number and -- range_start is a month; does range_start precede range_end?
is_valid_month_range_style (range_start, range_end) then -- do months have the same style?
return true; -- proper order and same style
end
return false; -- range_start month number is greater than or equal to range end number; or range end isn't a month
end
--[[--------------------------< M A K E _ C O I N S _ D A T E >------------------------------------------------
This function receives a table of date parts for one or two dates and an empty table reference declared in
Module:Citation/CS1. The function is called only for |date= parameters and only if the |date=<value> is
determined to be a valid date format. The question of what to do with invalid date formats is not answered here.
The date parts in the input table are converted to an ISO 8601 conforming date string:
single whole dates: yyyy-mm-dd
month and year dates: yyyy-mm
year dates: yyyy
ranges: yyyy-mm-dd/yyyy-mm-dd
yyyy-mm/yyyy-mm
yyyy/yyyy
Dates in the Julian calendar are reduced to year or year/year so that we don't have to do calendar conversion from
Julian to Proleptic Gregorian.
The input table has:
year, year2 – always present; if before 1582, ignore months and days if present
month, month2 – 0 if not provided, 1-12 for months, 21-24 for seasons; 99 Christmas
day, day2 – 0 if not provided, 1-31 for days
the output table receives:
rftdate: an ISO 8601 formatted date
rftchron: a free-form version of the date, usually without year which is in rftdate (season ranges and proper-name dates)
rftssn: one of four season keywords: winter, spring, summer, fall (lowercase)
rftquarter: one of four values: 1, 2, 3, 4
]]
local function make_COinS_date (input, tCOinS_date)
local date; -- one date or first date in a range
local date2 = ''; -- end of range date
-- start temporary Julian / Gregorian calendar uncertainty detection
local year = tonumber(input.year); -- this temporary code to determine the extent of sources dated to the Julian/Gregorian
local month = tonumber(input.month); -- interstice 1 October 1582 – 1 January 1926
local day = tonumber (input.day);
if (0 ~= day) and -- day must have a value for this to be a whole date
(((1582 == year) and (10 <= month) and (12 >= month)) or -- any whole 1582 date from 1 October to 31 December or
((1926 == year) and (1 == month) and (1 == input.day)) or -- 1 January 1926 or
((1582 < year) and (1925 >= year))) then -- any date 1 January 1583 – 31 December 1925
tCOinS_date.inter_cal_cat = true; -- set category flag true
end
-- end temporary Julian / Gregorian calendar uncertainty detection
if 1582 > tonumber(input.year) or 20 < tonumber(input.month) then -- Julian calendar or season so &rft.date gets year only
date = input.year;
if 0 ~= input.year2 and input.year ~= input.year2 then -- if a range, only the second year portion when not the same as range start year
date = string.format ('%.4d/%.4d', tonumber(input.year), tonumber(input.year2)) -- assemble the date range
end
if 20 < tonumber(input.month) then -- if season or proper-name date
local season = {[24] = 'winter', [21] = 'spring', [22] = 'summer', [23] = 'fall', [33] = '1', [34] = '2', [35] = '3', [36] = '4', [98] = 'Easter', [99] = 'Christmas'}; -- seasons lowercase, no autumn; proper-names use title case
if 0 == input.month2 then -- single season date
if 40 < tonumber(input.month) then
tCOinS_date.rftchron = season[input.month]; -- proper-name dates
elseif 30 < tonumber(input.month) then
tCOinS_date.rftquarter = season[input.month]; -- quarters
else
tCOinS_date.rftssn = season[input.month]; -- seasons
end
else -- season range with a second season specified
if input.year ~= input.year2 then -- season year – season year range or season year–year
tCOinS_date.rftssn = season[input.month]; -- start of range season; keep this?
if 0~= input.month2 then
tCOinS_date.rftchron = string.format ('%s %s – %s %s', season[input.month], input.year, season[input.month2], input.year2);
end
else -- season–season year range
tCOinS_date.rftssn = season[input.month]; -- start of range season; keep this?
tCOinS_date.rftchron = season[input.month] .. '–' .. season[input.month2]; -- season–season year range
end
end
end
tCOinS_date.rftdate = date;
return; -- done
end
if 0 ~= input.day then
date = string.format ('%s-%.2d-%.2d', input.year, tonumber(input.month), tonumber(input.day)); -- whole date
elseif 0 ~= input.month then
date = string.format ('%s-%.2d', input.year, tonumber(input.month)); -- year and month
else
date = string.format ('%s', input.year); -- just year
end
if 0 ~= input.year2 then
if 0 ~= input.day2 then
date2 = string.format ('/%s-%.2d-%.2d', input.year2, tonumber(input.month2), tonumber(input.day2)); -- whole date
elseif 0 ~= input.month2 then
date2 = string.format ('/%s-%.2d', input.year2, tonumber(input.month2)); -- year and month
else
date2 = string.format ('/%s', input.year2); -- just year
end
end
tCOinS_date.rftdate = date .. date2; -- date2 has the '/' separator
return;
end
--[[--------------------------< P A T T E R N S >--------------------------------------------------------------
this is the list of patterns for date formats that this module recognizes. Approximately the first half of these
patterns represent formats that might be reformatted into another format. Those that might be reformatted have
'indicator' letters that identify the content of the matching capture: 'd' (day), 'm' (month), 'a' (anchor year),
'y' (year); second day, month, year have a '2' suffix.
These patterns are used for both date validation and for reformatting. This table should not be moved to ~/Configuration
because changes to this table require changes to check_date() and to reformatter() and reformat_date()
]]
local patterns = {
-- year-initial numerical year-month-day
['ymd'] = {'^(%d%d%d%d)%-(%d%d)%-(%d%d)$', 'y', 'm', 'd'},
-- month-initial: month day, year
['Mdy'] = {'^(%D-) +([1-9]%d?), +((%d%d%d%d?)%a?)$', 'm', 'd', 'a', 'y'},
-- month-initial day range: month day–day, year; days are separated by endash
['Md-dy'] = {'^(%D-) +([1-9]%d?)[%-–]([1-9]%d?), +((%d%d%d%d)%a?)$', 'm', 'd', 'd2', 'a', 'y'},
-- day-initial: day month year
['dMy'] = {'^([1-9]%d?) +(%D-) +((%d%d%d%d?)%a?)$', 'd', 'm', 'a', 'y'},
-- year-initial: year month day; day: 1 or 2 two digits, leading zero allowed; not supported at en.wiki
-- ['yMd'] = {'^((%d%d%d%d?)%a?) +(%D-) +(%d%d?)$', 'a', 'y', 'm', 'd'},
-- day-range-initial: day–day month year; days are separated by endash
['d-dMy'] = {'^([1-9]%d?)[%-–]([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'd2', 'm', 'a', 'y'},
-- day initial month-day-range: day month - day month year; uses spaced endash
['dM-dMy'] = {'^([1-9]%d?) +(%D-) +[%-–] +([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'm', 'd2', 'm2', 'a', 'y'},
-- month initial month-day-range: month day – month day, year; uses spaced endash
['Md-Mdy'] = {'^(%D-) +([1-9]%d?) +[%-–] +(%D-) +([1-9]%d?), +((%d%d%d%d)%a?)$','m', 'd', 'm2', 'd2', 'a', 'y'},
-- day initial month-day-year-range: day month year - day month year; uses spaced endash
['dMy-dMy'] = {'^([1-9]%d?) +(%D-) +(%d%d%d%d) +[%-–] +([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'm', 'y', 'd2', 'm2', 'a', 'y2'},
-- month initial month-day-year-range: month day, year – month day, year; uses spaced endash
['Mdy-Mdy'] = {'^(%D-) +([1-9]%d?), +(%d%d%d%d) +[%-–] +(%D-) +([1-9]%d?), +((%d%d%d%d)%a?)$', 'm', 'd', 'y', 'm2', 'd2', 'a', 'y2'},
-- these date formats cannot be converted, per se, but month name can be rendered short or long
-- month/season year - month/season year; separated by spaced endash
['My-My'] = {'^(%D-) +(%d%d%d%d) +[%-–] +(%D-) +((%d%d%d%d)%a?)$', 'm', 'y', 'm2', 'a', 'y2'},
-- month/season range year; months separated by endash
['M-My'] = {'^(%D-)[%-–](%D-) +((%d%d%d%d)%a?)$', 'm', 'm2', 'a', 'y'},
-- month/season year or proper-name year; quarter year when First Quarter YYYY etc.
['My'] = {'^([^%d–]-) +((%d%d%d%d)%a?)$', 'm', 'a', 'y'}, -- this way because endash is a member of %D; %D- will match January–March 2019 when it shouldn't
-- these date formats cannot be converted
['Sy4-y2'] = {'^(%D-) +((%d%d)%d%d)[%-–]((%d%d)%a?)$'}, -- special case Winter/Summer year-year (YYYY-YY); year separated with unspaced endash
['Sy-y'] = {'^(%D-) +(%d%d%d%d)[%-–]((%d%d%d%d)%a?)$'}, -- special case Winter/Summer year-year; year separated with unspaced endash
['y-y'] = {'^(%d%d%d%d?)[%-–]((%d%d%d%d?)%a?)$'}, -- year range: YYY-YYY or YYY-YYYY or YYYY–YYYY; separated by unspaced endash; 100-9999
['y4-y2'] = {'^((%d%d)%d%d)[%-–]((%d%d)%a?)$'}, -- year range: YYYY–YY; separated by unspaced endash
['y'] = {'^((%d%d%d%d?)%a?)$'}, -- year; here accept either YYY or YYYY
}
--[[--------------------------< I S _ V A L I D _ E M B A R G O _ D A T E >------------------------------------
returns true and date value if that value has proper dmy, mdy, ymd format.
returns false and 9999 (embargoed forever) when date value is not proper format; assumes that when |pmc-embargo-date= is
set, the editor intended to embargo a PMC but |pmc-embargo-date= does not hold a single date.
]]
local function is_valid_embargo_date (v)
if v:match (patterns['ymd'][1]) or -- ymd
v:match (patterns['Mdy'][1]) or -- dmy
v:match (patterns['dMy'][1]) then -- mdy
return true, v;
end
return false, '9999'; -- if here not good date so return false and set embargo date to long time in future
end
--[[--------------------------< C H E C K _ D A T E >----------------------------------------------------------
Check date format to see that it is one of the formats approved by WP:DATESNO or WP:DATERANGE. Exception: only
allowed range separator is endash. Additionally, check the date to see that it is a real date: no 31 in 30-day
months; no 29 February when not a leap year. Months, both long-form and three character abbreviations, and seasons
must be spelled correctly. Future years beyond next year are not allowed.
If the date fails the format tests, this function returns false and does not return values for anchor_year and
COinS_date. When this happens, the date parameter is (DEBUG: not?) used in the COinS metadata and the CITEREF identifier gets
its year from the year parameter if present otherwise CITEREF does not get a date value.
Inputs:
date_string - date string from date-holding parameters (date, year, publication-date, access-date, pmc-embargo-date, archive-date, lay-date)
Returns:
false if date string is not a real date; else
true, anchor_year, COinS_date
anchor_year can be used in CITEREF anchors
COinS_date is ISO 8601 format date; see make_COInS_date()
]]
local function check_date (date_string, param, tCOinS_date)
local year; -- assume that year2, months, and days are not used;
local year2 = 0; -- second year in a year range
local month = 0;
local month2 = 0; -- second month in a month range
local day = 0;
local day2 = 0; -- second day in a day range
local anchor_year;
local coins_date;
if date_string:match (patterns['ymd'][1]) then -- year-initial numerical year month day format
year, month, day = date_string:match (patterns['ymd'][1]);
if 12 < tonumber(month) or 1 > tonumber(month) or 1582 > tonumber(year) or 0 == tonumber(day) then return false; end -- month or day number not valid or not Gregorian calendar
anchor_year = year;
elseif mw.ustring.match(date_string, patterns['Mdy'][1]) then -- month-initial: month day, year
month, day, anchor_year, year = mw.ustring.match(date_string, patterns['Mdy'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
elseif mw.ustring.match(date_string, patterns['Md-dy'][1]) then -- month-initial day range: month day–day, year; days are separated by endash
month, day, day2, anchor_year, year = mw.ustring.match(date_string, patterns['Md-dy'][1]);
if tonumber(day) >= tonumber(day2) then return false; end -- date range order is left to right: earlier to later; dates may not be the same;
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
month2=month; -- for metadata
year2 = year;
elseif mw.ustring.match(date_string, patterns['dMy'][1]) then -- day-initial: day month year
day, month, anchor_year, year = mw.ustring.match(date_string, patterns['dMy'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
--[[ NOT supported at en.wiki
elseif mw.ustring.match(date_string, patterns['yMd'][1]) then -- year-initial: year month day; day: 1 or 2 two digits, leading zero allowed
anchor_year, year, month, day = mw.ustring.match(date_string, patterns['yMd'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
-- end NOT supported at en.wiki ]]
elseif mw.ustring.match(date_string, patterns['d-dMy'][1]) then -- day-range-initial: day–day month year; days are separated by endash
day, day2, month, anchor_year, year = mw.ustring.match(date_string, patterns['d-dMy'][1]);
if tonumber(day) >= tonumber(day2) then return false; end -- date range order is left to right: earlier to later; dates may not be the same;
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
month2 = month; -- for metadata
year2 = year;
elseif mw.ustring.match(date_string, patterns['dM-dMy'][1]) then -- day initial month-day-range: day month - day month year; uses spaced endash
day, month, day2, month2, anchor_year, year = mw.ustring.match(date_string, patterns['dM-dMy'][1]);
if (not is_valid_month_season_range(month, month2)) or not is_valid_year(year) then return false; end -- date range order is left to right: earlier to later;
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
year2 = year;
elseif mw.ustring.match(date_string, patterns['Md-Mdy'][1]) then -- month initial month-day-range: month day – month day, year; uses spaced endash
month, day, month2, day2, anchor_year, year = mw.ustring.match(date_string, patterns['Md-Mdy'][1]);
if (not is_valid_month_season_range(month, month2, param)) or not is_valid_year(year) then return false; end
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
year2 = year;
elseif mw.ustring.match(date_string, patterns['dMy-dMy'][1]) then -- day initial month-day-year-range: day month year - day month year; uses spaced endash
day, month, year, day2, month2, anchor_year, year2 = mw.ustring.match(date_string, patterns['dMy-dMy'][1]);
if tonumber(year2) <= tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) or not is_valid_month_range_style(month, month2) then return false; end -- year2 no more than one year in the future; months same style
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
if 0 == month or 0 == month2 then return false; end -- both must be valid
elseif mw.ustring.match(date_string, patterns['Mdy-Mdy'][1]) then -- month initial month-day-year-range: month day, year – month day, year; uses spaced endash
month, day, year, month2, day2, anchor_year, year2 = mw.ustring.match(date_string, patterns['Mdy-Mdy'][1]);
if tonumber(year2) <= tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) or not is_valid_month_range_style(month, month2) then return false; end -- year2 no more than one year in the future; months same style
month = get_month_number (month); -- for metadata
month2 = get_month_number(month2);
if 0 == month or 0 == month2 then return false; end -- both must be valid
elseif mw.ustring.match(date_string, patterns['Sy4-y2'][1]) then -- special case Winter/Summer year-year (YYYY-YY); year separated with unspaced endash
local century;
month, year, century, anchor_year, year2 = mw.ustring.match(date_string, patterns['Sy4-y2'][1]);
if 'Winter' ~= month and 'Summer' ~= month then return false end; -- 'month' can only be Winter or Summer
anchor_year = year .. '–' .. anchor_year; -- assemble anchor_year from both years
year2 = century..year2; -- add the century to year2 for comparisons
if 1 ~= tonumber(year2) - tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
month = get_season_number(month, param);
elseif mw.ustring.match(date_string, patterns['Sy-y'][1]) then -- special case Winter/Summer year-year; year separated with unspaced endash
month, year, anchor_year, year2 = mw.ustring.match(date_string, patterns['Sy-y'][1]);
month = get_season_number (month, param); -- <month> can only be winter or summer; also for metadata
if (month ~= cfg.date_names['en'].season['Winter']) and (month ~= cfg.date_names['en'].season['Summer']) then
return false; -- not Summer or Winter; abandon
end
anchor_year = year .. '–' .. anchor_year; -- assemble anchor_year from both years
if 1 ~= tonumber(year2) - tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match(date_string, patterns['My-My'][1]) then -- month/season year - month/season year; separated by spaced endash
month, year, month2, anchor_year, year2 = mw.ustring.match(date_string, patterns['My-My'][1]);
anchor_year = year .. '–' .. anchor_year; -- assemble anchor_year from both years
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
if 0 ~= get_month_number(month) and 0 ~= get_month_number(month2) and is_valid_month_range_style(month, month2) then -- both must be month year, same month style
month = get_month_number(month);
month2 = get_month_number(month2);
elseif 0 ~= get_season_number(month, param) and 0 ~= get_season_number(month2, param) then -- both must be season year, not mixed
month = get_season_number(month, param);
month2 = get_season_number(month2, param);
else
return false;
end
elseif mw.ustring.match(date_string, patterns['M-My'][1]) then -- month/season range year; months separated by endash
month, month2, anchor_year, year = mw.ustring.match(date_string, patterns['M-My'][1]);
if (not is_valid_month_season_range(month, month2, param)) or (not is_valid_year(year)) then return false; end
if 0 ~= get_month_number(month) then -- determined to be a valid range so just check this one to know if month or season
month = get_month_number(month);
month2 = get_month_number(month2);
if 0 == month or 0 == month2 then return false; end
else
month = get_season_number(month, param);
month2 = get_season_number(month2, param);
end
year2 = year;
elseif mw.ustring.match(date_string, patterns['My'][1]) then -- month/season/quarter/proper-name year
month, anchor_year, year = mw.ustring.match(date_string, patterns['My'][1]);
if not is_valid_year(year) then return false; end
month = get_element_number(month, param); -- get month season quarter proper-name number or nil
if not month then return false; end -- not valid whatever it is
elseif mw.ustring.match(date_string, patterns['y-y'][1]) then -- Year range: YYY-YYY or YYY-YYYY or YYYY–YYYY; separated by unspaced endash; 100-9999
year, anchor_year, year2 = mw.ustring.match(date_string, patterns['y-y'][1]);
anchor_year = year .. '–' .. anchor_year; -- assemble anchor year from both years
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match(date_string, patterns['y4-y2'][1]) then -- Year range: YYYY–YY; separated by unspaced endash
local century;
year, century, anchor_year, year2 = mw.ustring.match(date_string, patterns['y4-y2'][1]);
anchor_year = year .. '–' .. anchor_year; -- assemble anchor year from both years
if in_array (param, {'date', 'publication-date', 'year'}) then
add_prop_cat ('year-range-abbreviated');
end
if 13 > tonumber(year2) then return false; end -- don't allow 2003-05 which might be May 2003
year2 = century .. year2; -- add the century to year2 for comparisons
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match(date_string, patterns['y'][1]) then -- year; here accept either YYY or YYYY
anchor_year, year = mw.ustring.match(date_string, patterns['y'][1]);
if false == is_valid_year(year) then
return false;
end
else
return false; -- date format not one of the MOS:DATE approved formats
end
if param ~= 'date' then -- CITEREF disambiguation only allowed in |date=; |year= & |publication-date= promote to date
if anchor_year:match ('%l$') then
return false;
end
end
if 'access-date' == param then -- test accessdate here because we have numerical date parts
if 0 ~= year and 0 ~= month and 0 ~= day and -- all parts of a single date required
0 == year2 and 0 == month2 and 0 == day2 then -- none of these; accessdate must not be a range
if not is_valid_accessdate(year .. '-' .. month .. '-' .. day) then
return false; -- return false when accessdate out of bounds
end
else
return false; -- return false when accessdate is a range of two dates
end
end
local result=true; -- check whole dates for validity; assume true because not all dates will go through this test
if 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 == day2 then -- YMD (simple whole date)
result = is_valid_date (year, month, day, param); -- <param> for |pmc-embargo-date=
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 ~= day2 then -- YMD-d (day range)
result = is_valid_date (year, month, day);
result = result and is_valid_date (year, month, day2);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 ~= month2 and 0 ~= day2 then -- YMD-md (day month range)
result = is_valid_date (year, month, day);
result = result and is_valid_date (year, month2, day2);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 ~= year2 and 0 ~= month2 and 0 ~= day2 then -- YMD-ymd (day month year range)
result = is_valid_date(year, month, day);
result = result and is_valid_date(year2, month2, day2);
end
if false == result then return false; end
if nil ~= tCOinS_date then -- this table only passed into this function when testing |date= parameter values
make_COinS_date ({year = year, month = month, day = day, year2 = year2, month2 = month2, day2 = day2}, tCOinS_date); -- make an ISO 8601 date string for COinS
end
return true, anchor_year; -- format is good and date string represents a real date
end
--[[--------------------------< D A T E S >--------------------------------------------------------------------
Cycle the date-holding parameters in passed table date_parameters_list through check_date() to check compliance with MOS:DATE. For all valid dates, check_date() returns
true. The |date= parameter test is unique, it is the only date holding parameter from which values for anchor_year (used in CITEREF identifiers) and COinS_date (used in
the COinS metadata) are derived. The |date= parameter is the only date-holding parameter that is allowed to contain the no-date keywords "n.d." or "nd" (without quotes).
Unlike most error messages created in this module, only one error message is created by this function. Because all of the date holding parameters are processed serially,
parameters with errors are added to the <error_list> sequence table as the dates are tested.
]]
local function dates(date_parameters_list, tCOinS_date, error_list)
local anchor_year; -- will return as nil if the date being tested is not |date=
local COinS_date; -- will return as nil if the date being tested is not |date=
local embargo_date; -- if embargo date is a good dmy, mdy, ymd date then holds original value else reset to 9999
local good_date = false;
for k, v in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set(v.val) then -- if the parameter has a value
v.val = mw.ustring.gsub(v.val, '%d', cfg.date_names.local_digits); -- translate 'local' digits to Western 0-9
if v.val:match("^c%. [1-9]%d%d%d?%a?$") then -- special case for c. year or with or without CITEREF disambiguator - only |date= and |year=
local year = v.val:match("c%. ([1-9]%d%d%d?)%a?"); -- get the year portion so it can be tested
if 'date' == k then
anchor_year, COinS_date = v.val:match("((c%. [1-9]%d%d%d?)%a?)"); -- anchor year and COinS_date only from |date= parameter
good_date = is_valid_year(year);
elseif 'year' == k then
good_date = is_valid_year(year);
end
elseif 'date' == k then -- if the parameter is |date=
if v.val:match("^n%.d%.%a?$") then -- ToDo: I18N -- if |date=n.d. with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((n%.d%.)%a?)"); -- ToDo: I18N -- "n.d."; no error when date parameter is set to no date
elseif v.val:match("^nd%a?$") then -- ToDo: I18N -- if |date=nd with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((nd)%a?)"); -- ToDo: I18N -- "nd"; no error when date parameter is set to no date
else
good_date, anchor_year, COinS_date = check_date (v.val, k, tCOinS_date); -- go test the date
end
elseif 'year' == k then -- if the parameter is |year= it should hold only a year value
if v.val:match("^[1-9]%d%d%d?%a?$") then -- if |year = 3 or 4 digits only with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((%d+)%a?)");
end
elseif 'pmc-embargo-date' == k then -- if the parameter is |pmc-embargo-date=
good_date = check_date (v.val, k); -- go test the date
if true == good_date then -- if the date is a valid date
good_date, embargo_date = is_valid_embargo_date (v.val); -- is |pmc-embargo-date= date a single dmy, mdy, or ymd formatted date? yes: returns embargo date; no: returns 9999
end
else -- any other date-holding parameter
good_date = check_date (v.val, k); -- go test the date
end
if false == good_date then -- assemble one error message so we don't add the tracking category multiple times
table.insert (error_list, wrap_style ('parameter', v.name)); -- make parameter name suitable for error message list
end
end
end
return anchor_year, embargo_date; -- and done
end
--[[--------------------------< Y E A R _ D A T E _ C H E C K >------------------------------------------------
Compare the value provided in |year= with the year value(s) provided in |date=. This function sets a local numeric value:
0 - year value does not match the year value in date
1 - (default) year value matches the year value in date or one of the year values when date contains two years
2 - year value matches the year value in date when date is in the form YYYY-MM-DD and year is disambiguated (|year=YYYYx)
the numeric value in <result> determines the 'output' if any from this function:
0 – adds error message to error_list sequence table
1 – adds maint cat
2 – does nothing
]]
local function year_date_check (year_string, year_origin, date_string, date_origin, error_list)
local year;
local date1;
local date2;
local result = 1; -- result of the test; assume that the test passes
year = year_string:match ('(%d%d%d%d?)');
if date_string:match ('%d%d%d%d%-%d%d%-%d%d') and year_string:match ('%d%d%d%d%a') then --special case where both date and year are required YYYY-MM-DD and YYYYx
date1 = date_string:match ('(%d%d%d%d)');
year = year_string:match ('(%d%d%d%d)');
if year ~= date1 then
result = 0; -- years don't match
else
result = 2; -- years match; but because disambiguated, don't add to maint cat
end
elseif date_string:match ("%d%d%d%d?.-%d%d%d%d?") then -- any of the standard range formats of date with two three- or four-digit years
date1, date2 = date_string:match ("(%d%d%d%d?).-(%d%d%d%d?)");
if year ~= date1 and year ~= date2 then
result = 0;
end
elseif mw.ustring.match(date_string, "%d%d%d%d[%-–]%d%d") then -- YYYY-YY date ranges
local century;
date1, century, date2 = mw.ustring.match(date_string, "((%d%d)%d%d)[%-–]+(%d%d)");
date2 = century..date2; -- convert YY to YYYY
if year ~= date1 and year ~= date2 then
result = 0;
end
elseif date_string:match ("%d%d%d%d?") then -- any of the standard formats of date with one year
date1 = date_string:match ("(%d%d%d%d?)");
if year ~= date1 then
result = 0;
end
else -- should never get here; this function called only when no other date errors
result = 0; -- no recognizable year in date
end
if 0 == result then -- year / date mismatch
table.insert (error_list, substitute (cfg.messages['mismatch'], {year_origin, date_origin})); -- add error message to error_list sequence table
elseif 1 == result then -- redundant year / date
set_message ('maint_date_year'); -- add a maint cat
end
end
--[[--------------------------< R E F O R M A T T E R >--------------------------------------------------------
reformat 'date' into new format specified by format_param if pattern_idx (the current format of 'date') can be
reformatted. Does the grunt work for reformat_dates().
The table re_formats maps pattern_idx (current format) and format_param (desired format) to a table that holds:
format string used by string.format()
identifier letters ('d', 'm', 'y', 'd2', 'm2', 'y2') that serve as indexes into a table t{} that holds captures
from mw.ustring.match() for the various date parts specified by patterns[pattern_idx][1]
Items in patterns{} have the general form:
['ymd'] = {'^(%d%d%d%d)%-(%d%d)%-(%d%d)$', 'y', 'm', 'd'}, where:
['ymd'] is pattern_idx
patterns['ymd'][1] is the match pattern with captures for mw.ustring.match()
patterns['ymd'][2] is an indicator letter identifying the content of the first capture
patterns['ymd'][3] ... the second capture etc.
when a pattern matches a date, the captures are loaded into table t{} in capture order using the idemtifier
characters as indexes into t{} For the above, a ymd date is in t{} as:
t.y = first capture (year), t.m = second capture (month), t.d = third capture (day)
To reformat, this function is called with the pattern_idx that matches the current format of the date and with
format_param set to the desired format. This function loads table t{} as described and then calls string.format()
with the format string specified by re_format[pattern_idx][format_param][1] using values taken from t{} according
to the capture identifier letters specified by patterns[pattern_idx][format_param][n] where n is 2..
]]
local re_formats = {
['ymd'] = { -- date format is ymd; reformat to:
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['Mdy'] = { -- date format is Mdy; reformat to:
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- for long/short reformatting
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['dMy'] = { -- date format is dMy; reformat to:
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['Md-dy'] = { -- date format is Md-dy; reformat to:
['mdy'] = {'%s %s–%s, %s', 'm', 'd', 'd2', 'y'}, -- for long/short reformatting
['dmy'] = {'%s–%s %s %s', 'd', 'd2', 'm', 'y'}, -- |df=dmy -> d-dMy
},
['d-dMy'] = { -- date format is d-d>y; reformat to:
['dmy'] = {'%s–%s %s %s', 'd', 'd2', 'm', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s–%s, %s', 'm', 'd', 'd2', 'y'}, -- |df=mdy -> Md-dy
},
['dM-dMy'] = { -- date format is dM-dMy; reformat to:
['dmy'] = {'%s %s – %s %s %s', 'd', 'm', 'd2', 'm2', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s – %s %s, %s', 'm', 'd', 'm2', 'd2', 'y'}, -- |df=mdy -> Md-Mdy
},
['Md-Mdy'] = { -- date format is Md-Mdy; reformat to:
['mdy'] = {'%s %s – %s %s, %s', 'm', 'd', 'm2', 'd2', 'y'}, -- for long/short reformatting
['dmy'] = {'%s %s – %s %s %s', 'd', 'm', 'd2', 'm2', 'y'}, -- |df=dmy -> dM-dMy
},
['dMy-dMy'] = { -- date format is dMy-dMy; reformat to:
['dmy'] = {'%s %s %s – %s %s %s', 'd', 'm', 'y', 'd2', 'm2', 'y2'}, -- for long/short reformatting
['mdy'] = {'%s %s, %s – %s %s, %s', 'm', 'd', 'y', 'm2', 'd2', 'y2'}, -- |df=mdy -> Mdy-Mdy
},
['Mdy-Mdy'] = { -- date format is Mdy-Mdy; reformat to:
['mdy'] = {'%s %s, %s – %s %s, %s', 'm', 'd', 'y', 'm2', 'd2', 'y2'}, -- for long/short reformatting
['dmy'] = {'%s %s %s – %s %s %s', 'd', 'm', 'y', 'd2', 'm2', 'y2'}, -- |df=dmy -> dMy-dMy
},
['My-My'] = { -- these for long/short reformatting
['any'] = {'%s %s – %s %s', 'm', 'y', 'm2', 'y2'}, -- dmy/mdy agnostic
},
['M-My'] = { -- these for long/short reformatting
['any'] = {'%s–%s %s', 'm', 'm2', 'y'}, -- dmy/mdy agnostic
},
['My'] = { -- these for long/short reformatting
['any'] = {'%s %s', 'm', 'y'}, -- dmy/mdy agnostic
},
-- ['yMd'] = { -- not supported at en.wiki
-- ['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
-- ['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
-- ['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- },
}
local function reformatter (date, pattern_idx, format_param, mon_len)
if not in_array (pattern_idx, {'ymd', 'Mdy', 'Md-dy', 'dMy', 'yMd', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy', 'My-My', 'M-My', 'My'}) then
return; -- not in this set of date format patterns then not a reformattable date
end
if 'ymd' == format_param and in_array (pattern_idx, {'ymd', 'Md-dy', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy', 'My-My', 'M-My', 'My'}) then
return; -- ymd date ranges not supported at en.wiki; no point in reformatting ymd to ymd
end
if in_array (pattern_idx, {'My', 'M-My', 'My-My'}) then -- these are not dmy/mdy so can't be 'reformatted' into either
format_param = 'any'; -- so format-agnostic
end
-- yMd is not supported at en.wiki; when yMd is supported at your wiki, uncomment the next line
-- if 'yMd' == format_param and in_array (pattern_idx, {'yMd', 'Md-dy', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy'}) then -- these formats not convertable; yMd not supported at en.wiki
if 'yMd' == format_param then -- yMd not supported at en.wiki; when yMd is supported at your wiki, remove or comment-out this line
return; -- not a reformattable date
end
local c1, c2, c3, c4, c5, c6, c7; -- these hold the captures specified in patterns[pattern_idx][1]
c1, c2, c3, c4, c5, c6, c7 = mw.ustring.match (date, patterns[pattern_idx][1]); -- get the captures
local t = { -- table that holds k/v pairs of date parts from the captures and patterns[pattern_idx][2..]
[patterns[pattern_idx][2]] = c1; -- at minimum there is always one capture with a matching indicator letter
[patterns[pattern_idx][3] or 'x'] = c2; -- patterns can have a variable number of captures; each capture requires an indicator letter;
[patterns[pattern_idx][4] or 'x'] = c3; -- where there is no capture, there is no indicator letter so n in patterns[pattern_idx][n] will be nil;
[patterns[pattern_idx][5] or 'x'] = c4; -- the 'x' here spoofs an indicator letter to prevent 'table index is nil' error
[patterns[pattern_idx][6] or 'x'] = c5;
[patterns[pattern_idx][7] or 'x'] = c6;
[patterns[pattern_idx][8] or 'x'] = c7;
};
if t.a then -- if this date has an anchor year capture (all convertable date formats except ymd)
if t.y2 then -- for year range date formats
t.y2 = t.a; -- use the anchor year capture when reassembling the date
else -- here for single date formats (except ymd)
t.y = t.a; -- use the anchor year capture when reassembling the date
end
end
if tonumber(t.m) then -- if raw month is a number (converting from ymd)
if 's' == mon_len then -- if we are to use abbreviated month names
t.m = cfg.date_names['inv_local_short'][tonumber(t.m)]; -- convert it to a month name
else
t.m = cfg.date_names['inv_local_long'][tonumber(t.m)]; -- convert it to a month name
end
t.d = t.d:gsub ('0(%d)', '%1'); -- strip leading '0' from day if present
elseif 'ymd' == format_param then -- when converting to ymd
t.y = t.y:gsub ('%a', ''); -- strip CITREF disambiguator if present; anchor year already known so process can proceed; TODO: maint message?
if 1582 > tonumber (t.y) then -- ymd format dates not allowed before 1582
return;
end
t.m = string.format ('%02d', get_month_number (t.m)); -- make sure that month and day are two digits
t.d = string.format ('%02d', t.d);
elseif mon_len then -- if mon_len is set to either 'short' or 'long'
for _, mon in ipairs ({'m', 'm2'}) do -- because there can be two month names, check both
if t[mon] then
t[mon] = get_month_number (t[mon]); -- get the month number for this month (is length agnostic)
if 0 == t[mon] then return; end -- seasons and named dates can't be converted
t[mon] = (('s' == mon_len) and cfg.date_names['inv_local_short'][t[mon]]) or cfg.date_names['inv_local_long'][t[mon]]; -- fetch month name according to length
end
end
end
local new_date = string.format (re_formats[pattern_idx][format_param][1], -- format string
t[re_formats[pattern_idx][format_param][2]], -- named captures from t{}
t[re_formats[pattern_idx][format_param][3]],
t[re_formats[pattern_idx][format_param][4]],
t[re_formats[pattern_idx][format_param][5]],
t[re_formats[pattern_idx][format_param][6]],
t[re_formats[pattern_idx][format_param][7]],
t[re_formats[pattern_idx][format_param][8]]
);
return new_date;
end
--[[-------------------------< R E F O R M A T _ D A T E S >--------------------------------------------------
Reformats existing dates into the format specified by format.
format is one of several manual keywords: dmy, dmy-all, mdy, mdy-all, ymd, ymd-all. The -all version includes
access- and archive-dates; otherwise these dates are not reformatted.
This function allows automatic date formatting. In ~/Configuration, the article source is searched for one of
the {{use xxx dates}} templates. If found, xxx becomes the global date format as xxx-all. If |cs1-dates= in
{{use xxx dates}} has legitimate value then that value determines how cs1|2 dates will be rendered. Legitimate
values for |cs1-dates= are:
l - all dates are rendered with long month names
ls - publication dates use long month names; access-/archive-dates use abbreviated month names
ly - publication dates use long month names; access-/archive-dates rendered in ymd format
s - all dates are rendered with abbreviated (short) month names
sy - publication dates use abbreviated month names; access-/archive-dates rendered in ymd format
y - all dates are rendered in ymd format
the format argument for automatic date formatting will be the format specified by {{use xxx dates}} with the
value supplied by |cs1-dates so one of: xxx-l, xxx-ls, xxx-ly, xxx-s, xxx-sy, xxx-y, or simply xxx (|cs1-dates=
empty, omitted, or invalid) where xxx shall be either of dmy or mdy.
dates are extracted from date_parameters_list, reformatted (if appropriate), and then written back into the
list in the new format. Dates in date_parameters_list are presumed here to be valid (no errors). This function
returns true when a date has been reformatted, false else. Actual reformatting is done by reformatter().
]]
local function reformat_dates (date_parameters_list, format)
local all = false; -- set to false to skip access- and archive-dates
local len_p = 'l'; -- default publication date length shall be long
local len_a = 'l'; -- default access-/archive-date length shall be long
local result = false;
local new_date;
if format:match('%a+%-all') then -- manual df keyword; auto df keyword when length not specified in {{use xxx dates}};
format = format:match('(%a+)%-all'); -- extract the format
all = true; -- all dates are long format dates because this keyword doesn't specify length
elseif format:match('%a+%-[lsy][sy]?') then -- auto df keywords; internal only
all = true; -- auto df applies to all dates; use length specified by capture len_p for all dates
format, len_p, len_a = format:match('(%a+)%-([lsy])([sy]?)'); -- extract the format and length keywords
if 'y' == len_p then -- because allowed by MOS:DATEUNIFY (sort of) range dates and My dates not reformatted
format = 'ymd'; -- override {{use xxx dates}}
elseif (not is_set(len_a)) or (len_p == len_a) then -- no access-/archive-date length specified or same length as publication dates then
len_a = len_p; -- in case len_a not set
end
end -- else only publication dates and they are long
for param_name, param_val in pairs (date_parameters_list) do -- for each date-holding parameter in the list
if is_set (param_val.val) then -- if the parameter has a value
if not (not all and in_array (param_name, {'access-date', 'archive-date'})) then -- skip access- or archive-date unless format is xxx-all; yeah, ugly; TODO: find a better way
for pattern_idx, pattern in pairs (patterns) do
if mw.ustring.match (param_val.val, pattern[1]) then
if all and in_array (param_name, {'access-date', 'archive-date'}) then -- if this date is an access- or archive-date
new_date = reformatter (param_val.val, pattern_idx, (('y' == len_a) and 'ymd') or format, len_a); -- choose ymd or dmy/mdy according to len_a setting
else -- all other dates
new_date = reformatter (param_val.val, pattern_idx, format, len_p);
end
if new_date then -- set when date was reformatted
date_parameters_list[param_name].val = new_date; -- update date in date list
result = true; -- and announce that changes have been made
end
end -- if
end -- for
end -- if
end -- if
end -- for
return result; -- declare boolean result and done
end
--[[--------------------------< D A T E _ H Y P H E N _ T O _ D A S H >----------------------------------------
Loops through the list of date-holding parameters and converts any hyphen to an ndash. Not called if the cs1|2
template has any date errors.
Modifies the date_parameters_list and returns true if hyphens are replaced, else returns false.
]]
local function date_hyphen_to_dash (date_parameters_list)
local result = false;
local n;
for param_name, param_val in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set (param_val.val) and
not mw.ustring.match (param_val.val, patterns.ymd[1]) then -- for those that are not ymd dates (ustring because here digits may not be Western)
param_val.val, n = param_val.val:gsub ('%-', '–'); -- replace any hyphen with ndash
if 0 ~= n then
date_parameters_list[param_name].val = param_val.val; -- update the list
result = true;
end
end
end
return result; -- so we know if any hyphens were replaced
end
--[[-------------------------< D A T E _ N A M E _ X L A T E >------------------------------------------------
Attempts to translate English date names to local-language date names using names supplied by MediaWiki's
date parser function. This is simple name-for-name replacement and may not work for all languages.
if xlat_dig is true, this function will also translate Western (English) digits to the local language's digits.
This will also translate ymd dates.
]]
local function date_name_xlate (date_parameters_list, xlt_dig)
local xlate;
local mode; -- long or short month names
local modified = false;
local date;
local sources_t = {
{cfg.date_names.en.long, cfg.date_names.inv_local_long}, -- for translating long English month names to long local month names
{cfg.date_names.en.short, cfg.date_names.inv_local_short}, -- short month names
{cfg.date_names.en.quarter, cfg.date_names.inv_local_quarter}, -- quarter date names
{cfg.date_names.en.season, cfg.date_names.inv_local_season}, -- season date nam
{cfg.date_names.en.named, cfg.date_names.inv_local_named}, -- named dates
}
local function is_xlateable (month) -- local function to get local date name that replaces existing English-language date name
for _, date_names_t in ipairs (sources_t) do -- for each sequence table in date_names_t
if date_names_t[1][month] then -- if date name is English month (long or short), quarter, season or named and
if date_names_t[2][date_names_t[1][month]] then -- if there is a matching local date name
return date_names_t[2][date_names_t[1][month]]; -- return the local date name
end
end
end
end
for param_name, param_val in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set(param_val.val) then -- if the parameter has a value
date = param_val.val;
for month in mw.ustring.gmatch (date, '[%a ]+') do -- iterate through all date names in the date (single date or date range)
month = mw.text.trim (month); -- this because quarterly dates contain whitespace
xlate = is_xlateable (month); -- get translate <month>; returns translation or nil
if xlate then
date = mw.ustring.gsub (date, month, xlate); -- replace the English with the translation
date_parameters_list[param_name].val = date; -- save the translated date
modified = true;
end
end
if xlt_dig then -- shall we also translate digits?
date = date:gsub ('%d', cfg.date_names.xlate_digits); -- translate digits from Western to 'local digits'
date_parameters_list[param_name].val = date; -- save the translated date
modified = true;
end
end
end
return modified;
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
add_prop_cat = utilities_page_ptr.add_prop_cat ; -- import functions from selected Module:Citation/CS1/Utilities module
is_set = utilities_page_ptr.is_set;
in_array = utilities_page_ptr.in_array;
set_message = utilities_page_ptr.set_message;
substitute = utilities_page_ptr.substitute;
wrap_style = utilities_page_ptr.wrap_style;
cfg = cfg_table_ptr; -- import tables from selected Module:Citation/CS1/Configuration
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return { -- return exported functions
dates = dates,
year_date_check = year_date_check,
reformat_dates = reformat_dates,
date_hyphen_to_dash = date_hyphen_to_dash,
date_name_xlate = date_name_xlate,
set_selected_modules = set_selected_modules
}
46ec997eed12f96ed5a030aee3a4264622c84955
Module:Citation/CS1/Whitelist
828
113
234
2023-01-14T14:43:42Z
wikipedia>Trappist the monk
0
sync from sandbox;
Scribunto
text/plain
--[[--------------------------< S U P P O R T E D P A R A M E T E R S >--------------------------------------
Because a steady-state signal conveys no useful information, whitelist.basic_arguments[] list items can have three values:
true - these parameters are valid and supported parameters
false - these parameters are deprecated but still supported
tracked - these parameters are valid and supported parameters tracked in an eponymous properties category
nil - these parameters are no longer supported. remove entirely
]]
local basic_arguments = {
['accessdate'] = true,
['access-date'] = true,
['agency'] = true,
['archivedate'] = true,
['archive-date'] = true,
['archive-format'] = true,
['archiveurl'] = true,
['archive-url'] = true,
['article'] = true,
['article-format'] = true,
['article-number'] = true, -- {{cite journal}}, {{cite conference}}; {{citation}} when |journal= has a value
['article-url'] = true,
['article-url-access'] = true,
['arxiv'] = true, -- cite arxiv; here because allowed in cite ... as identifier
['asin'] = true,
['ASIN'] = true,
['asin-tld'] = true,
['at'] = true,
['author'] = true,
['author-first'] = true,
['author-given'] = true,
['author-last'] = true,
['author-surname'] = true,
['authorlink'] = true,
['author-link'] = true,
['author-mask'] = true,
['authors'] = true,
['bibcode'] = true,
['bibcode-access'] = true,
['biorxiv'] = true, -- cite biorxiv; here because allowed in cite ... as identifier
['chapter'] = true,
['chapter-format'] = true,
['chapter-url'] = true,
['chapter-url-access'] = true,
['citeseerx'] = true, -- cite citeseerx; here because allowed in cite ... as identifier
['collaboration'] = true,
['contribution'] = true,
['contribution-format'] = true,
['contribution-url'] = true,
['contribution-url-access'] = true,
['contributor'] = true,
['contributor-first'] = true,
['contributor-given'] = true,
['contributor-last'] = true,
['contributor-surname'] = true,
['contributor-link'] = true,
['contributor-mask'] = true,
['date'] = true,
['department'] = true,
['df'] = true,
['dictionary'] = true,
['display-authors'] = true,
['display-contributors'] = true,
['display-editors'] = true,
['display-interviewers'] = true,
['display-subjects'] = true,
['display-translators'] = true,
['doi'] = true,
['DOI'] = true,
['doi-access'] = true,
['doi-broken-date'] = true,
['edition'] = true,
['editor'] = true,
['editor-first'] = true,
['editor-given'] = true,
['editor-last'] = true,
['editor-surname'] = true,
['editor-link'] = true,
['editor-mask'] = true,
['eissn'] = true,
['EISSN'] = true,
['encyclopaedia'] = true,
['encyclopedia'] = true,
['entry'] = true,
['entry-format'] = true,
['entry-url'] = true,
['entry-url-access'] = true,
['eprint'] = true, -- cite arxiv; here because allowed in cite ... as identifier
['first'] = true,
['format'] = true,
['given'] = true,
['hdl'] = true,
['HDL'] = true,
['hdl-access'] = true,
['host'] = true, -- unique to certain templates?
['id'] = true,
['ID'] = true,
['institution'] = true, -- constrain to cite thesis?
['interviewer'] = true,
['interviewer-first'] = true,
['interviewer-given'] = true,
['interviewer-last'] = true,
['interviewer-surname'] = true,
['interviewer-link'] = true,
['interviewer-mask'] = true,
['isbn'] = true,
['ISBN'] = true,
['ismn'] = true,
['ISMN'] = true,
['issn'] = true,
['ISSN'] = true,
['issue'] = true,
['jfm'] = true,
['JFM'] = true,
['journal'] = true,
['jstor'] = true,
['JSTOR'] = true,
['jstor-access'] = true,
['lang'] = true,
['language'] = true,
['last'] = true,
['lay-date'] = false,
['lay-format'] = false,
['lay-source'] = false,
['lay-url'] = false,
['lccn'] = true,
['LCCN'] = true,
['location'] = true,
['magazine'] = true,
['medium'] = true,
['minutes'] = true, -- constrain to cite AV media and podcast?
['mode'] = true,
['mr'] = true,
['MR'] = true,
['name-list-style'] = true,
['newspaper'] = true,
['no-pp'] = true,
['no-tracking'] = true,
['number'] = true,
['oclc'] = true,
['OCLC'] = true,
['ol'] = true,
['OL'] = true,
['ol-access'] = true,
['orig-date'] = true,
['origyear'] = true,
['orig-year'] = true,
['osti'] = true,
['OSTI'] = true,
['osti-access'] = true,
['others'] = true,
['p'] = true,
['page'] = true,
['pages'] = true,
['people'] = true,
['periodical'] = true,
['place'] = true,
['pmc'] = true,
['PMC'] = true,
['pmc-embargo-date'] = true,
['pmid'] = true,
['PMID'] = true,
['postscript'] = true,
['pp'] = true,
['publication-date'] = true,
['publication-place'] = true,
['publisher'] = true,
['quotation'] = true,
['quote'] = true,
['quote-page'] = true,
['quote-pages'] = true,
['ref'] = true,
['rfc'] = true,
['RFC'] = true,
['sbn'] = true,
['SBN'] = true,
['scale'] = true,
['script-article'] = true,
['script-chapter'] = true,
['script-contribution'] = true,
['script-entry'] = true,
['script-journal'] = true,
['script-magazine'] = true,
['script-newspaper'] = true,
['script-periodical'] = true,
['script-quote'] = true,
['script-section'] = true,
['script-title'] = true,
['script-website'] = true,
['script-work'] = true,
['section'] = true,
['section-format'] = true,
['section-url'] = true,
['section-url-access'] = true,
['series'] = true,
['ssrn'] = true, -- cite ssrn; these three here because allowed in cite ... as identifier
['SSRN'] = true,
['ssrn-access'] = true,
['subject'] = true,
['subject-link'] = true,
['subject-mask'] = true,
['surname'] = true,
['s2cid'] = true,
['S2CID'] = true,
['s2cid-access'] = true,
['template-doc-demo'] = true,
['time'] = true, -- constrain to cite av media and podcast?
['time-caption'] = true, -- constrain to cite av media and podcast?
['title'] = true,
['title-link'] = true,
['translator'] = true,
['translator-first'] = true,
['translator-given'] = true,
['translator-last'] = true,
['translator-surname'] = true,
['translator-link'] = true,
['translator-mask'] = true,
['trans-article'] = true,
['trans-chapter'] = true,
['trans-contribution'] = true,
['trans-entry'] = true,
['trans-journal'] = true,
['trans-magazine'] = true,
['trans-newspaper'] = true,
['trans-periodical'] = true,
['trans-quote'] = true,
['trans-section'] = true,
['trans-title'] = true,
['trans-website'] = true,
['trans-work'] = true,
['type'] = true,
['url'] = true,
['URL'] = true,
['url-access'] = true,
['url-status'] = true,
['vauthors'] = true,
['veditors'] = true,
['version'] = true,
['via'] = true,
['volume'] = true,
['website'] = true,
['work'] = true,
['year'] = true,
['zbl'] = true,
['ZBL'] = true,
}
local numbered_arguments = {
['author#'] = true,
['author-first#'] = true,
['author#-first'] = true,
['author-given#'] = true,
['author#-given'] = true,
['author-last#'] = true,
['author#-last'] = true,
['author-surname#'] = true,
['author#-surname'] = true,
['author-link#'] = true,
['author#-link'] = true,
['authorlink#'] = true,
['author#link'] = true,
['author-mask#'] = true,
['author#-mask'] = true,
['contributor#'] = true,
['contributor-first#'] = true,
['contributor#-first'] = true,
['contributor-given#'] = true,
['contributor#-given'] = true,
['contributor-last#'] = true,
['contributor#-last'] = true,
['contributor-surname#'] = true,
['contributor#-surname'] = true,
['contributor-link#'] = true,
['contributor#-link'] = true,
['contributor-mask#'] = true,
['contributor#-mask'] = true,
['editor#'] = true,
['editor-first#'] = true,
['editor#-first'] = true,
['editor-given#'] = true,
['editor#-given'] = true,
['editor-last#'] = true,
['editor#-last'] = true,
['editor-surname#'] = true,
['editor#-surname'] = true,
['editor-link#'] = true,
['editor#-link'] = true,
['editor-mask#'] = true,
['editor#-mask'] = true,
['first#'] = true,
['given#'] = true,
['host#'] = true,
['interviewer#'] = true,
['interviewer-first#'] = true,
['interviewer#-first'] = true,
['interviewer-given#'] = true,
['interviewer#-given'] = true,
['interviewer-last#'] = true,
['interviewer#-last'] = true,
['interviewer-surname#'] = true,
['interviewer#-surname'] = true,
['interviewer-link#'] = true,
['interviewer#-link'] = true,
['interviewer-mask#'] = true,
['interviewer#-mask'] = true,
['last#'] = true,
['subject#'] = true,
['subject-link#'] = true,
['subject#-link'] = true,
['subject-mask#'] = true,
['subject#-mask'] = true,
['surname#'] = true,
['translator#'] = true,
['translator-first#'] = true,
['translator#-first'] = true,
['translator-given#'] = true,
['translator#-given'] = true,
['translator-last#'] = true,
['translator#-last'] = true,
['translator-surname#'] = true,
['translator#-surname'] = true,
['translator-link#'] = true,
['translator#-link'] = true,
['translator-mask#'] = true,
['translator#-mask'] = true,
}
--[[--------------------------< P R E P R I N T S U P P O R T E D P A R A M E T E R S >--------------------
Cite arXiv, cite biorxiv, cite citeseerx, and cite ssrn are preprint templates that use the limited set of parameters
defined in the limited_basic_arguments and limited_numbered_arguments tables. Those lists are supplemented with a
template-specific list of parameters that are required by the particular template and may be exclusive to one of the
preprint templates. Some of these parameters may also be available to the general cs1|2 templates.
Same conventions for true/false/tracked/nil as above.
]]
local preprint_arguments = {
arxiv = {
['arxiv'] = true, -- cite arxiv and arxiv identifiers
['class'] = true,
['eprint'] = true, -- cite arxiv and arxiv identifiers
},
biorxiv = {
['biorxiv'] = true,
},
citeseerx = {
['citeseerx'] = true,
},
ssrn = {
['ssrn'] = true,
['SSRN'] = true,
['ssrn-access'] = true,
},
}
--[[--------------------------< L I M I T E D S U P P O R T E D P A R A M E T E R S >----------------------
cite arxiv, cite biorxiv, cite citeseerx, and cite ssrn templates are preprint templates so are allowed only a
limited subset of parameters allowed to all other cs1|2 templates. The limited subset is defined here.
Same conventions for true/false/tracked/nil as above.
]]
local limited_basic_arguments = {
['at'] = true,
['author'] = true,
['author-first'] = true,
['author-given'] = true,
['author-last'] = true,
['author-surname'] = true,
['author-link'] = true,
['authorlink'] = true,
['author-mask'] = true,
['authors'] = true,
['collaboration'] = true,
['date'] = true,
['df'] = true,
['display-authors'] = true,
['first'] = true,
['given'] = true,
['language'] = true,
['last'] = true,
['mode'] = true,
['name-list-style'] = true,
['no-tracking'] = true,
['p'] = true,
['page'] = true,
['pages'] = true,
['postscript'] = true,
['pp'] = true,
['quotation'] = true,
['quote'] = true,
['ref'] = true,
['surname'] = true,
['template-doc-demo'] = true,
['title'] = true,
['trans-title'] = true,
['vauthors'] = true,
['year'] = true,
}
local limited_numbered_arguments = {
['author#'] = true,
['author-first#'] = true,
['author#-first'] = true,
['author-given#'] = true,
['author#-given'] = true,
['author-last#'] = true,
['author#-last'] = true,
['author-surname#'] = true,
['author#-surname'] = true,
['author-link#'] = true,
['author#-link'] = true,
['authorlink#'] = true,
['author#link'] = true,
['author-mask#'] = true,
['author#-mask'] = true,
['first#'] = true,
['given#'] = true,
['last#'] = true,
['surname#'] = true,
}
--[[--------------------------< U N I Q U E _ A R G U M E N T S >----------------------------------------------
Some templates have unique parameters. Those templates and their unique parameters are listed here. Keys in this
table are the template's CitationClass parameter value
Same conventions for true/false/tracked/nil as above.
]]
local unique_arguments = {
['audio-visual'] = {
['transcript'] = true,
['transcript-format'] = true,
['transcript-url'] = true,
},
conference = {
['book-title'] = true,
['conference'] = true,
['conference-format'] = true,
['conference-url'] = true,
['event'] = true,
},
episode = {
['airdate'] = true,
['air-date'] = true,
['credits'] = true,
['episode-link'] = true, -- alias of |title-link=
['network'] = true,
['season'] = true,
['series-link'] = true,
['series-no'] = true,
['series-number'] = true,
['station'] = true,
['transcript'] = true,
['transcript-format'] = true,
['transcripturl'] = false,
['transcript-url'] = true,
},
mailinglist = {
['mailing-list'] = true,
},
map = {
['cartography'] = true,
['inset'] = true,
['map'] = true,
['map-format'] = true,
['map-url'] = true,
['map-url-access'] = true,
['script-map'] = true,
['sections'] = true,
['sheet'] = true,
['sheets'] = true,
['trans-map'] = true,
},
newsgroup = {
['message-id'] = true,
['newsgroup'] = true,
},
report = {
['docket'] = true,
},
serial = {
['airdate'] = true,
['air-date'] = true,
['credits'] = true,
['episode'] = true, -- cite serial only TODO: make available to cite episode?
['episode-link'] = true, -- alias of |title-link=
['network'] = true,
['series-link'] = true,
['station'] = true,
},
speech = {
['conference'] = true,
['conference-format'] = true,
['conference-url'] = true,
['event'] = true,
},
thesis = {
['degree'] = true,
['docket'] = true,
},
}
--[[--------------------------< T E M P L A T E _ L I S T _ G E T >--------------------------------------------
gets a list of the templates from table t
]]
local function template_list_get (t)
local out = {}; -- a table for output
for k, _ in pairs (t) do -- spin through the table and collect the keys
table.insert (out, k) -- add each key to the output table
end
return out; -- and done
end
--[[--------------------------< E X P O R T E D T A B L E S >------------------------------------------------
]]
return {
basic_arguments = basic_arguments,
numbered_arguments = numbered_arguments,
limited_basic_arguments = limited_basic_arguments,
limited_numbered_arguments = limited_numbered_arguments,
preprint_arguments = preprint_arguments,
preprint_template_list = template_list_get (preprint_arguments), -- make a template list from preprint_arguments{} table
unique_arguments = unique_arguments,
unique_param_template_list = template_list_get (unique_arguments), -- make a template list from unique_arguments{} table
};
7c70519c4a7fa5776be7289982de9107c7a95c04
Module:Citation/CS1
828
111
230
2023-01-14T14:43:47Z
wikipedia>Trappist the monk
0
sync from sandbox;
Scribunto
text/plain
require('strict');
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
each of these counts against the Lua upvalue limit
]]
local validation; -- functions in Module:Citation/CS1/Date_validation
local utilities; -- functions in Module:Citation/CS1/Utilities
local z = {}; -- table of tables in Module:Citation/CS1/Utilities
local identifiers; -- functions and tables in Module:Citation/CS1/Identifiers
local metadata; -- functions in Module:Citation/CS1/COinS
local cfg = {}; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
local whitelist = {}; -- table of tables listing valid template parameter names; defined in Module:Citation/CS1/Whitelist
--[[------------------< P A G E S C O P E V A R I A B L E S >---------------
declare variables here that have page-wide scope that are not brought in from
other modules; that are created here and used here
]]
local added_deprecated_cat; -- Boolean flag so that the category is added only once
local added_vanc_errs; -- Boolean flag so we only emit one Vancouver error / category
local added_generic_name_errs; -- Boolean flag so we only emit one generic name error / category and stop testing names once an error is encountered
local Frame; -- holds the module's frame table
local is_preview_mode; -- true when article is in preview mode; false when using 'Preview page with this template' (previewing the module)
local is_sandbox; -- true when using sandbox modules to render citation
--[[--------------------------< F I R S T _ S E T >------------------------------------------------------------
Locates and returns the first set value in a table of values where the order established in the table,
left-to-right (or top-to-bottom), is the order in which the values are evaluated. Returns nil if none are set.
This version replaces the original 'for _, val in pairs do' and a similar version that used ipairs. With the pairs
version the order of evaluation could not be guaranteed. With the ipairs version, a nil value would terminate
the for-loop before it reached the actual end of the list.
]]
local function first_set (list, count)
local i = 1;
while i <= count do -- loop through all items in list
if utilities.is_set( list[i] ) then
return list[i]; -- return the first set list member
end
i = i + 1; -- point to next
end
end
--[[--------------------------< A D D _ V A N C _ E R R O R >----------------------------------------------------
Adds a single Vancouver system error message to the template's output regardless of how many error actually exist.
To prevent duplication, added_vanc_errs is nil until an error message is emitted.
added_vanc_errs is a Boolean declared in page scope variables above
]]
local function add_vanc_error (source, position)
if added_vanc_errs then return end
added_vanc_errs = true; -- note that we've added this category
utilities.set_message ('err_vancouver', {source, position});
end
--[[--------------------------< I S _ S C H E M E >------------------------------------------------------------
does this thing that purports to be a URI scheme seem to be a valid scheme? The scheme is checked to see if it
is in agreement with http://tools.ietf.org/html/std66#section-3.1 which says:
Scheme names consist of a sequence of characters beginning with a
letter and followed by any combination of letters, digits, plus
("+"), period ("."), or hyphen ("-").
returns true if it does, else false
]]
local function is_scheme (scheme)
return scheme and scheme:match ('^%a[%a%d%+%.%-]*:'); -- true if scheme is set and matches the pattern
end
--[=[-------------------------< I S _ D O M A I N _ N A M E >--------------------------------------------------
Does this thing that purports to be a domain name seem to be a valid domain name?
Syntax defined here: http://tools.ietf.org/html/rfc1034#section-3.5
BNF defined here: https://tools.ietf.org/html/rfc4234
Single character names are generally reserved; see https://tools.ietf.org/html/draft-ietf-dnsind-iana-dns-01#page-15;
see also [[Single-letter second-level domain]]
list of TLDs: https://www.iana.org/domains/root/db
RFC 952 (modified by RFC 1123) requires the first and last character of a hostname to be a letter or a digit. Between
the first and last characters the name may use letters, digits, and the hyphen.
Also allowed are IPv4 addresses. IPv6 not supported
domain is expected to be stripped of any path so that the last character in the last character of the TLD. tld
is two or more alpha characters. Any preceding '//' (from splitting a URL with a scheme) will be stripped
here. Perhaps not necessary but retained in case it is necessary for IPv4 dot decimal.
There are several tests:
the first character of the whole domain name including subdomains must be a letter or a digit
internationalized domain name (ASCII characters with .xn-- ASCII Compatible Encoding (ACE) prefix xn-- in the TLD) see https://tools.ietf.org/html/rfc3490
single-letter/digit second-level domains in the .org, .cash, and .today TLDs
q, x, and z SL domains in the .com TLD
i and q SL domains in the .net TLD
single-letter SL domains in the ccTLDs (where the ccTLD is two letters)
two-character SL domains in gTLDs (where the gTLD is two or more letters)
three-plus-character SL domains in gTLDs (where the gTLD is two or more letters)
IPv4 dot-decimal address format; TLD not allowed
returns true if domain appears to be a proper name and TLD or IPv4 address, else false
]=]
local function is_domain_name (domain)
if not domain then
return false; -- if not set, abandon
end
domain = domain:gsub ('^//', ''); -- strip '//' from domain name if present; done here so we only have to do it once
if not domain:match ('^[%w]') then -- first character must be letter or digit
return false;
end
if domain:match ('^%a+:') then -- hack to detect things that look like s:Page:Title where Page: is namespace at Wikisource
return false;
end
local patterns = { -- patterns that look like URLs
'%f[%w][%w][%w%-]+[%w]%.%a%a+$', -- three or more character hostname.hostname or hostname.tld
'%f[%w][%w][%w%-]+[%w]%.xn%-%-[%w]+$', -- internationalized domain name with ACE prefix
'%f[%a][qxz]%.com$', -- assigned one character .com hostname (x.com times out 2015-12-10)
'%f[%a][iq]%.net$', -- assigned one character .net hostname (q.net registered but not active 2015-12-10)
'%f[%w][%w]%.%a%a$', -- one character hostname and ccTLD (2 chars)
'%f[%w][%w][%w]%.%a%a+$', -- two character hostname and TLD
'^%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?', -- IPv4 address
}
for _, pattern in ipairs (patterns) do -- loop through the patterns list
if domain:match (pattern) then
return true; -- if a match then we think that this thing that purports to be a URL is a URL
end
end
for _, d in ipairs (cfg.single_letter_2nd_lvl_domains_t) do -- look for single letter second level domain names for these top level domains
if domain:match ('%f[%w][%w]%.' .. d) then
return true
end
end
return false; -- no matches, we don't know what this thing is
end
--[[--------------------------< I S _ U R L >------------------------------------------------------------------
returns true if the scheme and domain parts of a URL appear to be a valid URL; else false.
This function is the last step in the validation process. This function is separate because there are cases that
are not covered by split_url(), for example is_parameter_ext_wikilink() which is looking for bracketted external
wikilinks.
]]
local function is_url (scheme, domain)
if utilities.is_set (scheme) then -- if scheme is set check it and domain
return is_scheme (scheme) and is_domain_name (domain);
else
return is_domain_name (domain); -- scheme not set when URL is protocol-relative
end
end
--[[--------------------------< S P L I T _ U R L >------------------------------------------------------------
Split a URL into a scheme, authority indicator, and domain.
First remove Fully Qualified Domain Name terminator (a dot following TLD) (if any) and any path(/), query(?) or fragment(#).
If protocol-relative URL, return nil scheme and domain else return nil for both scheme and domain.
When not protocol-relative, get scheme, authority indicator, and domain. If there is an authority indicator (one
or more '/' characters immediately following the scheme's colon), make sure that there are only 2.
Any URL that does not have news: scheme must have authority indicator (//). TODO: are there other common schemes
like news: that don't use authority indicator?
Strip off any port and path;
]]
local function split_url (url_str)
local scheme, authority, domain;
url_str = url_str:gsub ('([%a%d])%.?[/%?#].*$', '%1'); -- strip FQDN terminator and path(/), query(?), fragment (#) (the capture prevents false replacement of '//')
if url_str:match ('^//%S*') then -- if there is what appears to be a protocol-relative URL
domain = url_str:match ('^//(%S*)')
elseif url_str:match ('%S-:/*%S+') then -- if there is what appears to be a scheme, optional authority indicator, and domain name
scheme, authority, domain = url_str:match ('(%S-:)(/*)(%S+)'); -- extract the scheme, authority indicator, and domain portions
if utilities.is_set (authority) then
authority = authority:gsub ('//', '', 1); -- replace place 1 pair of '/' with nothing;
if utilities.is_set(authority) then -- if anything left (1 or 3+ '/' where authority should be) then
return scheme; -- return scheme only making domain nil which will cause an error message
end
else
if not scheme:match ('^news:') then -- except for news:..., MediaWiki won't link URLs that do not have authority indicator; TODO: a better way to do this test?
return scheme; -- return scheme only making domain nil which will cause an error message
end
end
domain = domain:gsub ('(%a):%d+', '%1'); -- strip port number if present
end
return scheme, domain;
end
--[[--------------------------< L I N K _ P A R A M _ O K >---------------------------------------------------
checks the content of |title-link=, |series-link=, |author-link=, etc. for properly formatted content: no wikilinks, no URLs
Link parameters are to hold the title of a Wikipedia article, so none of the WP:TITLESPECIALCHARACTERS are allowed:
# < > [ ] | { } _
except the underscore which is used as a space in wiki URLs and # which is used for section links
returns false when the value contains any of these characters.
When there are no illegal characters, this function returns TRUE if value DOES NOT appear to be a valid URL (the
|<param>-link= parameter is ok); else false when value appears to be a valid URL (the |<param>-link= parameter is NOT ok).
]]
local function link_param_ok (value)
local scheme, domain;
if value:find ('[<>%[%]|{}]') then -- if any prohibited characters
return false;
end
scheme, domain = split_url (value); -- get scheme or nil and domain or nil from URL;
return not is_url (scheme, domain); -- return true if value DOES NOT appear to be a valid URL
end
--[[--------------------------< L I N K _ T I T L E _ O K >---------------------------------------------------
Use link_param_ok() to validate |<param>-link= value and its matching |<title>= value.
|<title>= may be wiki-linked but not when |<param>-link= has a value. This function emits an error message when
that condition exists
check <link> for inter-language interwiki-link prefix. prefix must be a MediaWiki-recognized language
code and must begin with a colon.
]]
local function link_title_ok (link, lorig, title, torig)
local orig;
if utilities.is_set (link) then -- don't bother if <param>-link doesn't have a value
if not link_param_ok (link) then -- check |<param>-link= markup
orig = lorig; -- identify the failing link parameter
elseif title:find ('%[%[') then -- check |title= for wikilink markup
orig = torig; -- identify the failing |title= parameter
elseif link:match ('^%a+:') then -- if the link is what looks like an interwiki
local prefix = link:match ('^(%a+):'):lower(); -- get the interwiki prefix
if cfg.inter_wiki_map[prefix] then -- if prefix is in the map, must have preceding colon
orig = lorig; -- flag as error
end
end
end
if utilities.is_set (orig) then
link = ''; -- unset
utilities.set_message ('err_bad_paramlink', orig); -- URL or wikilink in |title= with |title-link=;
end
return link; -- link if ok, empty string else
end
--[[--------------------------< C H E C K _ U R L >------------------------------------------------------------
Determines whether a URL string appears to be valid.
First we test for space characters. If any are found, return false. Then split the URL into scheme and domain
portions, or for protocol-relative (//example.com) URLs, just the domain. Use is_url() to validate the two
portions of the URL. If both are valid, or for protocol-relative if domain is valid, return true, else false.
Because it is different from a standard URL, and because this module used external_link() to make external links
that work for standard and news: links, we validate newsgroup names here. The specification for a newsgroup name
is at https://tools.ietf.org/html/rfc5536#section-3.1.4
]]
local function check_url( url_str )
if nil == url_str:match ("^%S+$") then -- if there are any spaces in |url=value it can't be a proper URL
return false;
end
local scheme, domain;
scheme, domain = split_url (url_str); -- get scheme or nil and domain or nil from URL;
if 'news:' == scheme then -- special case for newsgroups
return domain:match('^[%a%d%+%-_]+%.[%a%d%+%-_%.]*[%a%d%+%-_]$');
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[=[-------------------------< I S _ P A R A M E T E R _ E X T _ W I K I L I N K >----------------------------
Return true if a parameter value has a string that begins and ends with square brackets [ and ] and the first
non-space characters following the opening bracket appear to be a URL. The test will also find external wikilinks
that use protocol-relative URLs. Also finds bare URLs.
The frontier pattern prevents a match on interwiki-links which are similar to scheme:path URLs. The tests that
find bracketed URLs are required because the parameters that call this test (currently |title=, |chapter=, |work=,
and |publisher=) may have wikilinks and there are articles or redirects like '//Hus' so, while uncommon, |title=[[//Hus]]
is possible as might be [[en://Hus]].
]=]
local function is_parameter_ext_wikilink (value)
local scheme, domain;
if value:match ('%f[%[]%[%a%S*:%S+.*%]') then -- if ext. wikilink with scheme and domain: [xxxx://yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(%a%S*:%S+).*%]'));
elseif value:match ('%f[%[]%[//%S+.*%]') then -- if protocol-relative ext. wikilink: [//yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(//%S+).*%]'));
elseif value:match ('%a%S*:%S+') then -- if bare URL with scheme; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(%a%S*:%S+)'));
elseif value:match ('//%S+') then -- if protocol-relative bare URL: //yyyyy.zzz; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(//%S+)')); -- what is left should be the domain
else
return false; -- didn't find anything that is obviously a URL
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[[-------------------------< C H E C K _ F O R _ U R L >-----------------------------------------------------
loop through a list of parameters and their values. Look at the value and if it has an external link, emit an error message.
]]
local function check_for_url (parameter_list, error_list)
for k, v in pairs (parameter_list) do -- for each parameter in the list
if is_parameter_ext_wikilink (v) then -- look at the value; if there is a URL add an error message
table.insert (error_list, utilities.wrap_style ('parameter', k));
end
end
end
--[[--------------------------< S A F E _ F O R _ U R L >------------------------------------------------------
Escape sequences for content that will be used for URL descriptions
]]
local function safe_for_url( str )
if str:match( "%[%[.-%]%]" ) ~= nil then
utilities.set_message ('err_wikilink_in_url', {});
end
return str:gsub( '[%[%]\n]', {
['['] = '[',
[']'] = ']',
['\n'] = ' ' } );
end
--[[--------------------------< E X T E R N A L _ L I N K >----------------------------------------------------
Format an external link with error checking
]]
local function external_link (URL, label, source, access)
local err_msg = '';
local domain;
local path;
local base_url;
if not utilities.is_set (label) then
label = URL;
if utilities.is_set (source) then
utilities.set_message ('err_bare_url_missing_title', {utilities.wrap_style ('parameter', source)});
else
error (cfg.messages["bare_url_no_origin"]); -- programmer error; valid parameter name does not have matching meta-parameter
end
end
if not check_url (URL) then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)});
end
domain, path = URL:match ('^([/%.%-%+:%a%d]+)([/%?#].*)$'); -- split the URL into scheme plus domain and path
if path then -- if there is a path portion
path = path:gsub ('[%[%]]', {['['] = '%5b', [']'] = '%5d'}); -- replace '[' and ']' with their percent-encoded values
URL = table.concat ({domain, path}); -- and reassemble
end
base_url = table.concat ({ "[", URL, " ", safe_for_url (label), "]" }); -- assemble a wiki-markup URL
if utilities.is_set (access) then -- access level (subscription, registration, limited)
base_url = utilities.substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[access].class, cfg.presentation[access].title, base_url}); -- add the appropriate icon
end
return base_url;
end
--[[--------------------------< D E P R E C A T E D _ P A R A M E T E R >--------------------------------------
Categorize and emit an error message when the citation contains one or more deprecated parameters. The function includes the
offending parameter name to the error message. Only one error message is emitted regardless of the number of deprecated
parameters in the citation.
added_deprecated_cat is a Boolean declared in page scope variables above
]]
local function deprecated_parameter(name)
if not added_deprecated_cat then
added_deprecated_cat = true; -- note that we've added this category
utilities.set_message ('err_deprecated_params', {name}); -- add error message
end
end
--[=[-------------------------< K E R N _ Q U O T E S >--------------------------------------------------------
Apply kerning to open the space between the quote mark provided by the module and a leading or trailing quote
mark contained in a |title= or |chapter= parameter's value.
This function will positive kern either single or double quotes:
"'Unkerned title with leading and trailing single quote marks'"
" 'Kerned title with leading and trailing single quote marks' " (in real life the kerning isn't as wide as this example)
Double single quotes (italic or bold wiki-markup) are not kerned.
Replaces Unicode quote marks in plain text or in the label portion of a [[L|D]] style wikilink with typewriter
quote marks regardless of the need for kerning. Unicode quote marks are not replaced in simple [[D]] wikilinks.
Call this function for chapter titles, for website titles, etc.; not for book titles.
]=]
local function kern_quotes (str)
local cap = '';
local wl_type, label, link;
wl_type, label, link = utilities.is_wikilink (str); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
if 1 == wl_type then -- [[D]] simple wikilink with or without quote marks
if mw.ustring.match (str, '%[%[[\"“”\'‘’].+[\"“”\'‘’]%]%]') then -- leading and trailing quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
str = utilities.substitute (cfg.presentation['kern-right'], str);
elseif mw.ustring.match (str, '%[%[[\"“”\'‘’].+%]%]') then -- leading quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
elseif mw.ustring.match (str, '%[%[.+[\"“”\'‘’]%]%]') then -- trailing quote marks
str = utilities.substitute (cfg.presentation['kern-right'], str);
end
else -- plain text or [[L|D]]; text in label variable
label = mw.ustring.gsub (label, '[“”]', '\"'); -- replace “” (U+201C & U+201D) with " (typewriter double quote mark)
label = mw.ustring.gsub (label, '[‘’]', '\''); -- replace ‘’ (U+2018 & U+2019) with ' (typewriter single quote mark)
cap = mw.ustring.match (label, "^([\"\'][^\'].+)"); -- match leading double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-left'], cap);
end
cap = mw.ustring.match (label, "^(.+[^\'][\"\'])$") -- match trailing double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-right'], cap);
end
if 2 == wl_type then
str = utilities.make_wikilink (link, label); -- reassemble the wikilink
else
str = label;
end
end
return str;
end
--[[--------------------------< F O R M A T _ S C R I P T _ V A L U E >----------------------------------------
|script-title= holds title parameters that are not written in Latin-based scripts: Chinese, Japanese, Arabic, Hebrew, etc. These scripts should
not be italicized and may be written right-to-left. The value supplied by |script-title= is concatenated onto Title after Title has been wrapped
in italic markup.
Regardless of language, all values provided by |script-title= are wrapped in <bdi>...</bdi> tags to isolate RTL languages from the English left to right.
|script-title= provides a unique feature. The value in |script-title= may be prefixed with a two-character ISO 639-1 language code and a colon:
|script-title=ja:*** *** (where * represents a Japanese character)
Spaces between the two-character code and the colon and the colon and the first script character are allowed:
|script-title=ja : *** ***
|script-title=ja: *** ***
|script-title=ja :*** ***
Spaces preceding the prefix are allowed: |script-title = ja:*** ***
The prefix is checked for validity. If it is a valid ISO 639-1 language code, the lang attribute (lang="ja") is added to the <bdi> tag so that browsers can
know the language the tag contains. This may help the browser render the script more correctly. If the prefix is invalid, the lang attribute
is not added. At this time there is no error message for this condition.
Supports |script-title=, |script-chapter=, |script-<periodical>=
]]
local function format_script_value (script_value, script_param)
local lang=''; -- initialize to empty string
local name;
if script_value:match('^%l%l%l?%s*:') then -- if first 3 or 4 non-space characters are script language prefix
lang = script_value:match('^(%l%l%l?)%s*:%s*%S.*'); -- get the language prefix or nil if there is no script
if not utilities.is_set (lang) then
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing title part']}); -- prefix without 'title'; add error message
return ''; -- script_value was just the prefix so return empty string
end
-- if we get this far we have prefix and script
name = cfg.lang_code_remap[lang] or mw.language.fetchLanguageName( lang, cfg.this_wiki_code ); -- get language name so that we can use it to categorize
if utilities.is_set (name) then -- is prefix a proper ISO 639-1 language code?
script_value = script_value:gsub ('^%l+%s*:%s*', ''); -- strip prefix from script
-- is prefix one of these language codes?
if utilities.in_array (lang, cfg.script_lang_codes) then
utilities.add_prop_cat ('script', {name, lang})
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['unknown language code']}); -- unknown script-language; add error message
end
lang = ' lang="' .. lang .. '" '; -- convert prefix into a lang attribute
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['invalid language code']}); -- invalid language code; add error message
lang = ''; -- invalid so set lang to empty string
end
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing prefix']}); -- no language code prefix; add error message
end
script_value = utilities.substitute (cfg.presentation['bdi'], {lang, script_value}); -- isolate in case script is RTL
return script_value;
end
--[[--------------------------< S C R I P T _ C O N C A T E N A T E >------------------------------------------
Initially for |title= and |script-title=, this function concatenates those two parameter values after the script
value has been wrapped in <bdi> tags.
]]
local function script_concatenate (title, script, script_param)
if utilities.is_set (script) then
script = format_script_value (script, script_param); -- <bdi> tags, lang attribute, categorization, etc.; returns empty string on error
if utilities.is_set (script) then
title = title .. ' ' .. script; -- concatenate title and script title
end
end
return title;
end
--[[--------------------------< W R A P _ M S G >--------------------------------------------------------------
Applies additional message text to various parameter values. Supplied string is wrapped using a message_list
configuration taking one argument. Supports lower case text for {{citation}} templates. Additional text taken
from citation_config.messages - the reason this function is similar to but separate from wrap_style().
]]
local function wrap_msg (key, str, lower)
if not utilities.is_set ( str ) then
return "";
end
if true == lower then
local msg;
msg = cfg.messages[key]:lower(); -- set the message to lower case before
return utilities.substitute ( msg, str ); -- including template text
else
return utilities.substitute ( cfg.messages[key], str );
end
end
--[[----------------< W I K I S O U R C E _ U R L _ M A K E >-------------------
Makes a Wikisource URL from Wikisource interwiki-link. Returns the URL and appropriate
label; nil else.
str is the value assigned to |chapter= (or aliases) or |title= or |title-link=
]]
local function wikisource_url_make (str)
local wl_type, D, L;
local ws_url, ws_label;
local wikisource_prefix = table.concat ({'https://', cfg.this_wiki_code, '.wikisource.org/wiki/'});
wl_type, D, L = utilities.is_wikilink (str); -- wl_type is 0 (not a wikilink), 1 (simple wikilink), 2 (complex wikilink)
if 0 == wl_type then -- not a wikilink; might be from |title-link=
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 1 == wl_type then -- simple wikilink: [[Wikisource:ws article]]
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 2 == wl_type then -- non-so-simple wikilink: [[Wikisource:ws article|displayed text]] ([[L|D]])
str = L:match ('^[Ww]ikisource:(.+)') or L:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_label = D; -- get ws article name from display portion of interwiki link
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title without namespace from link portion of wikilink
});
end
end
if ws_url then
ws_url = mw.uri.encode (ws_url, 'WIKI'); -- make a usable URL
ws_url = ws_url:gsub ('%%23', '#'); -- undo percent-encoding of fragment marker
end
return ws_url, ws_label, L or D; -- return proper URL or nil and a label or nil
end
--[[----------------< F O R M A T _ P E R I O D I C A L >-----------------------
Format the three periodical parameters: |script-<periodical>=, |<periodical>=,
and |trans-<periodical>= into a single Periodical meta-parameter.
]]
local function format_periodical (script_periodical, script_periodical_source, periodical, trans_periodical)
if not utilities.is_set (periodical) then
periodical = ''; -- to be safe for concatenation
else
periodical = utilities.wrap_style ('italic-title', periodical); -- style
end
periodical = script_concatenate (periodical, script_periodical, script_periodical_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (trans_periodical) then
trans_periodical = utilities.wrap_style ('trans-italic-title', trans_periodical);
if utilities.is_set (periodical) then
periodical = periodical .. ' ' .. trans_periodical;
else -- here when trans-periodical without periodical or script-periodical
periodical = trans_periodical;
utilities.set_message ('err_trans_missing_title', {'periodical'});
end
end
return periodical;
end
--[[------------------< F O R M A T _ C H A P T E R _ T I T L E >---------------
Format the four chapter parameters: |script-chapter=, |chapter=, |trans-chapter=,
and |chapter-url= into a single chapter meta- parameter (chapter_url_source used
for error messages).
]]
local function format_chapter_title (script_chapter, script_chapter_source, chapter, chapter_source, trans_chapter, trans_chapter_source, chapter_url, chapter_url_source, no_quotes, access)
local ws_url, ws_label, L = wikisource_url_make (chapter); -- make a wikisource URL and label from a wikisource interwiki link
if ws_url then
ws_label = ws_label:gsub ('_', ' '); -- replace underscore separators with space characters
chapter = ws_label;
end
if not utilities.is_set (chapter) then
chapter = ''; -- to be safe for concatenation
else
if false == no_quotes then
chapter = kern_quotes (chapter); -- if necessary, separate chapter title's leading and trailing quote marks from module provided quote marks
chapter = utilities.wrap_style ('quoted-title', chapter);
end
end
chapter = script_concatenate (chapter, script_chapter, script_chapter_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (chapter_url) then
chapter = external_link (chapter_url, chapter, chapter_url_source, access); -- adds bare_url_missing_title error if appropriate
elseif ws_url then
chapter = external_link (ws_url, chapter .. ' ', 'ws link in chapter'); -- adds bare_url_missing_title error if appropriate; space char to move icon away from chap text; TODO: better way to do this?
chapter = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, chapter});
end
if utilities.is_set (trans_chapter) then
trans_chapter = utilities.wrap_style ('trans-quoted-title', trans_chapter);
if utilities.is_set (chapter) then
chapter = chapter .. ' ' .. trans_chapter;
else -- here when trans_chapter without chapter or script-chapter
chapter = trans_chapter;
chapter_source = trans_chapter_source:match ('trans%-?(.+)'); -- when no chapter, get matching name from trans-<param>
utilities.set_message ('err_trans_missing_title', {chapter_source});
end
end
return chapter;
end
--[[----------------< H A S _ I N V I S I B L E _ C H A R S >-------------------
This function searches a parameter's value for non-printable or invisible characters.
The search stops at the first match.
This function will detect the visible replacement character when it is part of the Wikisource.
Detects but ignores nowiki and math stripmarkers. Also detects other named stripmarkers
(gallery, math, pre, ref) and identifies them with a slightly different error message.
See also coins_cleanup().
Output of this function is an error message that identifies the character or the
Unicode group, or the stripmarker that was detected along with its position (or,
for multi-byte characters, the position of its first byte) in the parameter value.
]]
local function has_invisible_chars (param, v)
local position = ''; -- position of invisible char or starting position of stripmarker
local capture; -- used by stripmarker detection to hold name of the stripmarker
local stripmarker; -- boolean set true when a stripmarker is found
capture = string.match (v, '[%w%p ]*'); -- test for values that are simple ASCII text and bypass other tests if true
if capture == v then -- if same there are no Unicode characters
return;
end
for _, invisible_char in ipairs (cfg.invisible_chars) do
local char_name = invisible_char[1]; -- the character or group name
local pattern = invisible_char[2]; -- the pattern used to find it
position, _, capture = mw.ustring.find (v, pattern); -- see if the parameter value contains characters that match the pattern
if position and (cfg.invisible_defs.zwj == capture) then -- if we found a zero-width joiner character
if mw.ustring.find (v, cfg.indic_script) then -- it's ok if one of the Indic scripts
position = nil; -- unset position
elseif cfg.emoji_t[mw.ustring.codepoint (v, position+1)] then -- is zwj followed by a character listed in emoji{}?
position = nil; -- unset position
end
end
if position then
if 'nowiki' == capture or 'math' == capture or -- nowiki and math stripmarkers (not an error condition)
('templatestyles' == capture and utilities.in_array (param, {'id', 'quote'})) then -- templatestyles stripmarker allowed in these parameters
stripmarker = true; -- set a flag
elseif true == stripmarker and cfg.invisible_defs.del == capture then -- because stripmakers begin and end with the delete char, assume that we've found one end of a stripmarker
position = nil; -- unset
else
local err_msg;
if capture and not (cfg.invisible_defs.del == capture or cfg.invisible_defs.zwj == capture) then
err_msg = capture .. ' ' .. char_name;
else
err_msg = char_name .. ' ' .. 'character';
end
utilities.set_message ('err_invisible_char', {err_msg, utilities.wrap_style ('parameter', param), position}); -- add error message
return; -- and done with this parameter
end
end
end
end
--[[-------------------< A R G U M E N T _ W R A P P E R >----------------------
Argument wrapper. This function provides support for argument mapping defined
in the configuration file so that multiple names can be transparently aliased to
single internal variable.
]]
local function argument_wrapper ( args )
local origin = {};
return setmetatable({
ORIGIN = function ( self, k )
local dummy = self[k]; -- force the variable to be loaded.
return origin[k];
end
},
{
__index = function ( tbl, k )
if origin[k] ~= nil then
return nil;
end
local args, list, v = args, cfg.aliases[k];
if type( list ) == 'table' then
v, origin[k] = utilities.select_one ( args, list, 'err_redundant_parameters' );
if origin[k] == nil then
origin[k] = ''; -- Empty string, not nil
end
elseif list ~= nil then
v, origin[k] = args[list], list;
else
-- maybe let through instead of raising an error?
-- v, origin[k] = args[k], k;
error( cfg.messages['unknown_argument_map'] .. ': ' .. k);
end
-- Empty strings, not nil;
if v == nil then
v = '';
origin[k] = '';
end
tbl = rawset( tbl, k, v );
return v;
end,
});
end
--[[--------------------------< N O W R A P _ D A T E >-------------------------
When date is YYYY-MM-DD format wrap in nowrap span: <span ...>YYYY-MM-DD</span>.
When date is DD MMMM YYYY or is MMMM DD, YYYY then wrap in nowrap span:
<span ...>DD MMMM</span> YYYY or <span ...>MMMM DD,</span> YYYY
DOES NOT yet support MMMM YYYY or any of the date ranges.
]]
local function nowrap_date (date)
local cap = '';
local cap2 = '';
if date:match("^%d%d%d%d%-%d%d%-%d%d$") then
date = utilities.substitute (cfg.presentation['nowrap1'], date);
elseif date:match("^%a+%s*%d%d?,%s+%d%d%d%d$") or date:match ("^%d%d?%s*%a+%s+%d%d%d%d$") then
cap, cap2 = string.match (date, "^(.*)%s+(%d%d%d%d)$");
date = utilities.substitute (cfg.presentation['nowrap2'], {cap, cap2});
end
return date;
end
--[[--------------------------< S E T _ T I T L E T Y P E >---------------------
This function sets default title types (equivalent to the citation including
|type=<default value>) for those templates that have defaults. Also handles the
special case where it is desirable to omit the title type from the rendered citation
(|type=none).
]]
local function set_titletype (cite_class, title_type)
if utilities.is_set (title_type) then
if 'none' == cfg.keywords_xlate[title_type] then
title_type = ''; -- if |type=none then type parameter not displayed
end
return title_type; -- if |type= has been set to any other value use that value
end
return cfg.title_types [cite_class] or ''; -- set template's default title type; else empty string for concatenation
end
--[[--------------------------< S A F E _ J O I N >-----------------------------
Joins a sequence of strings together while checking for duplicate separation characters.
]]
local function safe_join( tbl, duplicate_char )
local f = {}; -- create a function table appropriate to type of 'duplicate character'
if 1 == #duplicate_char then -- for single byte ASCII characters use the string library functions
f.gsub = string.gsub
f.match = string.match
f.sub = string.sub
else -- for multi-byte characters use the ustring library functions
f.gsub = mw.ustring.gsub
f.match = mw.ustring.match
f.sub = mw.ustring.sub
end
local str = ''; -- the output string
local comp = ''; -- what does 'comp' mean?
local end_chr = '';
local trim;
for _, value in ipairs( tbl ) do
if value == nil then value = ''; end
if str == '' then -- if output string is empty
str = value; -- assign value to it (first time through the loop)
elseif value ~= '' then
if value:sub(1, 1) == '<' then -- special case of values enclosed in spans and other markup.
comp = value:gsub( "%b<>", "" ); -- remove HTML markup (<span>string</span> -> string)
else
comp = value;
end
-- typically duplicate_char is sepc
if f.sub(comp, 1, 1) == duplicate_char then -- is first character same as duplicate_char? why test first character?
-- Because individual string segments often (always?) begin with terminal punct for the
-- preceding segment: 'First element' .. 'sepc next element' .. etc.?
trim = false;
end_chr = f.sub(str, -1, -1); -- get the last character of the output string
-- str = str .. "<HERE(enchr=" .. end_chr .. ")" -- debug stuff?
if end_chr == duplicate_char then -- if same as separator
str = f.sub(str, 1, -2); -- remove it
elseif end_chr == "'" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "''" then -- if last three chars of str are sepc''
str = f.sub(str, 1, -4) .. "''"; -- remove them and add back ''
elseif f.sub(str, -5, -1) == duplicate_char .. "]]''" then -- if last five chars of str are sepc]]''
trim = true; -- why? why do this and next differently from previous?
elseif f.sub(str, -4, -1) == duplicate_char .. "]''" then -- if last four chars of str are sepc]''
trim = true; -- same question
end
elseif end_chr == "]" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "]]" then -- if last three chars of str are sepc]] wikilink
trim = true;
elseif f.sub(str, -3, -1) == duplicate_char .. '"]' then -- if last three chars of str are sepc"] quoted external link
trim = true;
elseif f.sub(str, -2, -1) == duplicate_char .. "]" then -- if last two chars of str are sepc] external link
trim = true;
elseif f.sub(str, -4, -1) == duplicate_char .. "'']" then -- normal case when |url=something & |title=Title.
trim = true;
end
elseif end_chr == " " then -- if last char of output string is a space
if f.sub(str, -2, -1) == duplicate_char .. " " then -- if last two chars of str are <sepc><space>
str = f.sub(str, 1, -3); -- remove them both
end
end
if trim then
if value ~= comp then -- value does not equal comp when value contains HTML markup
local dup2 = duplicate_char;
if f.match(dup2, "%A" ) then dup2 = "%" .. dup2; end -- if duplicate_char not a letter then escape it
value = f.gsub(value, "(%b<>)" .. dup2, "%1", 1 ) -- remove duplicate_char if it follows HTML markup
else
value = f.sub(value, 2, -1 ); -- remove duplicate_char when it is first character
end
end
end
str = str .. value; -- add it to the output string
end
end
return str;
end
--[[--------------------------< I S _ S U F F I X >-----------------------------
returns true if suffix is properly formed Jr, Sr, or ordinal in the range 1–9.
Puncutation not allowed.
]]
local function is_suffix (suffix)
if utilities.in_array (suffix, {'Jr', 'Sr', 'Jnr', 'Snr', '1st', '2nd', '3rd'}) or suffix:match ('^%dth$') then
return true;
end
return false;
end
--[[--------------------< I S _ G O O D _ V A N C _ N A M E >-------------------
For Vancouver style, author/editor names are supposed to be rendered in Latin
(read ASCII) characters. When a name uses characters that contain diacritical
marks, those characters are to be converted to the corresponding Latin
character. When a name is written using a non-Latin alphabet or logogram, that
name is to be transliterated into Latin characters. The module doesn't do this
so editors may/must.
This test allows |first= and |last= names to contain any of the letters defined
in the four Unicode Latin character sets
[http://www.unicode.org/charts/PDF/U0000.pdf C0 Controls and Basic Latin] 0041–005A, 0061–007A
[http://www.unicode.org/charts/PDF/U0080.pdf C1 Controls and Latin-1 Supplement] 00C0–00D6, 00D8–00F6, 00F8–00FF
[http://www.unicode.org/charts/PDF/U0100.pdf Latin Extended-A] 0100–017F
[http://www.unicode.org/charts/PDF/U0180.pdf Latin Extended-B] 0180–01BF, 01C4–024F
|lastn= also allowed to contain hyphens, spaces, and apostrophes.
(http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
|firstn= also allowed to contain hyphens, spaces, apostrophes, and periods
This original test:
if nil == mw.ustring.find (last, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%']*$")
or nil == mw.ustring.find (first, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%'%.]+[2-6%a]*$") then
was written outside of the code editor and pasted here because the code editor
gets confused between character insertion point and cursor position. The test has
been rewritten to use decimal character escape sequence for the individual bytes
of the Unicode characters so that it is not necessary to use an external editor
to maintain this code.
\195\128-\195\150 – À-Ö (U+00C0–U+00D6 – C0 controls)
\195\152-\195\182 – Ø-ö (U+00D8-U+00F6 – C0 controls)
\195\184-\198\191 – ø-ƿ (U+00F8-U+01BF – C0 controls, Latin extended A & B)
\199\132-\201\143 – DŽ-ɏ (U+01C4-U+024F – Latin extended B)
]]
local function is_good_vanc_name (last, first, suffix, position)
if not suffix then
if first:find ('[,%s]') then -- when there is a space or comma, might be first name/initials + generational suffix
first = first:match ('(.-)[,%s]+'); -- get name/initials
suffix = first:match ('[,%s]+(.+)$'); -- get generational suffix
end
end
if utilities.is_set (suffix) then
if not is_suffix (suffix) then
add_vanc_error (cfg.err_msg_supl.suffix, position);
return false; -- not a name with an appropriate suffix
end
end
if nil == mw.ustring.find (last, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%']*$") or
nil == mw.ustring.find (first, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%'%.]*$") then
add_vanc_error (cfg.err_msg_supl['non-Latin char'], position);
return false; -- not a string of Latin characters; Vancouver requires Romanization
end;
return true;
end
--[[--------------------------< R E D U C E _ T O _ I N I T I A L S >------------------------------------------
Attempts to convert names to initials in support of |name-list-style=vanc.
Names in |firstn= may be separated by spaces or hyphens, or for initials, a period.
See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35062/.
Vancouver style requires family rank designations (Jr, II, III, etc.) to be rendered
as Jr, 2nd, 3rd, etc. See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35085/.
This code only accepts and understands generational suffix in the Vancouver format
because Roman numerals look like, and can be mistaken for, initials.
This function uses ustring functions because firstname initials may be any of the
Unicode Latin characters accepted by is_good_vanc_name ().
]]
local function reduce_to_initials(first, position)
local name, suffix = mw.ustring.match(first, "^(%u+) ([%dJS][%drndth]+)$");
if not name then -- if not initials and a suffix
name = mw.ustring.match(first, "^(%u+)$"); -- is it just initials?
end
if name then -- if first is initials with or without suffix
if 3 > mw.ustring.len (name) then -- if one or two initials
if suffix then -- if there is a suffix
if is_suffix (suffix) then -- is it legitimate?
return first; -- one or two initials and a valid suffix so nothing to do
else
add_vanc_error (cfg.err_msg_supl.suffix, position); -- one or two initials with invalid suffix so error message
return first; -- and return first unmolested
end
else
return first; -- one or two initials without suffix; nothing to do
end
end
end -- if here then name has 3 or more uppercase letters so treat them as a word
local initials, names = {}, {}; -- tables to hold name parts and initials
local i = 1; -- counter for number of initials
names = mw.text.split (first, '[%s,]+'); -- split into a table of names and possible suffix
while names[i] do -- loop through the table
if 1 < i and names[i]:match ('[%dJS][%drndth]+%.?$') then -- if not the first name, and looks like a suffix (may have trailing dot)
names[i] = names[i]:gsub ('%.', ''); -- remove terminal dot if present
if is_suffix (names[i]) then -- if a legitimate suffix
table.insert (initials, ' ' .. names[i]); -- add a separator space, insert at end of initials table
break; -- and done because suffix must fall at the end of a name
end -- no error message if not a suffix; possibly because of Romanization
end
if 3 > i then
table.insert (initials, mw.ustring.sub(names[i], 1, 1)); -- insert the initial at end of initials table
end
i = i + 1; -- bump the counter
end
return table.concat(initials) -- Vancouver format does not include spaces.
end
--[[--------------------------< I N T E R W I K I _ P R E F I X E N _ G E T >----------------------------------
extract interwiki prefixen from <value>. Returns two one or two values:
false – no prefixen
nil – prefix exists but not recognized
project prefix, language prefix – when value has either of:
:<project>:<language>:<article>
:<language>:<project>:<article>
project prefix, nil – when <value> has only a known single-letter prefix
nil, language prefix – when <value> has only a known language prefix
accepts single-letter project prefixen: 'd' (wikidata), 's' (wikisource), and 'w' (wikipedia) prefixes; at this
writing, the other single-letter prefixen (b (wikibook), c (commons), m (meta), n (wikinews), q (wikiquote), and
v (wikiversity)) are not supported.
]]
local function interwiki_prefixen_get (value, is_link)
if not value:find (':%l+:') then -- if no prefix
return false; -- abandon; boolean here to distinguish from nil fail returns later
end
local prefix_patterns_linked_t = { -- sequence of valid interwiki and inter project prefixen
'^%[%[:([dsw]):(%l%l+):', -- wikilinked; project and language prefixes
'^%[%[:(%l%l+):([dsw]):', -- wikilinked; language and project prefixes
'^%[%[:([dsw]):', -- wikilinked; project prefix
'^%[%[:(%l%l+):', -- wikilinked; language prefix
}
local prefix_patterns_unlinked_t = { -- sequence of valid interwiki and inter project prefixen
'^:([dsw]):(%l%l+):', -- project and language prefixes
'^:(%l%l+):([dsw]):', -- language and project prefixes
'^:([dsw]):', -- project prefix
'^:(%l%l+):', -- language prefix
}
local cap1, cap2;
for _, pattern in ipairs ((is_link and prefix_patterns_linked_t) or prefix_patterns_unlinked_t) do
cap1, cap2 = value:match (pattern);
if cap1 then
break; -- found a match so stop looking
end
end
if cap1 and cap2 then -- when both then :project:language: or :language:project: (both forms allowed)
if 1 == #cap1 then -- length == 1 then :project:language:
if cfg.inter_wiki_map[cap2] then -- is language prefix in the interwiki map?
return cap1, cap2; -- return interwiki project and interwiki language
end
else -- here when :language:project:
if cfg.inter_wiki_map[cap1] then -- is language prefix in the interwiki map?
return cap2, cap1; -- return interwiki project and interwiki language
end
end
return nil; -- unknown interwiki language
elseif not (cap1 or cap2) then -- both are nil?
return nil; -- we got something that looks like a project prefix but isn't; return fail
elseif 1 == #cap1 then -- here when one capture
return cap1, nil; -- length is 1 so return project, nil language
else -- here when one capture and its length it more than 1
if cfg.inter_wiki_map[cap1] then -- is language prefix in the interwiki map?
return nil, cap1; -- return nil project, language
end
end
end
--[[--------------------------< L I S T _ P E O P L E >--------------------------
Formats a list of people (authors, contributors, editors, interviewers, translators)
names in the list will be linked when
|<name>-link= has a value
|<name>-mask- does NOT have a value; masked names are presumed to have been
rendered previously so should have been linked there
when |<name>-mask=0, the associated name is not rendered
]]
local function list_people (control, people, etal)
local sep;
local namesep;
local format = control.format;
local maximum = control.maximum;
local name_list = {};
if 'vanc' == format then -- Vancouver-like name styling?
sep = cfg.presentation['sep_nl_vanc']; -- name-list separator between names is a comma
namesep = cfg.presentation['sep_name_vanc']; -- last/first separator is a space
else
sep = cfg.presentation['sep_nl']; -- name-list separator between names is a semicolon
namesep = cfg.presentation['sep_name']; -- last/first separator is <comma><space>
end
if sep:sub (-1, -1) ~= " " then sep = sep .. " " end
if utilities.is_set (maximum) and maximum < 1 then return "", 0; end -- returned 0 is for EditorCount; not used for other names
for i, person in ipairs (people) do
if utilities.is_set (person.last) then
local mask = person.mask;
local one;
local sep_one = sep;
if utilities.is_set (maximum) and i > maximum then
etal = true;
break;
end
if mask then
local n = tonumber (mask); -- convert to a number if it can be converted; nil else
if n then
one = 0 ~= n and string.rep("—", n) or nil; -- make a string of (n > 0) mdashes, nil else, to replace name
person.link = nil; -- don't create link to name if name is replaces with mdash string or has been set nil
else
one = mask; -- replace name with mask text (must include name-list separator)
sep_one = " "; -- modify name-list separator
end
else
one = person.last; -- get surname
local first = person.first -- get given name
if utilities.is_set (first) then
if ("vanc" == format) then -- if Vancouver format
one = one:gsub ('%.', ''); -- remove periods from surnames (http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
if not person.corporate and is_good_vanc_name (one, first, nil, i) then -- and name is all Latin characters; corporate authors not tested
first = reduce_to_initials (first, i); -- attempt to convert first name(s) to initials
end
end
one = one .. namesep .. first;
end
end
if utilities.is_set (person.link) then
one = utilities.make_wikilink (person.link, one); -- link author/editor
end
if one then -- if <one> has a value (name, mdash replacement, or mask text replacement)
local proj, tag = interwiki_prefixen_get (one, true); -- get the interwiki prefixen if present
if 'w' == proj and ('Wikipedia' == mw.site.namespaces.Project['name']) then
proj = nil; -- for stuff like :w:de:<article>, :w is unnecessary TODO: maint cat?
end
if proj then
proj = ({['d'] = 'Wikidata', ['s'] = 'Wikisource', ['w'] = 'Wikipedia'})[proj]; -- :w (wikipedia) for linking from a non-wikipedia project
if proj then
one = one .. utilities.wrap_style ('interproj', proj); -- add resized leading space, brackets, static text, language name
tag = nil; -- unset; don't do both project and language
end
end
if tag == cfg.this_wiki_code then
tag = nil; -- stuff like :en:<article> at en.wiki is pointless TODO: maint cat?
end
if tag then
local lang = cfg.lang_code_remap[tag] or cfg.mw_languages_by_tag_t[tag];
if lang then -- error messaging done in extract_names() where we know parameter names
one = one .. utilities.wrap_style ('interwiki', lang); -- add resized leading space, brackets, static text, language name
end
end
table.insert (name_list, one); -- add it to the list of names
table.insert (name_list, sep_one); -- add the proper name-list separator
end
end
end
local count = #name_list / 2; -- (number of names + number of separators) divided by 2
if 0 < count then
if 1 < count and not etal then
if 'amp' == format then
name_list[#name_list-2] = " & "; -- replace last separator with ampersand text
elseif 'and' == format then
if 2 == count then
name_list[#name_list-2] = cfg.presentation.sep_nl_and; -- replace last separator with 'and' text
else
name_list[#name_list-2] = cfg.presentation.sep_nl_end; -- replace last separator with '(sep) and' text
end
end
end
name_list[#name_list] = nil; -- erase the last separator
end
local result = table.concat (name_list); -- construct list
if etal and utilities.is_set (result) then -- etal may be set by |display-authors=etal but we might not have a last-first list
result = result .. sep .. ' ' .. cfg.messages['et al']; -- we've got a last-first list and etal so add et al.
end
return result, count; -- return name-list string and count of number of names (count used for editor names only)
end
--[[--------------------< M A K E _ C I T E R E F _ I D >-----------------------
Generates a CITEREF anchor ID if we have at least one name or a date. Otherwise
returns an empty string.
namelist is one of the contributor-, author-, or editor-name lists chosen in that
order. year is Year or anchor_year.
]]
local function make_citeref_id (namelist, year)
local names={}; -- a table for the one to four names and year
for i,v in ipairs (namelist) do -- loop through the list and take up to the first four last names
names[i] = v.last
if i == 4 then break end -- if four then done
end
table.insert (names, year); -- add the year at the end
local id = table.concat(names); -- concatenate names and year for CITEREF id
if utilities.is_set (id) then -- if concatenation is not an empty string
return "CITEREF" .. id; -- add the CITEREF portion
else
return ''; -- return an empty string; no reason to include CITEREF id in this citation
end
end
--[[--------------------------< C I T E _ C L A S S _A T T R I B U T E _M A K E >------------------------------
construct <cite> tag class attribute for this citation.
<cite_class> – config.CitationClass from calling template
<mode> – value from |mode= parameter
]]
local function cite_class_attribute_make (cite_class, mode)
local class_t = {};
table.insert (class_t, 'citation'); -- required for blue highlight
if 'citation' ~= cite_class then
table.insert (class_t, cite_class); -- identify this template for user css
table.insert (class_t, utilities.is_set (mode) and mode or 'cs1'); -- identify the citation style for user css or javascript
else
table.insert (class_t, utilities.is_set (mode) and mode or 'cs2'); -- identify the citation style for user css or javascript
end
for _, prop_key in ipairs (z.prop_keys_t) do
table.insert (class_t, prop_key); -- identify various properties for user css or javascript
end
return table.concat (class_t, ' '); -- make a big string and done
end
--[[---------------------< N A M E _ H A S _ E T A L >--------------------------
Evaluates the content of name parameters (author, editor, etc.) for variations on
the theme of et al. If found, the et al. is removed, a flag is set to true and
the function returns the modified name and the flag.
This function never sets the flag to false but returns its previous state because
it may have been set by previous passes through this function or by the associated
|display-<names>=etal parameter
]]
local function name_has_etal (name, etal, nocat, param)
if utilities.is_set (name) then -- name can be nil in which case just return
local patterns = cfg.et_al_patterns; -- get patterns from configuration
for _, pattern in ipairs (patterns) do -- loop through all of the patterns
if name:match (pattern) then -- if this 'et al' pattern is found in name
name = name:gsub (pattern, ''); -- remove the offending text
etal = true; -- set flag (may have been set previously here or by |display-<names>=etal)
if not nocat then -- no categorization for |vauthors=
utilities.set_message ('err_etal', {param}); -- and set an error if not added
end
end
end
end
return name, etal;
end
--[[---------------------< N A M E _ I S _ N U M E R I C >----------------------
Add maint cat when name parameter value does not contain letters. Does not catch
mixed alphanumeric names so |last=A. Green (1922-1987) does not get caught in the
current version of this test but |first=(1888) is caught.
returns nothing
]]
local function name_is_numeric (name, list_name)
if utilities.is_set (name) then
if mw.ustring.match (name, '^[%A]+$') then -- when name does not contain any letters
utilities.set_message ('maint_numeric_names', cfg.special_case_translation [list_name]); -- add a maint cat for this template
end
end
end
--[[-----------------< N A M E _ H A S _ M U L T _ N A M E S >------------------
Evaluates the content of last/surname (authors etc.) parameters for multiple names.
Multiple names are indicated if there is more than one comma or any "unescaped"
semicolons. Escaped semicolons are ones used as part of selected HTML entities.
If the condition is met, the function adds the multiple name maintenance category.
returns nothing
]]
local function name_has_mult_names (name, list_name)
local _, commas, semicolons, nbsps;
if utilities.is_set (name) then
_, commas = name:gsub (',', ''); -- count the number of commas
_, semicolons = name:gsub (';', ''); -- count the number of semicolons
-- nbsps probably should be its own separate count rather than merged in
-- some way with semicolons because Lua patterns do not support the
-- grouping operator that regex does, which means there is no way to add
-- more entities to escape except by adding more counts with the new
-- entities
_, nbsps = name:gsub (' ',''); -- count nbsps
-- There is exactly 1 semicolon per entity, so subtract nbsps
-- from semicolons to 'escape' them. If additional entities are added,
-- they also can be subtracted.
if 1 < commas or 0 < (semicolons - nbsps) then
utilities.set_message ('maint_mult_names', cfg.special_case_translation [list_name]); -- add a maint message
end
end
end
--[=[-------------------------< I S _ G E N E R I C >----------------------------------------------------------
Compares values assigned to various parameters according to the string provided as <item> in the function call.
<item> can have on of two values:
'generic_names' – for name-holding parameters: |last=, |first=, |editor-last=, etc
'generic_titles' – for |title=
There are two types of generic tests. The 'accept' tests look for a pattern that should not be rejected by the
'reject' test. For example,
|author=[[John Smith (author)|Smith, John]]
would be rejected by the 'author' reject test. But piped wikilinks with 'author' disambiguation should not be
rejected so the 'accept' test prevents that from happening. Accept tests are always performed before reject
tests.
Each of the 'accept' and 'reject' sequence tables hold tables for en.wiki (['en']) and local.wiki (['local'])
that each can hold a test sequence table The sequence table holds, at index [1], a test pattern, and, at index
[2], a boolean control value. The control value tells string.find() or mw.ustring.find() to do plain-text search (true)
or a pattern search (false). The intent of all this complexity is to make these searches as fast as possible so
that we don't run out of processing time on very large articles.
Returns
true when a reject test finds the pattern or string
false when an accept test finds the pattern or string
nil else
]=]
local function is_generic (item, value, wiki)
local test_val;
local str_lower = { -- use string.lower() for en.wiki (['en']) and use mw.ustring.lower() or local.wiki (['local'])
['en'] = string.lower,
['local'] = mw.ustring.lower,
}
local str_find = { -- use string.find() for en.wiki (['en']) and use mw.ustring.find() or local.wiki (['local'])
['en'] = string.find,
['local'] = mw.ustring.find,
}
local function test (val, test_t, wiki) -- local function to do the testing; <wiki> selects lower() and find() functions
val = test_t[2] and str_lower[wiki](value) or val; -- when <test_t[2]> set to 'true', plaintext search using lowercase value
return str_find[wiki] (val, test_t[1], 1, test_t[2]); -- return nil when not found or matched
end
local test_types_t = {'accept', 'reject'}; -- test accept patterns first, then reject patterns
local wikis_t = {'en', 'local'}; -- do tests for each of these keys; en.wiki first, local.wiki second
for _, test_type in ipairs (test_types_t) do -- for each test type
for _, generic_value in pairs (cfg.special_case_translation[item][test_type]) do -- spin through the list of generic value fragments to accept or reject
for _, wiki in ipairs (wikis_t) do
if generic_value[wiki] then
if test (value, generic_value[wiki], wiki) then -- go do the test
return ('reject' == test_type); -- param value rejected, return true; false else
end
end
end
end
end
end
--[[--------------------------< N A M E _ I S _ G E N E R I C >------------------------------------------------
calls is_generic() to determine if <name> is a 'generic name' listed in cfg.generic_names; <name_alias> is the
parameter name used in error messaging
]]
local function name_is_generic (name, name_alias)
if not added_generic_name_errs and is_generic ('generic_names', name) then
utilities.set_message ('err_generic_name', name_alias); -- set an error message
added_generic_name_errs = true;
end
end
--[[--------------------------< N A M E _ C H E C K S >--------------------------------------------------------
This function calls various name checking functions used to validate the content of the various name-holding parameters.
]]
local function name_checks (last, first, list_name, last_alias, first_alias)
local accept_name;
if utilities.is_set (last) then
last, accept_name = utilities.has_accept_as_written (last); -- remove accept-this-as-written markup when it wraps all of <last>
if not accept_name then -- <last> not wrapped in accept-as-written markup
name_has_mult_names (last, list_name); -- check for multiple names in the parameter (last only)
name_is_numeric (last, list_name); -- check for names that are composed of digits and punctuation
name_is_generic (last, last_alias); -- check for names found in the generic names list
end
end
if utilities.is_set (first) then
first, accept_name = utilities.has_accept_as_written (first); -- remove accept-this-as-written markup when it wraps all of <first>
if not accept_name then -- <first> not wrapped in accept-as-written markup
name_is_numeric (first, list_name); -- check for names that are composed of digits and punctuation
name_is_generic (first, first_alias); -- check for names found in the generic names list
end
local wl_type, D = utilities.is_wikilink (first);
if 0 ~= wl_type then
first = D;
utilities.set_message ('err_bad_paramlink', first_alias);
end
end
return last, first; -- done
end
--[[----------------------< E X T R A C T _ N A M E S >-------------------------
Gets name list from the input arguments
Searches through args in sequential order to find |lastn= and |firstn= parameters
(or their aliases), and their matching link and mask parameters. Stops searching
when both |lastn= and |firstn= are not found in args after two sequential attempts:
found |last1=, |last2=, and |last3= but doesn't find |last4= and |last5= then the
search is done.
This function emits an error message when there is a |firstn= without a matching
|lastn=. When there are 'holes' in the list of last names, |last1= and |last3=
are present but |last2= is missing, an error message is emitted. |lastn= is not
required to have a matching |firstn=.
When an author or editor parameter contains some form of 'et al.', the 'et al.'
is stripped from the parameter and a flag (etal) returned that will cause list_people()
to add the static 'et al.' text from Module:Citation/CS1/Configuration. This keeps
'et al.' out of the template's metadata. When this occurs, an error is emitted.
]]
local function extract_names(args, list_name)
local names = {}; -- table of names
local last; -- individual name components
local first;
local link;
local mask;
local i = 1; -- loop counter/indexer
local n = 1; -- output table indexer
local count = 0; -- used to count the number of times we haven't found a |last= (or alias for authors, |editor-last or alias for editors)
local etal = false; -- return value set to true when we find some form of et al. in an author parameter
local last_alias, first_alias, link_alias; -- selected parameter aliases used in error messaging
while true do
last, last_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'err_redundant_parameters', i ); -- search through args for name components beginning at 1
first, first_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'err_redundant_parameters', i );
link, link_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i );
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
if last then -- error check |lastn= alias for unknown interwiki link prefix; done here because this is where we have the parameter name
local project, language = interwiki_prefixen_get (last, true); -- true because we expect interwiki links in |lastn= to be wikilinked
if nil == project and nil == language then -- when both are nil
utilities.set_message ('err_bad_paramlink', last_alias); -- not known, emit an error message -- TODO: err_bad_interwiki?
last = utilities.remove_wiki_link (last); -- remove wikilink markup; show display value only
end
end
if link then -- error check |linkn= alias for unknown interwiki link prefix
local project, language = interwiki_prefixen_get (link, false); -- false because wiki links in |author-linkn= is an error
if nil == project and nil == language then -- when both are nil
utilities.set_message ('err_bad_paramlink', link_alias); -- not known, emit an error message -- TODO: err_bad_interwiki?
link = nil; -- unset so we don't link
link_alias = nil;
end
end
last, etal = name_has_etal (last, etal, false, last_alias); -- find and remove variations on et al.
first, etal = name_has_etal (first, etal, false, first_alias); -- find and remove variations on et al.
last, first = name_checks (last, first, list_name, last_alias, first_alias); -- multiple names, extraneous annotation, etc. checks
if first and not last then -- if there is a firstn without a matching lastn
local alias = first_alias:find ('given', 1, true) and 'given' or 'first'; -- get first or given form of the alias
utilities.set_message ('err_first_missing_last', {
first_alias, -- param name of alias missing its mate
first_alias:gsub (alias, {['first'] = 'last', ['given'] = 'surname'}), -- make param name appropriate to the alias form
}); -- add this error message
elseif not first and not last then -- if both firstn and lastn aren't found, are we done?
count = count + 1; -- number of times we haven't found last and first
if 2 <= count then -- two missing names and we give up
break; -- normal exit or there is a two-name hole in the list; can't tell which
end
else -- we have last with or without a first
local result;
link = link_title_ok (link, link_alias, last, last_alias); -- check for improper wiki-markup
if first then
link = link_title_ok (link, link_alias, first, first_alias); -- check for improper wiki-markup
end
names[n] = {last = last, first = first, link = link, mask = mask, corporate = false}; -- add this name to our names list (corporate for |vauthors= only)
n = n + 1; -- point to next location in the names table
if 1 == count then -- if the previous name was missing
utilities.set_message ('err_missing_name', {list_name:match ("(%w+)List"):lower(), i - 1}); -- add this error message
end
count = 0; -- reset the counter, we're looking for two consecutive missing names
end
i = i + 1; -- point to next args location
end
return names, etal; -- all done, return our list of names and the etal flag
end
--[[--------------------------< N A M E _ T A G _ G E T >------------------------------------------------------
attempt to decode |language=<lang_param> and return language name and matching tag; nil else.
This function looks for:
<lang_param> as a tag in cfg.lang_code_remap{}
<lang_param> as a name in cfg.lang_name_remap{}
<lang_param> as a name in cfg.mw_languages_by_name_t
<lang_param> as a tag in cfg.mw_languages_by_tag_t
when those fail, presume that <lang_param> is an IETF-like tag that MediaWiki does not recognize. Strip all
script, region, variant, whatever subtags from <lang_param> to leave just a two or three character language tag
and look for the new <lang_param> in cfg.mw_languages_by_tag_t{}
on success, returns name (in properly capitalized form) and matching tag (in lowercase); on failure returns nil
]]
local function name_tag_get (lang_param)
local lang_param_lc = mw.ustring.lower (lang_param); -- use lowercase as an index into the various tables
local name;
local tag;
name = cfg.lang_code_remap[lang_param_lc]; -- assume <lang_param_lc> is a tag; attempt to get remapped language name
if name then -- when <name>, <lang_param> is a tag for a remapped language name
return name, lang_param_lc; -- so return <name> from remap and <lang_param_lc>
end
tag = lang_param_lc:match ('^(%a%a%a?)%-.*'); -- still assuming that <lang_param_lc> is a tag; strip script, region, variant subtags
name = cfg.lang_code_remap[tag]; -- attempt to get remapped language name with language subtag only
if name then -- when <name>, <tag> is a tag for a remapped language name
return name, tag; -- so return <name> from remap and <tag>
end
if cfg.lang_name_remap[lang_param_lc] then -- not a tag, assume <lang_param_lc> is a name; attempt to get remapped language tag
return cfg.lang_name_remap[lang_param_lc][1], cfg.lang_name_remap[lang_param_lc][2]; -- for this <lang_param_lc>, return a (possibly) new name and appropriate tag
end
tag = cfg.mw_languages_by_name_t[lang_param_lc]; -- assume that <lang_param_lc> is a language name; attempt to get its matching tag
if tag then
return cfg.mw_languages_by_tag_t[tag], tag; -- <lang_param_lc> is a name so return the name from the table and <tag>
end
name = cfg.mw_languages_by_tag_t[lang_param_lc]; -- assume that <lang_param_lc> is a tag; attempt to get its matching language name
if name then
return name, lang_param_lc; -- <lang_param_lc> is a tag so return it and <name>
end
tag = lang_param_lc:match ('^(%a%a%a?)%-.*'); -- is <lang_param_lc> an IETF-like tag that MediaWiki doesn't recognize? <tag> gets the language subtag; nil else
if tag then
name = cfg.mw_languages_by_tag_t[tag]; -- attempt to get a language name using the shortened <tag>
if name then
return name, tag; -- <lang_param_lc> is an unrecognized IETF-like tag so return <name> and language subtag
end
end
end
--[[-------------------< L A N G U A G E _ P A R A M E T E R >------------------
Gets language name from a provided two- or three-character ISO 639 code. If a code
is recognized by MediaWiki, use the returned name; if not, then use the value that
was provided with the language parameter.
When |language= contains a recognized language (either code or name), the page is
assigned to the category for that code: Category:Norwegian-language sources (no).
For valid three-character code languages, the page is assigned to the single category
for '639-2' codes: Category:CS1 ISO 639-2 language sources.
Languages that are the same as the local wiki are not categorized. MediaWiki does
not recognize three-character equivalents of two-character codes: code 'ar' is
recognized but code 'ara' is not.
This function supports multiple languages in the form |language=nb, French, th
where the language names or codes are separated from each other by commas with
optional space characters.
]]
local function language_parameter (lang)
local tag; -- some form of IETF-like language tag; language subtag with optional region, sript, vatiant, etc subtags
local lang_subtag; -- ve populates |language= with mostly unecessary region subtags the MediaWiki does not recognize; this is the base language subtag
local name; -- the language name
local language_list = {}; -- table of language names to be rendered
local names_t = {}; -- table made from the value assigned to |language=
local this_wiki_name = mw.language.fetchLanguageName (cfg.this_wiki_code, cfg.this_wiki_code); -- get this wiki's language name
names_t = mw.text.split (lang, '%s*,%s*'); -- names should be a comma separated list
for _, lang in ipairs (names_t) do -- reuse lang here because we don't yet know if lang is a language name or a language tag
name, tag = name_tag_get (lang); -- attempt to get name/tag pair for <lang>; <name> has proper capitalization; <tag> is lowercase
if utilities.is_set (tag) then
lang_subtag = tag:gsub ('^(%a%a%a?)%-.*', '%1'); -- for categorization, strip any IETF-like tags from language tag
if cfg.this_wiki_code ~= lang_subtag then -- when the language is not the same as this wiki's language
if 2 == lang_subtag:len() then -- and is a two-character tag
utilities.add_prop_cat ('foreign-lang-source', {name, tag}, lang_subtag); -- categorize it; tag appended to allow for multiple language categorization
else -- or is a recognized language (but has a three-character tag)
utilities.add_prop_cat ('foreign-lang-source-2', {lang_subtag}, lang_subtag); -- categorize it differently TODO: support multiple three-character tag categories per cs1|2 template?
end
elseif cfg.local_lang_cat_enable then -- when the language and this wiki's language are the same and categorization is enabled
utilities.add_prop_cat ('local-lang-source', {name, lang_subtag}); -- categorize it
end
else
name = lang; -- return whatever <lang> has so that we show something
utilities.set_message ('maint_unknown_lang'); -- add maint category if not already added
end
table.insert (language_list, name);
name = ''; -- so we can reuse it
end
name = utilities.make_sep_list (#language_list, language_list);
if (1 == #language_list) and (lang_subtag == cfg.this_wiki_code) then -- when only one language, find lang name in this wiki lang name; for |language=en-us, 'English' in 'American English'
return ''; -- if one language and that language is this wiki's return an empty string (no annotation)
end
return (" " .. wrap_msg ('language', name)); -- otherwise wrap with '(in ...)'
--[[ TODO: should only return blank or name rather than full list
so we can clean up the bunched parenthetical elements Language, Type, Format
]]
end
--[[-----------------------< S E T _ C S _ S T Y L E >--------------------------
Gets the default CS style configuration for the given mode.
Returns default separator and either postscript as passed in or the default.
In CS1, the default postscript and separator are '.'.
In CS2, the default postscript is the empty string and the default separator is ','.
]]
local function set_cs_style (postscript, mode)
if utilities.is_set(postscript) then
-- emit a maintenance message if user postscript is the default cs1 postscript
-- we catch the opposite case for cs2 in set_style
if mode == 'cs1' and postscript == cfg.presentation['ps_' .. mode] then
utilities.set_message ('maint_postscript');
end
else
postscript = cfg.presentation['ps_' .. mode];
end
return cfg.presentation['sep_' .. mode], postscript;
end
--[[--------------------------< S E T _ S T Y L E >-----------------------------
Sets the separator and postscript styles. Checks the |mode= first and the
#invoke CitationClass second. Removes the postscript if postscript == none.
]]
local function set_style (mode, postscript, cite_class)
local sep;
if 'cs2' == mode then
sep, postscript = set_cs_style (postscript, 'cs2');
elseif 'cs1' == mode then
sep, postscript = set_cs_style (postscript, 'cs1');
elseif 'citation' == cite_class then
sep, postscript = set_cs_style (postscript, 'cs2');
else
sep, postscript = set_cs_style (postscript, 'cs1');
end
if cfg.keywords_xlate[postscript:lower()] == 'none' then
-- emit a maintenance message if user postscript is the default cs2 postscript
-- we catch the opposite case for cs1 in set_cs_style
if 'cs2' == mode or 'citation' == cite_class then
utilities.set_message ('maint_postscript');
end
postscript = '';
end
return sep, postscript
end
--[=[-------------------------< I S _ P D F >-----------------------------------
Determines if a URL has the file extension that is one of the PDF file extensions
used by [[MediaWiki:Common.css]] when applying the PDF icon to external links.
returns true if file extension is one of the recognized extensions, else false
]=]
local function is_pdf (url)
return url:match ('%.pdf$') or url:match ('%.PDF$') or
url:match ('%.pdf[%?#]') or url:match ('%.PDF[%?#]') or
url:match ('%.PDF#') or url:match ('%.pdf#');
end
--[[--------------------------< S T Y L E _ F O R M A T >-----------------------
Applies CSS style to |format=, |chapter-format=, etc. Also emits an error message
if the format parameter does not have a matching URL parameter. If the format parameter
is not set and the URL contains a file extension that is recognized as a PDF document
by MediaWiki's commons.css, this code will set the format parameter to (PDF) with
the appropriate styling.
]]
local function style_format (format, url, fmt_param, url_param)
if utilities.is_set (format) then
format = utilities.wrap_style ('format', format); -- add leading space, parentheses, resize
if not utilities.is_set (url) then
utilities.set_message ('err_format_missing_url', {fmt_param, url_param}); -- add an error message
end
elseif is_pdf (url) then -- format is not set so if URL is a PDF file then
format = utilities.wrap_style ('format', 'PDF'); -- set format to PDF
else
format = ''; -- empty string for concatenation
end
return format;
end
--[[---------------------< G E T _ D I S P L A Y _ N A M E S >------------------
Returns a number that defines the number of names displayed for author and editor
name lists and a Boolean flag to indicate when et al. should be appended to the name list.
When the value assigned to |display-xxxxors= is a number greater than or equal to zero,
return the number and the previous state of the 'etal' flag (false by default
but may have been set to true if the name list contains some variant of the text 'et al.').
When the value assigned to |display-xxxxors= is the keyword 'etal', return a number
that is one greater than the number of authors in the list and set the 'etal' flag true.
This will cause the list_people() to display all of the names in the name list followed by 'et al.'
In all other cases, returns nil and the previous state of the 'etal' flag.
inputs:
max: A['DisplayAuthors'] or A['DisplayEditors']; a number or some flavor of etal
count: #a or #e
list_name: 'authors' or 'editors'
etal: author_etal or editor_etal
]]
local function get_display_names (max, count, list_name, etal, param)
if utilities.is_set (max) then
if 'etal' == max:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings
max = count + 1; -- number of authors + 1 so display all author name plus et al.
etal = true; -- overrides value set by extract_names()
elseif max:match ('^%d+$') then -- if is a string of numbers
max = tonumber (max); -- make it a number
if max >= count then -- if |display-xxxxors= value greater than or equal to number of authors/editors
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil;
end
else -- not a valid keyword or number
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil; -- unset; as if |display-xxxxors= had not been set
end
end
return max, etal;
end
--[[----------< E X T R A _ T E X T _ I N _ P A G E _ C H E C K >---------------
Adds error if |page=, |pages=, |quote-page=, |quote-pages= has what appears to be
some form of p. or pp. abbreviation in the first characters of the parameter content.
check page for extraneous p, p., pp, pp., pg, pg. at start of parameter value:
good pattern: '^P[^%.P%l]' matches when page begins PX or P# but not Px
where x and X are letters and # is a digit
bad pattern: '^[Pp][PpGg]' matches when page begins pp, pP, Pp, PP, pg, pG, Pg, PG
]]
local function extra_text_in_page_check (val, name)
if not val:match (cfg.vol_iss_pg_patterns.good_ppattern) then
for _, pattern in ipairs (cfg.vol_iss_pg_patterns.bad_ppatterns) do -- spin through the selected sequence table of patterns
if val:match (pattern) then -- when a match, error so
utilities.set_message ('err_extra_text_pages', name); -- add error message
return; -- and done
end
end
end
end
--[[--------------------------< E X T R A _ T E X T _ I N _ V O L _ I S S _ C H E C K >------------------------
Adds error if |volume= or |issue= has what appears to be some form of redundant 'type' indicator.
For |volume=:
'V.', or 'Vol.' (with or without the dot) abbreviations or 'Volume' in the first characters of the parameter
content (all case insensitive). 'V' and 'v' (without the dot) are presumed to be roman numerals so
are allowed.
For |issue=:
'No.', 'I.', 'Iss.' (with or without the dot) abbreviations, or 'Issue' in the first characters of the
parameter content (all case insensitive).
Single character values ('v', 'i', 'n') allowed when not followed by separator character ('.', ':', '=', or
whitespace character) – param values are trimmed of whitespace by MediaWiki before delivered to the module.
<val> is |volume= or |issue= parameter value
<name> is |volume= or |issue= parameter name for error message
<selector> is 'v' for |volume=, 'i' for |issue=
sets error message on failure; returns nothing
]]
local function extra_text_in_vol_iss_check (val, name, selector)
if not utilities.is_set (val) then
return;
end
local patterns = 'v' == selector and cfg.vol_iss_pg_patterns.vpatterns or cfg.vol_iss_pg_patterns.ipatterns;
local handler = 'v' == selector and 'err_extra_text_volume' or 'err_extra_text_issue';
val = val:lower(); -- force parameter value to lower case
for _, pattern in ipairs (patterns) do -- spin through the selected sequence table of patterns
if val:match (pattern) then -- when a match, error so
utilities.set_message (handler, name); -- add error message
return; -- and done
end
end
end
--[=[-------------------------< G E T _ V _ N A M E _ T A B L E >----------------------------------------------
split apart a |vauthors= or |veditors= parameter. This function allows for corporate names, wrapped in doubled
parentheses to also have commas; in the old version of the code, the doubled parentheses were included in the
rendered citation and in the metadata. Individual author names may be wikilinked
|vauthors=Jones AB, [[E. B. White|White EB]], ((Black, Brown, and Co.))
]=]
local function get_v_name_table (vparam, output_table, output_link_table)
local name_table = mw.text.split(vparam, "%s*,%s*"); -- names are separated by commas
local wl_type, label, link; -- wl_type not used here; just a placeholder
local i = 1;
while name_table[i] do
if name_table[i]:match ('^%(%(.*[^%)][^%)]$') then -- first segment of corporate with one or more commas; this segment has the opening doubled parentheses
local name = name_table[i];
i = i + 1; -- bump indexer to next segment
while name_table[i] do
name = name .. ', ' .. name_table[i]; -- concatenate with previous segments
if name_table[i]:match ('^.*%)%)$') then -- if this table member has the closing doubled parentheses
break; -- and done reassembling so
end
i = i + 1; -- bump indexer
end
table.insert (output_table, name); -- and add corporate name to the output table
table.insert (output_link_table, ''); -- no wikilink
else
wl_type, label, link = utilities.is_wikilink (name_table[i]); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
table.insert (output_table, label); -- add this name
if 1 == wl_type then
table.insert (output_link_table, label); -- simple wikilink [[D]]
else
table.insert (output_link_table, link); -- no wikilink or [[L|D]]; add this link if there is one, else empty string
end
end
i = i + 1;
end
return output_table;
end
--[[--------------------------< P A R S E _ V A U T H O R S _ V E D I T O R S >--------------------------------
This function extracts author / editor names from |vauthors= or |veditors= and finds matching |xxxxor-maskn= and
|xxxxor-linkn= in args. It then returns a table of assembled names just as extract_names() does.
Author / editor names in |vauthors= or |veditors= must be in Vancouver system style. Corporate or institutional names
may sometimes be required and because such names will often fail the is_good_vanc_name() and other format compliance
tests, are wrapped in doubled parentheses ((corporate name)) to suppress the format tests.
Supports generational suffixes Jr, 2nd, 3rd, 4th–6th.
This function sets the Vancouver error when a required comma is missing and when there is a space between an author's initials.
]]
local function parse_vauthors_veditors (args, vparam, list_name)
local names = {}; -- table of names assembled from |vauthors=, |author-maskn=, |author-linkn=
local v_name_table = {};
local v_link_table = {}; -- when name is wikilinked, targets go in this table
local etal = false; -- return value set to true when we find some form of et al. vauthors parameter
local last, first, link, mask, suffix;
local corporate = false;
vparam, etal = name_has_etal (vparam, etal, true); -- find and remove variations on et al. do not categorize (do it here because et al. might have a period)
v_name_table = get_v_name_table (vparam, v_name_table, v_link_table); -- names are separated by commas
for i, v_name in ipairs(v_name_table) do
first = ''; -- set to empty string for concatenation and because it may have been set for previous author/editor
local accept_name;
v_name, accept_name = utilities.has_accept_as_written (v_name); -- remove accept-this-as-written markup when it wraps all of <v_name>
if accept_name then
last = v_name;
corporate = true; -- flag used in list_people()
elseif string.find(v_name, "%s") then
if v_name:find('[;%.]') then -- look for commonly occurring punctuation characters;
add_vanc_error (cfg.err_msg_supl.punctuation, i);
end
local lastfirstTable = {}
lastfirstTable = mw.text.split(v_name, "%s+")
first = table.remove(lastfirstTable); -- removes and returns value of last element in table which should be initials or generational suffix
if not mw.ustring.match (first, '^%u+$') then -- mw.ustring here so that later we will catch non-Latin characters
suffix = first; -- not initials so assume that whatever we got is a generational suffix
first = table.remove(lastfirstTable); -- get what should be the initials from the table
end
last = table.concat(lastfirstTable, ' ') -- returns a string that is the concatenation of all other names that are not initials and generational suffix
if not utilities.is_set (last) then
first = ''; -- unset
last = v_name; -- last empty because something wrong with first
add_vanc_error (cfg.err_msg_supl.name, i);
end
if mw.ustring.match (last, '%a+%s+%u+%s+%a+') then
add_vanc_error (cfg.err_msg_supl['missing comma'], i); -- matches last II last; the case when a comma is missing
end
if mw.ustring.match (v_name, ' %u %u$') then -- this test is in the wrong place TODO: move or replace with a more appropriate test
add_vanc_error (cfg.err_msg_supl.initials, i); -- matches a space between two initials
end
else
last = v_name; -- last name or single corporate name? Doesn't support multiword corporate names? do we need this?
end
if utilities.is_set (first) then
if not mw.ustring.match (first, "^%u?%u$") then -- first shall contain one or two upper-case letters, nothing else
add_vanc_error (cfg.err_msg_supl.initials, i); -- too many initials; mixed case initials (which may be ok Romanization); hyphenated initials
end
is_good_vanc_name (last, first, suffix, i); -- check first and last before restoring the suffix which may have a non-Latin digit
if utilities.is_set (suffix) then
first = first .. ' ' .. suffix; -- if there was a suffix concatenate with the initials
suffix = ''; -- unset so we don't add this suffix to all subsequent names
end
else
if not corporate then
is_good_vanc_name (last, '', nil, i);
end
end
link = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i ) or v_link_table[i];
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
names[i] = {last = last, first = first, link = link, mask = mask, corporate = corporate}; -- add this assembled name to our names list
end
return names, etal; -- all done, return our list of names
end
--[[--------------------------< S E L E C T _ A U T H O R _ E D I T O R _ S O U R C E >------------------------
Select one of |authors=, |authorn= / |lastn / firstn=, or |vauthors= as the source of the author name list or
select one of |editorn= / editor-lastn= / |editor-firstn= or |veditors= as the source of the editor name list.
Only one of these appropriate three will be used. The hierarchy is: |authorn= (and aliases) highest and |authors= lowest;
|editorn= (and aliases) highest and |veditors= lowest (support for |editors= withdrawn)
When looking for |authorn= / |editorn= parameters, test |xxxxor1= and |xxxxor2= (and all of their aliases); stops after the second
test which mimicks the test used in extract_names() when looking for a hole in the author name list. There may be a better
way to do this, I just haven't discovered what that way is.
Emits an error message when more than one xxxxor name source is provided.
In this function, vxxxxors = vauthors or veditors; xxxxors = authors as appropriate.
]]
local function select_author_editor_source (vxxxxors, xxxxors, args, list_name)
local lastfirst = false;
if utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 1 ) or -- do this twice in case we have a |first1= without a |last1=; this ...
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 1 ) or -- ... also catches the case where |first= is used with |vauthors=
utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 2 ) or
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 2 ) then
lastfirst = true;
end
if (utilities.is_set (vxxxxors) and true == lastfirst) or -- these are the three error conditions
(utilities.is_set (vxxxxors) and utilities.is_set (xxxxors)) or
(true == lastfirst and utilities.is_set (xxxxors)) then
local err_name;
if 'AuthorList' == list_name then -- figure out which name should be used in error message
err_name = 'author';
else
err_name = 'editor';
end
utilities.set_message ('err_redundant_parameters', err_name .. '-name-list parameters'); -- add error message
end
if true == lastfirst then return 1 end; -- return a number indicating which author name source to use
if utilities.is_set (vxxxxors) then return 2 end;
if utilities.is_set (xxxxors) then return 3 end;
return 1; -- no authors so return 1; this allows missing author name test to run in case there is a first without last
end
--[[--------------------------< I S _ V A L I D _ P A R A M E T E R _ V A L U E >------------------------------
This function is used to validate a parameter's assigned value for those parameters that have only a limited number
of allowable values (yes, y, true, live, dead, etc.). When the parameter value has not been assigned a value (missing
or empty in the source template) the function returns the value specified by ret_val. If the parameter value is one
of the list of allowed values returns the translated value; else, emits an error message and returns the value
specified by ret_val.
TODO: explain <invert>
]]
local function is_valid_parameter_value (value, name, possible, ret_val, invert)
if not utilities.is_set (value) then
return ret_val; -- an empty parameter is ok
end
if (not invert and utilities.in_array (value, possible)) then -- normal; <value> is in <possible> table
return cfg.keywords_xlate[value]; -- return translation of parameter keyword
elseif invert and not utilities.in_array (value, possible) then -- invert; <value> is not in <possible> table
return value; -- return <value> as it is
else
utilities.set_message ('err_invalid_param_val', {name, value}); -- not an allowed value so add error message
return ret_val;
end
end
--[[--------------------------< T E R M I N A T E _ N A M E _ L I S T >----------------------------------------
This function terminates a name list (author, contributor, editor) with a separator character (sepc) and a space
when the last character is not a sepc character or when the last three characters are not sepc followed by two
closing square brackets (close of a wikilink). When either of these is true, the name_list is terminated with a
single space character.
]]
local function terminate_name_list (name_list, sepc)
if (string.sub (name_list, -3, -1) == sepc .. '. ') then -- if already properly terminated
return name_list; -- just return the name list
elseif (string.sub (name_list, -1, -1) == sepc) or (string.sub (name_list, -3, -1) == sepc .. ']]') then -- if last name in list ends with sepc char
return name_list .. " "; -- don't add another
else
return name_list .. sepc .. ' '; -- otherwise terminate the name list
end
end
--[[-------------------------< F O R M A T _ V O L U M E _ I S S U E >-----------------------------------------
returns the concatenation of the formatted volume and issue (or journal article number) parameters as a single
string; or formatted volume or formatted issue, or an empty string if neither are set.
]]
local function format_volume_issue (volume, issue, article, cite_class, origin, sepc, lower)
if not utilities.is_set (volume) and not utilities.is_set (issue) and not utilities.is_set (article) then
return '';
end
-- same condition as in format_pages_sheets()
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
local is_numeric_vol = volume and (volume:match ('^[MDCLXVI]+$') or volume:match ('^%d+$')); -- is only uppercase roman numerals or only digits?
local is_long_vol = volume and (4 < mw.ustring.len(volume)); -- is |volume= value longer than 4 characters?
if volume and (not is_numeric_vol and is_long_vol) then -- when not all digits or Roman numerals, is |volume= longer than 4 characters?
utilities.add_prop_cat ('long-vol'); -- yes, add properties cat
end
if is_journal then -- journal-style formatting
local vol = '';
if utilities.is_set (volume) then
if is_numeric_vol then -- |volume= value all digits or all uppercase Roman numerals?
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, volume}); -- render in bold face
elseif is_long_vol then -- not all digits or Roman numerals; longer than 4 characters?
vol = utilities.substitute (cfg.messages['j-vol'], {sepc, utilities.hyphen_to_dash (volume)}); -- not bold
else -- four or fewer characters
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, utilities.hyphen_to_dash (volume)}); -- bold
end
end
vol = vol .. (utilities.is_set (issue) and utilities.substitute (cfg.messages['j-issue'], issue) or '')
vol = vol .. (utilities.is_set (article) and utilities.substitute (cfg.messages['j-article-num'], article) or '')
return vol;
end
if 'podcast' == cite_class and utilities.is_set (issue) then
return wrap_msg ('issue', {sepc, issue}, lower);
end
if 'conference' == cite_class and utilities.is_set (article) then -- |article-number= supported only in journal and conference cites
if utilities.is_set (volume) and utilities.is_set (article) then -- both volume and article number
return wrap_msg ('vol-art', {sepc, utilities.hyphen_to_dash (volume), article}, lower);
elseif utilities.is_set (article) then -- article number alone; when volume alone, handled below
return wrap_msg ('art', {sepc, article}, lower);
end
end
-- all other types of citation
if utilities.is_set (volume) and utilities.is_set (issue) then
return wrap_msg ('vol-no', {sepc, utilities.hyphen_to_dash (volume), issue}, lower);
elseif utilities.is_set (volume) then
return wrap_msg ('vol', {sepc, utilities.hyphen_to_dash (volume)}, lower);
else
return wrap_msg ('issue', {sepc, issue}, lower);
end
end
--[[-------------------------< F O R M A T _ P A G E S _ S H E E T S >-----------------------------------------
adds static text to one of |page(s)= or |sheet(s)= values and returns it with all of the others set to empty strings.
The return order is:
page, pages, sheet, sheets
Singular has priority over plural when both are provided.
]]
local function format_pages_sheets (page, pages, sheet, sheets, cite_class, origin, sepc, nopp, lower)
if 'map' == cite_class then -- only cite map supports sheet(s) as in-source locators
if utilities.is_set (sheet) then
if 'journal' == origin then
return '', '', wrap_msg ('j-sheet', sheet, lower), '';
else
return '', '', wrap_msg ('sheet', {sepc, sheet}, lower), '';
end
elseif utilities.is_set (sheets) then
if 'journal' == origin then
return '', '', '', wrap_msg ('j-sheets', sheets, lower);
else
return '', '', '', wrap_msg ('sheets', {sepc, sheets}, lower);
end
end
end
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
if utilities.is_set (page) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], page), '', '', '';
elseif not nopp then
return utilities.substitute (cfg.messages['p-prefix'], {sepc, page}), '', '', '';
else
return utilities.substitute (cfg.messages['nopp'], {sepc, page}), '', '', '';
end
elseif utilities.is_set (pages) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], pages), '', '', '';
elseif tonumber(pages) ~= nil and not nopp then -- if pages is only digits, assume a single page number
return '', utilities.substitute (cfg.messages['p-prefix'], {sepc, pages}), '', '';
elseif not nopp then
return '', utilities.substitute (cfg.messages['pp-prefix'], {sepc, pages}), '', '';
else
return '', utilities.substitute (cfg.messages['nopp'], {sepc, pages}), '', '';
end
end
return '', '', '', ''; -- return empty strings
end
--[[--------------------------< I N S O U R C E _ L O C _ G E T >----------------------------------------------
returns one of the in-source locators: page, pages, or at.
If any of these are interwiki links to Wikisource, returns the label portion of the interwiki-link as plain text
for use in COinS. This COinS thing is done because here we convert an interwiki-link to an external link and
add an icon span around that; get_coins_pages() doesn't know about the span. TODO: should it?
TODO: add support for sheet and sheets?; streamline;
TODO: make it so that this function returns only one of the three as the single in-source (the return value assigned
to a new name)?
]]
local function insource_loc_get (page, page_orig, pages, pages_orig, at)
local ws_url, ws_label, coins_pages, L; -- for Wikisource interwiki-links; TODO: this corrupts page metadata (span remains in place after cleanup; fix there?)
if utilities.is_set (page) then
if utilities.is_set (pages) or utilities.is_set (at) then
pages = ''; -- unset the others
at = '';
end
extra_text_in_page_check (page, page_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (page); -- make ws URL from |page= interwiki link; link portion L becomes tooltip label
if ws_url then
page = external_link (ws_url, ws_label .. ' ', 'ws link in page'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
page = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, page});
coins_pages = ws_label;
end
elseif utilities.is_set (pages) then
if utilities.is_set (at) then
at = ''; -- unset
end
extra_text_in_page_check (pages, pages_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (pages); -- make ws URL from |pages= interwiki link; link portion L becomes tooltip label
if ws_url then
pages = external_link (ws_url, ws_label .. ' ', 'ws link in pages'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
pages = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, pages});
coins_pages = ws_label;
end
elseif utilities.is_set (at) then
ws_url, ws_label, L = wikisource_url_make (at); -- make ws URL from |at= interwiki link; link portion L becomes tooltip label
if ws_url then
at = external_link (ws_url, ws_label .. ' ', 'ws link in at'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
at = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, at});
coins_pages = ws_label;
end
end
return page, pages, at, coins_pages;
end
--[[--------------------------< I S _ U N I Q U E _ A R C H I V E _ U R L >------------------------------------
add error message when |archive-url= value is same as |url= or chapter-url= (or alias...) value
]]
local function is_unique_archive_url (archive, url, c_url, source, date)
if utilities.is_set (archive) then
if archive == url or archive == c_url then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)}); -- add error message
return '', ''; -- unset |archive-url= and |archive-date= because same as |url= or |chapter-url=
end
end
return archive, date;
end
--[=[-------------------------< A R C H I V E _ U R L _ C H E C K >--------------------------------------------
Check archive.org URLs to make sure they at least look like they are pointing at valid archives and not to the
save snapshot URL or to calendar pages. When the archive URL is 'https://web.archive.org/save/' (or http://...)
archive.org saves a snapshot of the target page in the URL. That is something that Wikipedia should not allow
unwitting readers to do.
When the archive.org URL does not have a complete timestamp, archive.org chooses a snapshot according to its own
algorithm or provides a calendar 'search' result. [[WP:ELNO]] discourages links to search results.
This function looks at the value assigned to |archive-url= and returns empty strings for |archive-url= and
|archive-date= and an error message when:
|archive-url= holds an archive.org save command URL
|archive-url= is an archive.org URL that does not have a complete timestamp (YYYYMMDDhhmmss 14 digits) in the
correct place
otherwise returns |archive-url= and |archive-date=
There are two mostly compatible archive.org URLs:
//web.archive.org/<timestamp>... -- the old form
//web.archive.org/web/<timestamp>... -- the new form
The old form does not support or map to the new form when it contains a display flag. There are four identified flags
('id_', 'js_', 'cs_', 'im_') but since archive.org ignores others following the same form (two letters and an underscore)
we don't check for these specific flags but we do check the form.
This function supports a preview mode. When the article is rendered in preview mode, this function may return a modified
archive URL:
for save command errors, return undated wildcard (/*/)
for timestamp errors when the timestamp has a wildcard, return the URL unmodified
for timestamp errors when the timestamp does not have a wildcard, return with timestamp limited to six digits plus wildcard (/yyyymm*/)
]=]
local function archive_url_check (url, date)
local err_msg = ''; -- start with the error message empty
local path, timestamp, flag; -- portions of the archive.org URL
if (not url:match('//web%.archive%.org/')) and (not url:match('//liveweb%.archive%.org/')) then -- also deprecated liveweb Wayback machine URL
return url, date; -- not an archive.org archive, return ArchiveURL and ArchiveDate
end
if url:match('//web%.archive%.org/save/') then -- if a save command URL, we don't want to allow saving of the target page
err_msg = cfg.err_msg_supl.save;
url = url:gsub ('(//web%.archive%.org)/save/', '%1/*/', 1); -- for preview mode: modify ArchiveURL
elseif url:match('//liveweb%.archive%.org/') then
err_msg = cfg.err_msg_supl.liveweb;
else
path, timestamp, flag = url:match('//web%.archive%.org/([^%d]*)(%d+)([^/]*)/'); -- split out some of the URL parts for evaluation
if not path then -- malformed in some way; pattern did not match
err_msg = cfg.err_msg_supl.timestamp;
elseif 14 ~= timestamp:len() then -- path and flag optional, must have 14-digit timestamp here
err_msg = cfg.err_msg_supl.timestamp;
if '*' ~= flag then
local replacement = timestamp:match ('^%d%d%d%d%d%d') or timestamp:match ('^%d%d%d%d'); -- get the first 6 (YYYYMM) or first 4 digits (YYYY)
if replacement then -- nil if there aren't at least 4 digits (year)
replacement = replacement .. string.rep ('0', 14 - replacement:len()); -- year or yearmo (4 or 6 digits) zero-fill to make 14-digit timestamp
url=url:gsub ('(//web%.archive%.org/[^%d]*)%d[^/]*', '%1' .. replacement .. '*', 1) -- for preview, modify ts to 14 digits plus splat for calendar display
end
end
elseif utilities.is_set (path) and 'web/' ~= path then -- older archive URLs do not have the extra 'web/' path element
err_msg = cfg.err_msg_supl.path;
elseif utilities.is_set (flag) and not utilities.is_set (path) then -- flag not allowed with the old form URL (without the 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
elseif utilities.is_set (flag) and not flag:match ('%a%a_') then -- flag if present must be two alpha characters and underscore (requires 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
else
return url, date; -- return ArchiveURL and ArchiveDate
end
end
-- if here, something not right so
utilities.set_message ('err_archive_url', {err_msg}); -- add error message and
if is_preview_mode then
return url, date; -- preview mode so return ArchiveURL and ArchiveDate
else
return '', ''; -- return empty strings for ArchiveURL and ArchiveDate
end
end
--[[--------------------------< P L A C E _ C H E C K >--------------------------------------------------------
check |place=, |publication-place=, |location= to see if these params include digits. This function added because
many editors misuse location to specify the in-source location (|page(s)= and |at= are supposed to do that)
returns the original parameter value without modification; added maint cat when parameter value contains digits
]]
local function place_check (param_val)
if not utilities.is_set (param_val) then -- parameter empty or omitted
return param_val; -- return that empty state
end
if mw.ustring.find (param_val, '%d') then -- not empty, are there digits in the parameter value
utilities.set_message ('maint_location'); -- yep, add maint cat
end
return param_val; -- and done
end
--[[--------------------------< I S _ A R C H I V E D _ C O P Y >----------------------------------------------
compares |title= to 'Archived copy' (placeholder added by bots that can't find proper title); if matches, return true; nil else
]]
local function is_archived_copy (title)
title = mw.ustring.lower(title); -- switch title to lower case
if title:find (cfg.special_case_translation.archived_copy.en) then -- if title is 'Archived copy'
return true;
elseif cfg.special_case_translation.archived_copy['local'] then
if mw.ustring.find (title, cfg.special_case_translation.archived_copy['local']) then -- mw.ustring() because might not be Latin script
return true;
end
end
end
--[[--------------------------< C I T A T I O N 0 >------------------------------------------------------------
This is the main function doing the majority of the citation formatting.
]]
local function citation0( config, args )
--[[
Load Input Parameters
The argument_wrapper facilitates the mapping of multiple aliases to single internal variable.
]]
local A = argument_wrapper ( args );
local i
-- Pick out the relevant fields from the arguments. Different citation templates
-- define different field names for the same underlying things.
local author_etal;
local a = {}; -- authors list from |lastn= / |firstn= pairs or |vauthors=
local Authors;
local NameListStyle = is_valid_parameter_value (A['NameListStyle'], A:ORIGIN('NameListStyle'), cfg.keywords_lists['name-list-style'], '');
local Collaboration = A['Collaboration'];
do -- to limit scope of selected
local selected = select_author_editor_source (A['Vauthors'], A['Authors'], args, 'AuthorList');
if 1 == selected then
a, author_etal = extract_names (args, 'AuthorList'); -- fetch author list from |authorn= / |lastn= / |firstn=, |author-linkn=, and |author-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
a, author_etal = parse_vauthors_veditors (args, args.vauthors, 'AuthorList'); -- fetch author list from |vauthors=, |author-linkn=, and |author-maskn=
elseif 3 == selected then
Authors = A['Authors']; -- use content of |authors=
if 'authors' == A:ORIGIN('Authors') then -- but add a maint cat if the parameter is |authors=
utilities.set_message ('maint_authors'); -- because use of this parameter is discouraged; what to do about the aliases is a TODO:
end
end
if utilities.is_set (Collaboration) then
author_etal = true; -- so that |display-authors=etal not required
end
end
local editor_etal;
local e = {}; -- editors list from |editor-lastn= / |editor-firstn= pairs or |veditors=
do -- to limit scope of selected
local selected = select_author_editor_source (A['Veditors'], nil, args, 'EditorList'); -- support for |editors= withdrawn
if 1 == selected then
e, editor_etal = extract_names (args, 'EditorList'); -- fetch editor list from |editorn= / |editor-lastn= / |editor-firstn=, |editor-linkn=, and |editor-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
e, editor_etal = parse_vauthors_veditors (args, args.veditors, 'EditorList'); -- fetch editor list from |veditors=, |editor-linkn=, and |editor-maskn=
end
end
local Chapter = A['Chapter']; -- done here so that we have access to |contribution= from |chapter= aliases
local Chapter_origin = A:ORIGIN ('Chapter');
local Contribution; -- because contribution is required for contributor(s)
if 'contribution' == Chapter_origin then
Contribution = Chapter; -- get the name of the contribution
end
local c = {}; -- contributors list from |contributor-lastn= / contributor-firstn= pairs
if utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (A['Periodical']) then -- |contributor= and |contribution= only supported in book cites
c = extract_names (args, 'ContributorList'); -- fetch contributor list from |contributorn= / |contributor-lastn=, -firstn=, -linkn=, -maskn=
if 0 < #c then
if not utilities.is_set (Contribution) then -- |contributor= requires |contribution=
utilities.set_message ('err_contributor_missing_required_param', 'contribution'); -- add missing contribution error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
if 0 == #a then -- |contributor= requires |author=
utilities.set_message ('err_contributor_missing_required_param', 'author'); -- add missing author error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
end
else -- if not a book cite
if utilities.select_one (args, cfg.aliases['ContributorList-Last'], 'err_redundant_parameters', 1 ) then -- are there contributor name list parameters?
utilities.set_message ('err_contributor_ignored'); -- add contributor ignored error message
end
Contribution = nil; -- unset
end
local Title = A['Title'];
local TitleLink = A['TitleLink'];
local auto_select = ''; -- default is auto
local accept_link;
TitleLink, accept_link = utilities.has_accept_as_written (TitleLink, true); -- test for accept-this-as-written markup
if (not accept_link) and utilities.in_array (TitleLink, {'none', 'pmc', 'doi'}) then -- check for special keywords
auto_select = TitleLink; -- remember selection for later
TitleLink = ''; -- treat as if |title-link= would have been empty
end
TitleLink = link_title_ok (TitleLink, A:ORIGIN ('TitleLink'), Title, 'title'); -- check for wiki-markup in |title-link= or wiki-markup in |title= when |title-link= is set
local Section = ''; -- {{cite map}} only; preset to empty string for concatenation if not used
if 'map' == config.CitationClass and 'section' == Chapter_origin then
Section = A['Chapter']; -- get |section= from |chapter= alias list; |chapter= and the other aliases not supported in {{cite map}}
Chapter = ''; -- unset for now; will be reset later from |map= if present
end
local Periodical = A['Periodical'];
local Periodical_origin = '';
if utilities.is_set (Periodical) then
Periodical_origin = A:ORIGIN('Periodical'); -- get the name of the periodical parameter
local i;
Periodical, i = utilities.strip_apostrophe_markup (Periodical); -- strip apostrophe markup so that metadata isn't contaminated
if i then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {Periodical_origin});
end
end
if 'mailinglist' == config.CitationClass then -- special case for {{cite mailing list}}
if utilities.is_set (Periodical) and utilities.is_set (A ['MailingList']) then -- both set emit an error TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', Periodical_origin) .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'mailinglist')});
end
Periodical = A ['MailingList']; -- error or no, set Periodical to |mailinglist= value because this template is {{cite mailing list}}
Periodical_origin = A:ORIGIN('MailingList');
end
local ScriptPeriodical = A['ScriptPeriodical'];
-- web and news not tested for now because of
-- Wikipedia:Administrators%27_noticeboard#Is_there_a_semi-automated_tool_that_could_fix_these_annoying_"Cite_Web"_errors?
if not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) then -- 'periodical' templates require periodical parameter
-- local p = {['journal'] = 'journal', ['magazine'] = 'magazine', ['news'] = 'newspaper', ['web'] = 'website'}; -- for error message
local p = {['journal'] = 'journal', ['magazine'] = 'magazine'}; -- for error message
if p[config.CitationClass] then
utilities.set_message ('err_missing_periodical', {config.CitationClass, p[config.CitationClass]});
end
end
local Volume;
local ScriptPeriodical_origin = A:ORIGIN('ScriptPeriodical');
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) then
if not utilities.in_array (Periodical_origin, cfg.citation_no_volume_t) then -- {{citation}} does not render |volume= when these parameters are used
Volume = A['Volume']; -- but does for all other 'periodicals'
end
elseif utilities.is_set (ScriptPeriodical) then
if 'script-website' ~= ScriptPeriodical_origin then -- {{citation}} does not render volume for |script-website=
Volume = A['Volume']; -- but does for all other 'periodicals'
end
else
Volume = A['Volume']; -- and does for non-'periodical' cites
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_volume) then -- render |volume= for cs1 according to the configuration settings
Volume = A['Volume'];
end
extra_text_in_vol_iss_check (Volume, A:ORIGIN ('Volume'), 'v');
local Issue;
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) and utilities.in_array (Periodical_origin, cfg.citation_issue_t) then -- {{citation}} may render |issue= when these parameters are used
Issue = utilities.hyphen_to_dash (A['Issue']);
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_issue) then -- conference & map books do not support issue; {{citation}} listed here because included in settings table
if not (utilities.in_array (config.CitationClass, {'conference', 'map', 'citation'}) and not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical))) then
Issue = utilities.hyphen_to_dash (A['Issue']);
end
end
local ArticleNumber;
if utilities.in_array (config.CitationClass, {'journal', 'conference'}) or ('citation' == config.CitationClass and utilities.is_set (Periodical) and 'journal' == Periodical_origin) then
ArticleNumber = A['ArticleNumber'];
end
extra_text_in_vol_iss_check (Issue, A:ORIGIN ('Issue'), 'i');
local Page;
local Pages;
local At;
local QuotePage;
local QuotePages;
if not utilities.in_array (config.CitationClass, cfg.templates_not_using_page) then -- TODO: rewrite to emit ignored parameter error message?
Page = A['Page'];
Pages = utilities.hyphen_to_dash (A['Pages']);
At = A['At'];
QuotePage = A['QuotePage'];
QuotePages = utilities.hyphen_to_dash (A['QuotePages']);
end
local Edition = A['Edition'];
local PublicationPlace = place_check (A['PublicationPlace'], A:ORIGIN('PublicationPlace'));
local Place = place_check (A['Place'], A:ORIGIN('Place'));
local PublisherName = A['PublisherName'];
local PublisherName_origin = A:ORIGIN('PublisherName');
if utilities.is_set (PublisherName) then
local i = 0;
PublisherName, i = utilities.strip_apostrophe_markup (PublisherName); -- strip apostrophe markup so that metadata isn't contaminated; publisher is never italicized
if i then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {PublisherName_origin});
end
end
local Newsgroup = A['Newsgroup']; -- TODO: strip apostrophe markup?
local Newsgroup_origin = A:ORIGIN('Newsgroup');
if 'newsgroup' == config.CitationClass then
if utilities.is_set (PublisherName) then -- general use parameter |publisher= not allowed in cite newsgroup
utilities.set_message ('err_parameter_ignored', {PublisherName_origin});
end
PublisherName = nil; -- ensure that this parameter is unset for the time being; will be used again after COinS
end
local URL = A['URL']; -- TODO: better way to do this for URL, ChapterURL, and MapURL?
local UrlAccess = is_valid_parameter_value (A['UrlAccess'], A:ORIGIN('UrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (URL) and utilities.is_set (UrlAccess) then
UrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', 'url');
end
local ChapterURL = A['ChapterURL'];
local ChapterUrlAccess = is_valid_parameter_value (A['ChapterUrlAccess'], A:ORIGIN('ChapterUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (ChapterURL) and utilities.is_set (ChapterUrlAccess) then
ChapterUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {A:ORIGIN('ChapterUrlAccess'):gsub ('%-access', '')});
end
local MapUrlAccess = is_valid_parameter_value (A['MapUrlAccess'], A:ORIGIN('MapUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (A['MapURL']) and utilities.is_set (MapUrlAccess) then
MapUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {'map-url'});
end
local this_page = mw.title.getCurrentTitle(); -- also used for COinS and for language
local no_tracking_cats = is_valid_parameter_value (A['NoTracking'], A:ORIGIN('NoTracking'), cfg.keywords_lists['yes_true_y'], nil);
-- check this page to see if it is in one of the namespaces that cs1 is not supposed to add to the error categories
if not utilities.is_set (no_tracking_cats) then -- ignore if we are already not going to categorize this page
if cfg.uncategorized_namespaces[this_page.namespace] then -- is this page's namespace id one of the uncategorized namespace ids?
no_tracking_cats = "true"; -- set no_tracking_cats
end
for _, v in ipairs (cfg.uncategorized_subpages) do -- cycle through page name patterns
if this_page.text:match (v) then -- test page name against each pattern
no_tracking_cats = "true"; -- set no_tracking_cats
break; -- bail out if one is found
end
end
end
-- check for extra |page=, |pages= or |at= parameters. (also sheet and sheets while we're at it)
utilities.select_one (args, {'page', 'p', 'pp', 'pages', 'at', 'sheet', 'sheets'}, 'err_redundant_parameters'); -- this is a dummy call simply to get the error message and category
local coins_pages;
Page, Pages, At, coins_pages = insource_loc_get (Page, A:ORIGIN('Page'), Pages, A:ORIGIN('Pages'), At);
local NoPP = is_valid_parameter_value (A['NoPP'], A:ORIGIN('NoPP'), cfg.keywords_lists['yes_true_y'], nil);
if utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- both |publication-place= and |place= (|location=) allowed if different
utilities.add_prop_cat ('location-test'); -- add property cat to evaluate how often PublicationPlace and Place are used together
if PublicationPlace == Place then
Place = ''; -- unset; don't need both if they are the same
end
elseif not utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- when only |place= (|location=) is set ...
PublicationPlace = Place; -- promote |place= (|location=) to |publication-place
end
if PublicationPlace == Place then Place = ''; end -- don't need both if they are the same
local URL_origin = A:ORIGIN('URL'); -- get name of parameter that holds URL
local ChapterURL_origin = A:ORIGIN('ChapterURL'); -- get name of parameter that holds ChapterURL
local ScriptChapter = A['ScriptChapter'];
local ScriptChapter_origin = A:ORIGIN ('ScriptChapter');
local Format = A['Format'];
local ChapterFormat = A['ChapterFormat'];
local TransChapter = A['TransChapter'];
local TransChapter_origin = A:ORIGIN ('TransChapter');
local TransTitle = A['TransTitle'];
local ScriptTitle = A['ScriptTitle'];
--[[
Parameter remapping for cite encyclopedia:
When the citation has these parameters:
|encyclopedia= and |title= then map |title= to |article= and |encyclopedia= to |title=
|encyclopedia= and |article= then map |encyclopedia= to |title=
|trans-title= maps to |trans-chapter= when |title= is re-mapped
|url= maps to |chapter-url= when |title= is remapped
All other combinations of |encyclopedia=, |title=, and |article= are not modified
]]
local Encyclopedia = A['Encyclopedia']; -- used as a flag by this module and by ~/COinS
if utilities.is_set (Encyclopedia) then -- emit error message when Encyclopedia set but template is other than {{cite encyclopedia}} or {{citation}}
if 'encyclopaedia' ~= config.CitationClass and 'citation' ~= config.CitationClass then
utilities.set_message ('err_parameter_ignored', {A:ORIGIN ('Encyclopedia')});
Encyclopedia = nil; -- unset because not supported by this template
end
end
if ('encyclopaedia' == config.CitationClass) or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Periodical) and utilities.is_set (Encyclopedia) then -- when both set emit an error TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', A:ORIGIN ('Encyclopedia')) .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', Periodical_origin)});
end
if utilities.is_set (Encyclopedia) then
Periodical = Encyclopedia; -- error or no, set Periodical to Encyclopedia; allow periodical without encyclopedia
Periodical_origin = A:ORIGIN ('Encyclopedia');
end
if utilities.is_set (Periodical) then -- Periodical is set when |encyclopedia= is set
if utilities.is_set (Title) or utilities.is_set (ScriptTitle) then
if not utilities.is_set (Chapter) then
Chapter = Title; -- |encyclopedia= and |title= are set so map |title= to |article= and |encyclopedia= to |title=
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle')
TransChapter = TransTitle;
ChapterURL = URL;
ChapterURL_origin = URL_origin;
ChapterUrlAccess = UrlAccess;
if not utilities.is_set (ChapterURL) and utilities.is_set (TitleLink) then
Chapter = utilities.make_wikilink (TitleLink, Chapter);
end
Title = Periodical;
ChapterFormat = Format;
Periodical = ''; -- redundant so unset
TransTitle = '';
URL = '';
Format = '';
TitleLink = '';
ScriptTitle = '';
end
elseif utilities.is_set (Chapter) or utilities.is_set (ScriptChapter) then -- |title= not set
Title = Periodical; -- |encyclopedia= set and |article= set so map |encyclopedia= to |title=
Periodical = ''; -- redundant so unset
end
end
end
-- special case for cite techreport.
local ID = A['ID'];
if (config.CitationClass == "techreport") then -- special case for cite techreport
if utilities.is_set (A['Number']) then -- cite techreport uses 'number', which other citations alias to 'issue'
if not utilities.is_set (ID) then -- can we use ID for the "number"?
ID = A['Number']; -- yes, use it
else -- ID has a value so emit error message
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'id') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'number')});
end
end
end
-- Account for the oddity that is {{cite conference}}, before generation of COinS data.
local ChapterLink -- = A['ChapterLink']; -- deprecated as a parameter but still used internally by cite episode
local Conference = A['Conference'];
local BookTitle = A['BookTitle'];
local TransTitle_origin = A:ORIGIN ('TransTitle');
if 'conference' == config.CitationClass then
if utilities.is_set (BookTitle) then
Chapter = Title;
Chapter_origin = 'title';
-- ChapterLink = TitleLink; -- |chapter-link= is deprecated
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
URL_origin = '';
ChapterFormat = Format;
TransChapter = TransTitle;
TransChapter_origin = TransTitle_origin;
Title = BookTitle;
Format = '';
-- TitleLink = '';
TransTitle = '';
URL = '';
end
elseif 'speech' ~= config.CitationClass then
Conference = ''; -- not cite conference or cite speech so make sure this is empty string
end
-- CS1/2 mode
local Mode = is_valid_parameter_value (A['Mode'], A:ORIGIN('Mode'), cfg.keywords_lists['mode'], '');
-- separator character and postscript
local sepc, PostScript = set_style (Mode:lower(), A['PostScript'], config.CitationClass);
-- controls capitalization of certain static text
local use_lowercase = ( sepc == ',' );
-- cite map oddities
local Cartography = "";
local Scale = "";
local Sheet = A['Sheet'] or '';
local Sheets = A['Sheets'] or '';
if config.CitationClass == "map" then
if utilities.is_set (Chapter) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'map') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', Chapter_origin)}); -- add error message
end
Chapter = A['Map'];
Chapter_origin = A:ORIGIN('Map');
ChapterURL = A['MapURL'];
ChapterURL_origin = A:ORIGIN('MapURL');
TransChapter = A['TransMap'];
ScriptChapter = A['ScriptMap']
ScriptChapter_origin = A:ORIGIN('ScriptMap')
ChapterUrlAccess = MapUrlAccess;
ChapterFormat = A['MapFormat'];
Cartography = A['Cartography'];
if utilities.is_set ( Cartography ) then
Cartography = sepc .. " " .. wrap_msg ('cartography', Cartography, use_lowercase);
end
Scale = A['Scale'];
if utilities.is_set ( Scale ) then
Scale = sepc .. " " .. Scale;
end
end
-- Account for the oddities that are {{cite episode}} and {{cite serial}}, before generation of COinS data.
local Series = A['Series'];
if 'episode' == config.CitationClass or 'serial' == config.CitationClass then
local SeriesLink = A['SeriesLink'];
SeriesLink = link_title_ok (SeriesLink, A:ORIGIN ('SeriesLink'), Series, 'series'); -- check for wiki-markup in |series-link= or wiki-markup in |series= when |series-link= is set
local Network = A['Network'];
local Station = A['Station'];
local s, n = {}, {};
-- do common parameters first
if utilities.is_set (Network) then table.insert(n, Network); end
if utilities.is_set (Station) then table.insert(n, Station); end
ID = table.concat(n, sepc .. ' ');
if 'episode' == config.CitationClass then -- handle the oddities that are strictly {{cite episode}}
local Season = A['Season'];
local SeriesNumber = A['SeriesNumber'];
if utilities.is_set (Season) and utilities.is_set (SeriesNumber) then -- these are mutually exclusive so if both are set TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'season') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'seriesno')}); -- add error message
SeriesNumber = ''; -- unset; prefer |season= over |seriesno=
end
-- assemble a table of parts concatenated later into Series
if utilities.is_set (Season) then table.insert(s, wrap_msg ('season', Season, use_lowercase)); end
if utilities.is_set (SeriesNumber) then table.insert(s, wrap_msg ('seriesnum', SeriesNumber, use_lowercase)); end
if utilities.is_set (Issue) then table.insert(s, wrap_msg ('episode', Issue, use_lowercase)); end
Issue = ''; -- unset because this is not a unique parameter
Chapter = Title; -- promote title parameters to chapter
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle');
ChapterLink = TitleLink; -- alias |episode-link=
TransChapter = TransTitle;
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
ChapterFormat = Format;
Title = Series; -- promote series to title
TitleLink = SeriesLink;
Series = table.concat(s, sepc .. ' '); -- this is concatenation of season, seriesno, episode number
if utilities.is_set (ChapterLink) and not utilities.is_set (ChapterURL) then -- link but not URL
Chapter = utilities.make_wikilink (ChapterLink, Chapter);
elseif utilities.is_set (ChapterLink) and utilities.is_set (ChapterURL) then -- if both are set, URL links episode;
Series = utilities.make_wikilink (ChapterLink, Series);
end
URL = ''; -- unset
TransTitle = '';
ScriptTitle = '';
Format = '';
else -- now oddities that are cite serial
Issue = ''; -- unset because this parameter no longer supported by the citation/core version of cite serial
Chapter = A['Episode']; -- TODO: make |episode= available to cite episode someday?
if utilities.is_set (Series) and utilities.is_set (SeriesLink) then
Series = utilities.make_wikilink (SeriesLink, Series);
end
Series = utilities.wrap_style ('italic-title', Series); -- series is italicized
end
end
-- end of {{cite episode}} stuff
-- handle type parameter for those CS1 citations that have default values
local TitleType = A['TitleType'];
local Degree = A['Degree'];
if utilities.in_array (config.CitationClass, {'AV-media-notes', 'interview', 'mailinglist', 'map', 'podcast', 'pressrelease', 'report', 'speech', 'techreport', 'thesis'}) then
TitleType = set_titletype (config.CitationClass, TitleType);
if utilities.is_set (Degree) and "Thesis" == TitleType then -- special case for cite thesis
TitleType = Degree .. ' ' .. cfg.title_types ['thesis']:lower();
end
end
if utilities.is_set (TitleType) then -- if type parameter is specified
TitleType = utilities.substitute ( cfg.messages['type'], TitleType); -- display it in parentheses
-- TODO: Hack on TitleType to fix bunched parentheses problem
end
-- legacy: promote PublicationDate to Date if neither Date nor Year are set.
local Date = A['Date'];
local Date_origin; -- to hold the name of parameter promoted to Date; required for date error messaging
local PublicationDate = A['PublicationDate'];
local Year = A['Year'];
if not utilities.is_set (Date) then
Date = Year; -- promote Year to Date
Year = nil; -- make nil so Year as empty string isn't used for CITEREF
if not utilities.is_set (Date) and utilities.is_set (PublicationDate) then -- use PublicationDate when |date= and |year= are not set
Date = PublicationDate; -- promote PublicationDate to Date
PublicationDate = ''; -- unset, no longer needed
Date_origin = A:ORIGIN('PublicationDate'); -- save the name of the promoted parameter
else
Date_origin = A:ORIGIN('Year'); -- save the name of the promoted parameter
end
else
Date_origin = A:ORIGIN('Date'); -- not a promotion; name required for error messaging
end
if PublicationDate == Date then PublicationDate = ''; end -- if PublicationDate is same as Date, don't display in rendered citation
--[[
Go test all of the date-holding parameters for valid MOS:DATE format and make sure that dates are real dates. This must be done before we do COinS because here is where
we get the date used in the metadata.
Date validation supporting code is in Module:Citation/CS1/Date_validation
]]
local DF = is_valid_parameter_value (A['DF'], A:ORIGIN('DF'), cfg.keywords_lists['df'], '');
if not utilities.is_set (DF) then
DF = cfg.global_df; -- local |df= if present overrides global df set by {{use xxx date}} template
end
local ArchiveURL;
local ArchiveDate;
local ArchiveFormat = A['ArchiveFormat'];
ArchiveURL, ArchiveDate = archive_url_check (A['ArchiveURL'], A['ArchiveDate'])
ArchiveFormat = style_format (ArchiveFormat, ArchiveURL, 'archive-format', 'archive-url');
ArchiveURL, ArchiveDate = is_unique_archive_url (ArchiveURL, URL, ChapterURL, A:ORIGIN('ArchiveURL'), ArchiveDate); -- add error message when URL or ChapterURL == ArchiveURL
local AccessDate = A['AccessDate'];
local LayDate = A['LayDate'];
local COinS_date = {}; -- holds date info extracted from |date= for the COinS metadata by Module:Date verification
local DoiBroken = A['DoiBroken'];
local Embargo = A['Embargo'];
local anchor_year; -- used in the CITEREF identifier
do -- create defined block to contain local variables error_message, date_parameters_list, mismatch
local error_message = '';
-- AirDate has been promoted to Date so not necessary to check it
local date_parameters_list = {
['access-date'] = {val = AccessDate, name = A:ORIGIN ('AccessDate')},
['archive-date'] = {val = ArchiveDate, name = A:ORIGIN ('ArchiveDate')},
['date'] = {val = Date, name = Date_origin},
['doi-broken-date'] = {val = DoiBroken, name = A:ORIGIN ('DoiBroken')},
['pmc-embargo-date'] = {val = Embargo, name = A:ORIGIN ('Embargo')},
['lay-date'] = {val = LayDate, name = A:ORIGIN ('LayDate')},
['publication-date'] = {val = PublicationDate, name = A:ORIGIN ('PublicationDate')},
['year'] = {val = Year, name = A:ORIGIN ('Year')},
};
local error_list = {};
anchor_year, Embargo = validation.dates(date_parameters_list, COinS_date, error_list);
-- start temporary Julian / Gregorian calendar uncertainty categorization
if COinS_date.inter_cal_cat then
utilities.add_prop_cat ('jul-greg-uncertainty');
end
-- end temporary Julian / Gregorian calendar uncertainty categorization
if utilities.is_set (Year) and utilities.is_set (Date) then -- both |date= and |year= not normally needed;
validation.year_date_check (Year, A:ORIGIN ('Year'), Date, A:ORIGIN ('Date'), error_list);
end
if 0 == #error_list then -- error free dates only; 0 when error_list is empty
local modified = false; -- flag
if utilities.is_set (DF) then -- if we need to reformat dates
modified = validation.reformat_dates (date_parameters_list, DF); -- reformat to DF format, use long month names if appropriate
end
if true == validation.date_hyphen_to_dash (date_parameters_list) then -- convert hyphens to dashes where appropriate
modified = true;
utilities.set_message ('maint_date_format'); -- hyphens were converted so add maint category
end
-- for those wikis that can and want to have English date names translated to the local language; not supported at en.wiki
if cfg.date_name_auto_xlate_enable and validation.date_name_xlate (date_parameters_list, cfg.date_digit_auto_xlate_enable ) then
utilities.set_message ('maint_date_auto_xlated'); -- add maint cat
modified = true;
end
if modified then -- if the date_parameters_list values were modified
AccessDate = date_parameters_list['access-date'].val; -- overwrite date holding parameters with modified values
ArchiveDate = date_parameters_list['archive-date'].val;
Date = date_parameters_list['date'].val;
DoiBroken = date_parameters_list['doi-broken-date'].val;
LayDate = date_parameters_list['lay-date'].val;
PublicationDate = date_parameters_list['publication-date'].val;
end
else
utilities.set_message ('err_bad_date', {utilities.make_sep_list (#error_list, error_list)}); -- add this error message
end
end -- end of do
local ID_list = {}; -- sequence table of rendered identifiers
local ID_list_coins = {}; -- table of identifiers and their values from args; key is same as cfg.id_handlers's key
local Class = A['Class']; -- arxiv class identifier
local ID_support = {
{A['ASINTLD'], 'ASIN', 'err_asintld_missing_asin', A:ORIGIN ('ASINTLD')},
{DoiBroken, 'DOI', 'err_doibroken_missing_doi', A:ORIGIN ('DoiBroken')},
{Embargo, 'PMC', 'err_embargo_missing_pmc', A:ORIGIN ('Embargo')},
}
ID_list, ID_list_coins = identifiers.identifier_lists_get (args, {DoiBroken = DoiBroken, ASINTLD = A['ASINTLD'], Embargo = Embargo, Class = Class}, ID_support);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite ssrn}}, before generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list) then -- |arxiv= or |eprint= required for cite arxiv; |biorxiv=, |citeseerx=, |ssrn= required for their templates
if not (args[cfg.id_handlers[config.CitationClass:upper()].parameters[1]] or -- can't use ID_list_coins k/v table here because invalid parameters omitted
args[cfg.id_handlers[config.CitationClass:upper()].parameters[2]]) then -- which causes unexpected parameter missing error message
utilities.set_message ('err_' .. config.CitationClass .. '_missing'); -- add error message
end
Periodical = ({['arxiv'] = 'arXiv', ['biorxiv'] = 'bioRxiv', ['citeseerx'] = 'CiteSeerX', ['ssrn'] = 'Social Science Research Network'})[config.CitationClass];
end
-- Link the title of the work if no |url= was provided, but we have a |pmc= or a |doi= with |doi-access=free
if config.CitationClass == "journal" and not utilities.is_set (URL) and not utilities.is_set (TitleLink) and not utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) then -- TODO: remove 'none' once existing citations have been switched to 'off', so 'none' can be used as token for "no title" instead
if 'none' ~= cfg.keywords_xlate[auto_select] then -- if auto-linking not disabled
if identifiers.auto_link_urls[auto_select] then -- manual selection
URL = identifiers.auto_link_urls[auto_select]; -- set URL to be the same as identifier's external link
URL_origin = cfg.id_handlers[auto_select:upper()].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['pmc'] then -- auto-select PMC
URL = identifiers.auto_link_urls['pmc']; -- set URL to be the same as the PMC external link if not embargoed
URL_origin = cfg.id_handlers['PMC'].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['doi'] then -- auto-select DOI
URL = identifiers.auto_link_urls['doi'];
URL_origin = cfg.id_handlers['DOI'].parameters[1];
end
end
if utilities.is_set (URL) then -- set when using an identifier-created URL
if utilities.is_set (AccessDate) then -- |access-date= requires |url=; identifier-created URL is not |url=
utilities.set_message ('err_accessdate_missing_url'); -- add an error message
AccessDate = ''; -- unset
end
if utilities.is_set (ArchiveURL) then -- |archive-url= requires |url=; identifier-created URL is not |url=
utilities.set_message ('err_archive_missing_url'); -- add an error message
ArchiveURL = ''; -- unset
end
end
end
-- At this point fields may be nil if they weren't specified in the template use. We can use that fact.
-- Test if citation has no title
if not utilities.is_set (Title) and not utilities.is_set (TransTitle) and not utilities.is_set (ScriptTitle) then -- has special case for cite episode
utilities.set_message ('err_citation_missing_title', {'episode' == config.CitationClass and 'series' or 'title'});
end
if utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) and
utilities.in_array (config.CitationClass, {'journal', 'citation'}) and
(utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and
('journal' == Periodical_origin or 'script-journal' == ScriptPeriodical_origin) then -- special case for journal cites
Title = ''; -- set title to empty string
utilities.set_message ('maint_untitled'); -- add maint cat
end
-- COinS metadata (see <http://ocoins.info/>) for automated parsing of citation information.
-- handle the oddity that is cite encyclopedia and {{citation |encyclopedia=something}}. Here we presume that
-- when Periodical, Title, and Chapter are all set, then Periodical is the book (encyclopedia) title, Title
-- is the article title, and Chapter is a section within the article. So, we remap
local coins_chapter = Chapter; -- default assuming that remapping not required
local coins_title = Title; -- et tu
if 'encyclopaedia' == config.CitationClass or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Chapter) and utilities.is_set (Title) and utilities.is_set (Periodical) then -- if all are used then
coins_chapter = Title; -- remap
coins_title = Periodical;
end
end
local coins_author = a; -- default for coins rft.au
if 0 < #c then -- but if contributor list
coins_author = c; -- use that instead
end
-- this is the function call to COinS()
local OCinSoutput = metadata.COinS({
['Periodical'] = utilities.strip_apostrophe_markup (Periodical), -- no markup in the metadata
['Encyclopedia'] = Encyclopedia, -- just a flag; content ignored by ~/COinS
['Chapter'] = metadata.make_coins_title (coins_chapter, ScriptChapter), -- Chapter and ScriptChapter stripped of bold / italic / accept-as-written markup
['Degree'] = Degree; -- cite thesis only
['Title'] = metadata.make_coins_title (coins_title, ScriptTitle), -- Title and ScriptTitle stripped of bold / italic / accept-as-written markup
['PublicationPlace'] = PublicationPlace,
['Date'] = COinS_date.rftdate, -- COinS_date has correctly formatted date if Date is valid;
['Season'] = COinS_date.rftssn,
['Quarter'] = COinS_date.rftquarter,
['Chron'] = COinS_date.rftchron or (not COinS_date.rftdate and Date) or '', -- chron but if not set and invalid date format use Date; keep this last bit?
['Series'] = Series,
['Volume'] = Volume,
['Issue'] = Issue,
['ArticleNumber'] = ArticleNumber,
['Pages'] = coins_pages or metadata.get_coins_pages (first_set ({Sheet, Sheets, Page, Pages, At, QuotePage, QuotePages}, 7)), -- pages stripped of external links
['Edition'] = Edition,
['PublisherName'] = PublisherName or Newsgroup, -- any apostrophe markup already removed from PublisherName
['URL'] = first_set ({ChapterURL, URL}, 2),
['Authors'] = coins_author,
['ID_list'] = ID_list_coins,
['RawPage'] = this_page.prefixedText,
}, config.CitationClass);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, and {{cite ssrn}} AFTER generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list) then -- we have set rft.jtitle in COinS to arXiv, bioRxiv, CiteSeerX, or ssrn now unset so it isn't displayed
Periodical = ''; -- periodical not allowed in these templates; if article has been published, use cite journal
end
-- special case for cite newsgroup. Do this after COinS because we are modifying Publishername to include some static text
if 'newsgroup' == config.CitationClass and utilities.is_set (Newsgroup) then
PublisherName = utilities.substitute (cfg.messages['newsgroup'], external_link( 'news:' .. Newsgroup, Newsgroup, Newsgroup_origin, nil ));
end
local Editors;
local EditorCount; -- used only for choosing {ed.) or (eds.) annotation at end of editor name-list
local Contributors; -- assembled contributors name list
local contributor_etal;
local Translators; -- assembled translators name list
local translator_etal;
local t = {}; -- translators list from |translator-lastn= / translator-firstn= pairs
t = extract_names (args, 'TranslatorList'); -- fetch translator list from |translatorn= / |translator-lastn=, -firstn=, -linkn=, -maskn=
local Interviewers;
local interviewers_list = {};
interviewers_list = extract_names (args, 'InterviewerList'); -- process preferred interviewers parameters
local interviewer_etal;
-- Now perform various field substitutions.
-- We also add leading spaces and surrounding markup and punctuation to the
-- various parts of the citation, but only when they are non-nil.
do
local last_first_list;
local control = {
format = NameListStyle, -- empty string or 'vanc'
maximum = nil, -- as if display-authors or display-editors not set
mode = Mode
};
do -- do editor name list first because the now unsupported coauthors used to modify control table
control.maximum , editor_etal = get_display_names (A['DisplayEditors'], #e, 'editors', editor_etal, A:ORIGIN ('DisplayEditors'));
Editors, EditorCount = list_people (control, e, editor_etal);
if 1 == EditorCount and (true == editor_etal or 1 < #e) then -- only one editor displayed but includes etal then
EditorCount = 2; -- spoof to display (eds.) annotation
end
end
do -- now do interviewers
control.maximum, interviewer_etal = get_display_names (A['DisplayInterviewers'], #interviewers_list, 'interviewers', interviewer_etal, A:ORIGIN ('DisplayInterviewers'));
Interviewers = list_people (control, interviewers_list, interviewer_etal);
end
do -- now do translators
control.maximum, translator_etal = get_display_names (A['DisplayTranslators'], #t, 'translators', translator_etal, A:ORIGIN ('DisplayTranslators'));
Translators = list_people (control, t, translator_etal);
end
do -- now do contributors
control.maximum, contributor_etal = get_display_names (A['DisplayContributors'], #c, 'contributors', contributor_etal, A:ORIGIN ('DisplayContributors'));
Contributors = list_people (control, c, contributor_etal);
end
do -- now do authors
control.maximum, author_etal = get_display_names (A['DisplayAuthors'], #a, 'authors', author_etal, A:ORIGIN ('DisplayAuthors'));
last_first_list = list_people (control, a, author_etal);
if utilities.is_set (Authors) then
Authors, author_etal = name_has_etal (Authors, author_etal, false, 'authors'); -- find and remove variations on et al.
if author_etal then
Authors = Authors .. ' ' .. cfg.messages['et al']; -- add et al. to authors parameter
end
else
Authors = last_first_list; -- either an author name list or an empty string
end
end -- end of do
if utilities.is_set (Authors) and utilities.is_set (Collaboration) then
Authors = Authors .. ' (' .. Collaboration .. ')'; -- add collaboration after et al.
end
end
local ConferenceFormat = A['ConferenceFormat'];
local ConferenceURL = A['ConferenceURL'];
ConferenceFormat = style_format (ConferenceFormat, ConferenceURL, 'conference-format', 'conference-url');
Format = style_format (Format, URL, 'format', 'url');
-- special case for chapter format so no error message or cat when chapter not supported
if not (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia))) then
ChapterFormat = style_format (ChapterFormat, ChapterURL, 'chapter-format', 'chapter-url');
end
if not utilities.is_set (URL) then
if utilities.in_array (config.CitationClass, {"web", "podcast", "mailinglist"}) or -- |url= required for cite web, cite podcast, and cite mailinglist
('citation' == config.CitationClass and ('website' == Periodical_origin or 'script-website' == ScriptPeriodical_origin)) then -- and required for {{citation}} with |website= or |script-website=
utilities.set_message ('err_cite_web_url');
end
-- do we have |accessdate= without either |url= or |chapter-url=?
if utilities.is_set (AccessDate) and not utilities.is_set (ChapterURL) then -- ChapterURL may be set when URL is not set;
utilities.set_message ('err_accessdate_missing_url');
AccessDate = '';
end
end
local UrlStatus = is_valid_parameter_value (A['UrlStatus'], A:ORIGIN('UrlStatus'), cfg.keywords_lists['url-status'], '');
local OriginalURL
local OriginalURL_origin
local OriginalFormat
local OriginalAccess;
UrlStatus = UrlStatus:lower(); -- used later when assembling archived text
if utilities.is_set ( ArchiveURL ) then
if utilities.is_set (ChapterURL) then -- if chapter-url= is set apply archive url to it
OriginalURL = ChapterURL; -- save copy of source chapter's url for archive text
OriginalURL_origin = ChapterURL_origin; -- name of |chapter-url= parameter for error messages
OriginalFormat = ChapterFormat; -- and original |chapter-format=
if 'live' ~= UrlStatus then
ChapterURL = ArchiveURL -- swap-in the archive's URL
ChapterURL_origin = A:ORIGIN('ArchiveURL') -- name of |archive-url= parameter for error messages
ChapterFormat = ArchiveFormat or ''; -- swap in archive's format
ChapterUrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
elseif utilities.is_set (URL) then
OriginalURL = URL; -- save copy of original source URL
OriginalURL_origin = URL_origin; -- name of URL parameter for error messages
OriginalFormat = Format; -- and original |format=
OriginalAccess = UrlAccess;
if 'live' ~= UrlStatus then -- if URL set then |archive-url= applies to it
URL = ArchiveURL -- swap-in the archive's URL
URL_origin = A:ORIGIN('ArchiveURL') -- name of archive URL parameter for error messages
Format = ArchiveFormat or ''; -- swap in archive's format
UrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
end
elseif utilities.is_set (UrlStatus) then -- if |url-status= is set when |archive-url= is not set
utilities.set_message ('maint_url_status'); -- add maint cat
end
if utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) or -- if any of the 'periodical' cites except encyclopedia
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) then
local chap_param;
if utilities.is_set (Chapter) then -- get a parameter name from one of these chapter related meta-parameters
chap_param = A:ORIGIN ('Chapter')
elseif utilities.is_set (TransChapter) then
chap_param = A:ORIGIN ('TransChapter')
elseif utilities.is_set (ChapterURL) then
chap_param = A:ORIGIN ('ChapterURL')
elseif utilities.is_set (ScriptChapter) then
chap_param = ScriptChapter_origin;
else utilities.is_set (ChapterFormat)
chap_param = A:ORIGIN ('ChapterFormat')
end
if utilities.is_set (chap_param) then -- if we found one
utilities.set_message ('err_chapter_ignored', {chap_param}); -- add error message
Chapter = ''; -- and set them to empty string to be safe with concatenation
TransChapter = '';
ChapterURL = '';
ScriptChapter = '';
ChapterFormat = '';
end
else -- otherwise, format chapter / article title
local no_quotes = false; -- default assume that we will be quoting the chapter parameter value
if utilities.is_set (Contribution) and 0 < #c then -- if this is a contribution with contributor(s)
if utilities.in_array (Contribution:lower(), cfg.keywords_lists.contribution) then -- and a generic contribution title
no_quotes = true; -- then render it unquoted
end
end
Chapter = format_chapter_title (ScriptChapter, ScriptChapter_origin, Chapter, Chapter_origin, TransChapter, TransChapter_origin, ChapterURL, ChapterURL_origin, no_quotes, ChapterUrlAccess); -- Contribution is also in Chapter
if utilities.is_set (Chapter) then
Chapter = Chapter .. ChapterFormat ;
if 'map' == config.CitationClass and utilities.is_set (TitleType) then
Chapter = Chapter .. ' ' .. TitleType; -- map annotation here; not after title
end
Chapter = Chapter .. sepc .. ' ';
elseif utilities.is_set (ChapterFormat) then -- |chapter= not set but |chapter-format= is so ...
Chapter = ChapterFormat .. sepc .. ' '; -- ... ChapterFormat has error message, we want to see it
end
end
-- Format main title
local plain_title = false;
local accept_title;
Title, accept_title = utilities.has_accept_as_written (Title, true); -- remove accept-this-as-written markup when it wraps all of <Title>
if accept_title and ('' == Title) then -- only support forced empty for now "(())"
Title = cfg.messages['notitle']; -- replace by predefined "No title" message
-- TODO: utilities.set_message ( 'err_redundant_parameters', ...); -- issue proper error message instead of muting
ScriptTitle = ''; -- just mute for now
TransTitle = ''; -- just mute for now
plain_title = true; -- suppress text decoration for descriptive title
utilities.set_message ('maint_untitled'); -- add maint cat
end
if not accept_title then -- <Title> not wrapped in accept-as-written markup
if '...' == Title:sub (-3) then -- if ellipsis is the last three characters of |title=
Title = Title:gsub ('(%.%.%.)%.+$', '%1'); -- limit the number of dots to three
elseif not mw.ustring.find (Title, '%.%s*%a%.$') and -- end of title is not a 'dot-(optional space-)letter-dot' initialism ...
not mw.ustring.find (Title, '%s+%a%.$') then -- ...and not a 'space-letter-dot' initial (''Allium canadense'' L.)
Title = mw.ustring.gsub(Title, '%' .. sepc .. '$', ''); -- remove any trailing separator character; sepc and ms.ustring() here for languages that use multibyte separator characters
end
if utilities.is_set (ArchiveURL) and is_archived_copy (Title) then
utilities.set_message ('maint_archived_copy'); -- add maintenance category before we modify the content of Title
end
if is_generic ('generic_titles', Title) then
utilities.set_message ('err_generic_title'); -- set an error message
end
end
if (not plain_title) and (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'mailinglist', 'interview', 'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) or
('map' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)))) then -- special case for cite map when the map is in a periodical treat as an article
Title = kern_quotes (Title); -- if necessary, separate title's leading and trailing quote marks from module provided quote marks
Title = utilities.wrap_style ('quoted-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle );
elseif plain_title or ('report' == config.CitationClass) then -- no styling for cite report and descriptive titles (otherwise same as above)
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle ); -- for cite report, use this form for trans-title
else
Title = utilities.wrap_style ('italic-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-italic-title', TransTitle);
end
if utilities.is_set (TransTitle) then
if utilities.is_set (Title) then
TransTitle = " " .. TransTitle;
else
utilities.set_message ('err_trans_missing_title', {'title'});
end
end
if utilities.is_set (Title) then -- TODO: is this the right place to be making Wikisource URLs?
if utilities.is_set (TitleLink) and utilities.is_set (URL) then
utilities.set_message ('err_wikilink_in_url'); -- set an error message because we can't have both
TitleLink = ''; -- unset
end
if not utilities.is_set (TitleLink) and utilities.is_set (URL) then
Title = external_link (URL, Title, URL_origin, UrlAccess) .. TransTitle .. Format;
URL = ''; -- unset these because no longer needed
Format = "";
elseif utilities.is_set (TitleLink) and not utilities.is_set (URL) then
local ws_url;
ws_url = wikisource_url_make (TitleLink); -- ignore ws_label return; not used here
if ws_url then
Title = external_link (ws_url, Title .. ' ', 'ws link in title-link'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], TitleLink, Title});
Title = Title .. TransTitle;
else
Title = utilities.make_wikilink (TitleLink, Title) .. TransTitle;
end
else
local ws_url, ws_label, L; -- Title has italic or quote markup by the time we get here which causes is_wikilink() to return 0 (not a wikilink)
ws_url, ws_label, L = wikisource_url_make (Title:gsub('^[\'"]*(.-)[\'"]*$', '%1')); -- make ws URL from |title= interwiki link (strip italic or quote markup); link portion L becomes tooltip label
if ws_url then
Title = Title:gsub ('%b[]', ws_label); -- replace interwiki link with ws_label to retain markup
Title = external_link (ws_url, Title .. ' ', 'ws link in title'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, Title});
Title = Title .. TransTitle;
else
Title = Title .. TransTitle;
end
end
else
Title = TransTitle;
end
if utilities.is_set (Place) then
Place = " " .. wrap_msg ('written', Place, use_lowercase) .. sepc .. " ";
end
local ConferenceURL_origin = A:ORIGIN('ConferenceURL'); -- get name of parameter that holds ConferenceURL
if utilities.is_set (Conference) then
if utilities.is_set (ConferenceURL) then
Conference = external_link( ConferenceURL, Conference, ConferenceURL_origin, nil );
end
Conference = sepc .. " " .. Conference .. ConferenceFormat;
elseif utilities.is_set (ConferenceURL) then
Conference = sepc .. " " .. external_link( ConferenceURL, nil, ConferenceURL_origin, nil );
end
local Position = '';
if not utilities.is_set (Position) then
local Minutes = A['Minutes'];
local Time = A['Time'];
if utilities.is_set (Minutes) then
if utilities.is_set (Time) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'minutes') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'time')});
end
Position = " " .. Minutes .. " " .. cfg.messages['minutes'];
else
if utilities.is_set (Time) then
local TimeCaption = A['TimeCaption']
if not utilities.is_set (TimeCaption) then
TimeCaption = cfg.messages['event'];
if sepc ~= '.' then
TimeCaption = TimeCaption:lower();
end
end
Position = " " .. TimeCaption .. " " .. Time;
end
end
else
Position = " " .. Position;
At = '';
end
Page, Pages, Sheet, Sheets = format_pages_sheets (Page, Pages, Sheet, Sheets, config.CitationClass, Periodical_origin, sepc, NoPP, use_lowercase);
At = utilities.is_set (At) and (sepc .. " " .. At) or "";
Position = utilities.is_set (Position) and (sepc .. " " .. Position) or "";
if config.CitationClass == 'map' then
local Sections = A['Sections']; -- Section (singular) is an alias of Chapter so set earlier
local Inset = A['Inset'];
if utilities.is_set ( Inset ) then
Inset = sepc .. " " .. wrap_msg ('inset', Inset, use_lowercase);
end
if utilities.is_set ( Sections ) then
Section = sepc .. " " .. wrap_msg ('sections', Sections, use_lowercase);
elseif utilities.is_set ( Section ) then
Section = sepc .. " " .. wrap_msg ('section', Section, use_lowercase);
end
At = At .. Inset .. Section;
end
local Others = A['Others'];
if utilities.is_set (Others) and 0 == #a and 0 == #e then -- add maint cat when |others= has value and used without |author=, |editor=
if config.CitationClass == "AV-media-notes"
or config.CitationClass == "audio-visual" then -- special maint for AV/M which has a lot of 'false' positives right now
utilities.set_message ('maint_others_avm')
else
utilities.set_message ('maint_others');
end
end
Others = utilities.is_set (Others) and (sepc .. " " .. Others) or "";
if utilities.is_set (Translators) then
Others = safe_join ({sepc .. ' ', wrap_msg ('translated', Translators, use_lowercase), Others}, sepc);
end
if utilities.is_set (Interviewers) then
Others = safe_join ({sepc .. ' ', wrap_msg ('interview', Interviewers, use_lowercase), Others}, sepc);
end
local TitleNote = A['TitleNote'];
TitleNote = utilities.is_set (TitleNote) and (sepc .. " " .. TitleNote) or "";
if utilities.is_set (Edition) then
if Edition:match ('%f[%a][Ee]d%n?%.?$') or Edition:match ('%f[%a][Ee]dition$') then -- Ed, ed, Ed., ed., Edn, edn, Edn., edn.
utilities.set_message ('err_extra_text_edition'); -- add error message
end
Edition = " " .. wrap_msg ('edition', Edition);
else
Edition = '';
end
Series = utilities.is_set (Series) and wrap_msg ('series', {sepc, Series}) or ""; -- not the same as SeriesNum
local Agency = A['Agency'];
Agency = utilities.is_set (Agency) and wrap_msg ('agency', {sepc, Agency}) or "";
Volume = format_volume_issue (Volume, Issue, ArticleNumber, config.CitationClass, Periodical_origin, sepc, use_lowercase);
if utilities.is_set (AccessDate) then
local retrv_text = " " .. cfg.messages['retrieved']
AccessDate = nowrap_date (AccessDate); -- wrap in nowrap span if date in appropriate format
if (sepc ~= ".") then retrv_text = retrv_text:lower() end -- if mode is cs2, lower case
AccessDate = utilities.substitute (retrv_text, AccessDate); -- add retrieved text
AccessDate = utilities.substitute (cfg.presentation['accessdate'], {sepc, AccessDate}); -- allow editors to hide accessdates
end
if utilities.is_set (ID) then ID = sepc .. " " .. ID; end
local Docket = A['Docket'];
if "thesis" == config.CitationClass and utilities.is_set (Docket) then
ID = sepc .. " Docket " .. Docket .. ID;
end
if "report" == config.CitationClass and utilities.is_set (Docket) then -- for cite report when |docket= is set
ID = sepc .. ' ' .. Docket; -- overwrite ID even if |id= is set
end
if utilities.is_set (URL) then
URL = " " .. external_link( URL, nil, URL_origin, UrlAccess );
end
local Quote = A['Quote'];
local TransQuote = A['TransQuote'];
local ScriptQuote = A['ScriptQuote'];
if utilities.is_set (Quote) or utilities.is_set (TransQuote) or utilities.is_set (ScriptQuote) then
if utilities.is_set (Quote) then
if Quote:sub(1, 1) == '"' and Quote:sub(-1, -1) == '"' then -- if first and last characters of quote are quote marks
Quote = Quote:sub(2, -2); -- strip them off
end
end
Quote = kern_quotes (Quote); -- kern if needed
Quote = utilities.wrap_style ('quoted-text', Quote ); -- wrap in <q>...</q> tags
if utilities.is_set (ScriptQuote) then
Quote = script_concatenate (Quote, ScriptQuote, 'script-quote'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after quote is wrapped
end
if utilities.is_set (TransQuote) then
if TransQuote:sub(1, 1) == '"' and TransQuote:sub(-1, -1) == '"' then -- if first and last characters of |trans-quote are quote marks
TransQuote = TransQuote:sub(2, -2); -- strip them off
end
Quote = Quote .. " " .. utilities.wrap_style ('trans-quoted-title', TransQuote );
end
if utilities.is_set (QuotePage) or utilities.is_set (QuotePages) then -- add page prefix
local quote_prefix = '';
if utilities.is_set (QuotePage) then
extra_text_in_page_check (QuotePage, 'quote-page'); -- add to maint cat if |quote-page= value begins with what looks like p., pp., etc.
if not NoPP then
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, QuotePage}), '', '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, QuotePage}), '', '', '';
end
elseif utilities.is_set (QuotePages) then
extra_text_in_page_check (QuotePages, 'quote-pages'); -- add to maint cat if |quote-pages= value begins with what looks like p., pp., etc.
if tonumber(QuotePages) ~= nil and not NoPP then -- if only digits, assume single page
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, QuotePages}), '', '';
elseif not NoPP then
quote_prefix = utilities.substitute (cfg.messages['pp-prefix'], {sepc, QuotePages}), '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, QuotePages}), '', '';
end
end
Quote = quote_prefix .. ": " .. Quote;
else
Quote = sepc .. " " .. Quote;
end
PostScript = ""; -- cs1|2 does not supply terminal punctuation when |quote= is set
end
-- We check length of PostScript here because it will have been nuked by
-- the quote parameters. We'd otherwise emit a message even if there wasn't
-- a displayed postscript.
-- TODO: Should the max size (1) be configurable?
-- TODO: Should we check a specific pattern?
if utilities.is_set(PostScript) and mw.ustring.len(PostScript) > 1 then
utilities.set_message ('maint_postscript')
end
local Archived;
if utilities.is_set (ArchiveURL) then
local arch_text;
if not utilities.is_set (ArchiveDate) then
utilities.set_message ('err_archive_missing_date');
ArchiveDate = ''; -- empty string for concatenation
end
if "live" == UrlStatus then
arch_text = cfg.messages['archived'];
if sepc ~= "." then arch_text = arch_text:lower() end
if utilities.is_set (ArchiveDate) then
Archived = sepc .. ' ' .. utilities.substitute ( cfg.messages['archived-live'],
{external_link( ArchiveURL, arch_text, A:ORIGIN('ArchiveURL'), nil) .. ArchiveFormat, ArchiveDate } );
else
Archived = '';
end
if not utilities.is_set (OriginalURL) then
utilities.set_message ('err_archive_missing_url');
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (OriginalURL) then -- UrlStatus is empty, 'dead', 'unfit', 'usurped', 'bot: unknown'
if utilities.in_array (UrlStatus, {'unfit', 'usurped', 'bot: unknown'}) then
arch_text = cfg.messages['archived-unfit'];
if sepc ~= "." then arch_text = arch_text:lower() end
Archived = sepc .. ' ' .. arch_text .. ArchiveDate; -- format already styled
if 'bot: unknown' == UrlStatus then
utilities.set_message ('maint_bot_unknown'); -- and add a category if not already added
else
utilities.set_message ('maint_unfit'); -- and add a category if not already added
end
else -- UrlStatus is empty, 'dead'
arch_text = cfg.messages['archived-dead'];
if sepc ~= "." then arch_text = arch_text:lower() end
if utilities.is_set (ArchiveDate) then
Archived = sepc .. " " .. utilities.substitute ( arch_text,
{ external_link( OriginalURL, cfg.messages['original'], OriginalURL_origin, OriginalAccess ) .. OriginalFormat, ArchiveDate } ); -- format already styled
else
Archived = ''; -- unset for concatenation
end
end
else -- OriginalUrl not set
arch_text = cfg.messages['archived-missing'];
if sepc ~= "." then arch_text = arch_text:lower() end
utilities.set_message ('err_archive_missing_url');
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (ArchiveFormat) then
Archived = ArchiveFormat; -- if set and ArchiveURL not set ArchiveFormat has error message
else
Archived = '';
end
local Lay = '';
local LaySource = A['LaySource'];
local LayURL = A['LayURL'];
local LayFormat = A['LayFormat'];
LayFormat = style_format (LayFormat, LayURL, 'lay-format', 'lay-url');
if utilities.is_set (LayURL) then
if utilities.is_set (LayDate) then LayDate = " (" .. LayDate .. ")" end
if utilities.is_set (LaySource) then
LaySource = " – ''" .. utilities.safe_for_italics (LaySource) .. "''";
else
LaySource = "";
end
if sepc == '.' then
Lay = sepc .. " " .. external_link( LayURL, cfg.messages['lay summary'], A:ORIGIN('LayURL'), nil ) .. LayFormat .. LaySource .. LayDate
else
Lay = sepc .. " " .. external_link( LayURL, cfg.messages['lay summary']:lower(), A:ORIGIN('LayURL'), nil ) .. LayFormat .. LaySource .. LayDate
end
elseif utilities.is_set (LayFormat) then -- Test if |lay-format= is given without giving a |lay-url=
Lay = sepc .. LayFormat; -- if set and LayURL not set, then LayFormat has error message
end
local TranscriptURL = A['TranscriptURL']
local TranscriptFormat = A['TranscriptFormat'];
TranscriptFormat = style_format (TranscriptFormat, TranscriptURL, 'transcript-format', 'transcripturl');
local Transcript = A['Transcript'];
local TranscriptURL_origin = A:ORIGIN('TranscriptURL'); -- get name of parameter that holds TranscriptURL
if utilities.is_set (Transcript) then
if utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, Transcript, TranscriptURL_origin, nil );
end
Transcript = sepc .. ' ' .. Transcript .. TranscriptFormat;
elseif utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, nil, TranscriptURL_origin, nil );
end
local Publisher;
if utilities.is_set (PublicationDate) then
PublicationDate = wrap_msg ('published', PublicationDate);
end
if utilities.is_set (PublisherName) then
if utilities.is_set (PublicationPlace) then
Publisher = sepc .. " " .. PublicationPlace .. ": " .. PublisherName .. PublicationDate;
else
Publisher = sepc .. " " .. PublisherName .. PublicationDate;
end
elseif utilities.is_set (PublicationPlace) then
Publisher= sepc .. " " .. PublicationPlace .. PublicationDate;
else
Publisher = PublicationDate;
end
local TransPeriodical = A['TransPeriodical'];
local TransPeriodical_origin = A:ORIGIN ('TransPeriodical');
-- Several of the above rely upon detecting this as nil, so do it last.
if (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical) or utilities.is_set (TransPeriodical)) then
if utilities.is_set (Title) or utilities.is_set (TitleNote) then
Periodical = sepc .. " " .. format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
else
Periodical = format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
end
end
local Language = A['Language'];
if utilities.is_set (Language) then
Language = language_parameter (Language); -- format, categories, name from ISO639-1, etc.
else
Language=''; -- language not specified so make sure this is an empty string;
--[[ TODO: need to extract the wrap_msg from language_parameter
so that we can solve parentheses bunching problem with Format/Language/TitleType
]]
end
--[[
Handle the oddity that is cite speech. This code overrides whatever may be the value assigned to TitleNote (through |department=) and forces it to be " (Speech)" so that
the annotation directly follows the |title= parameter value in the citation rather than the |event= parameter value (if provided).
]]
if "speech" == config.CitationClass then -- cite speech only
TitleNote = TitleType; -- move TitleType to TitleNote so that it renders ahead of |event=
TitleType = ''; -- and unset
if utilities.is_set (Periodical) then -- if Periodical, perhaps because of an included |website= or |journal= parameter
if utilities.is_set (Conference) then -- and if |event= is set
Conference = Conference .. sepc .. " "; -- then add appropriate punctuation to the end of the Conference variable before rendering
end
end
end
-- Piece all bits together at last. Here, all should be non-nil.
-- We build things this way because it is more efficient in LUA
-- not to keep reassigning to the same string variable over and over.
local tcommon;
local tcommon2; -- used for book cite when |contributor= is set
if utilities.in_array (config.CitationClass, {"journal", "citation"}) and utilities.is_set (Periodical) then
if not (utilities.is_set (Authors) or utilities.is_set (Editors)) then
Others = Others:gsub ('^' .. sepc .. ' ', ''); -- when no authors and no editors, strip leading sepc and space
end
if utilities.is_set (Others) then Others = safe_join ({Others, sepc .. " "}, sepc) end -- add terminal punctuation & space; check for dup sepc; TODO why do we need to do this here?
tcommon = safe_join( {Others, Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language, Edition, Publisher, Agency, Volume}, sepc );
elseif utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (Periodical) then -- special cases for book cites
if utilities.is_set (Contributors) then -- when we are citing foreword, preface, introduction, etc.
tcommon = safe_join( {Title, TitleNote}, sepc ); -- author and other stuff will come after this and before tcommon2
tcommon2 = safe_join( {Conference, Periodical, Format, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc );
else
tcommon = safe_join( {Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc );
end
elseif 'map' == config.CitationClass then -- special cases for cite map
if utilities.is_set (Chapter) then -- map in a book; TitleType is part of Chapter
tcommon = safe_join( {Title, Format, Edition, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc );
elseif utilities.is_set (Periodical) then -- map in a periodical
tcommon = safe_join( {Title, TitleType, Format, Periodical, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc );
else -- a sheet or stand-alone map
tcommon = safe_join( {Title, TitleType, Format, Edition, Scale, Series, Language, Cartography, Others, Publisher}, sepc );
end
elseif 'episode' == config.CitationClass then -- special case for cite episode
tcommon = safe_join( {Title, TitleNote, TitleType, Series, Language, Edition, Publisher}, sepc );
else -- all other CS1 templates
tcommon = safe_join( {Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language,
Volume, Others, Edition, Publisher, Agency}, sepc );
end
if #ID_list > 0 then
ID_list = safe_join( { sepc .. " ", table.concat( ID_list, sepc .. " " ), ID }, sepc );
else
ID_list = ID;
end
local Via = A['Via'];
Via = utilities.is_set (Via) and wrap_msg ('via', Via) or '';
local idcommon;
if 'audio-visual' == config.CitationClass or 'episode' == config.CitationClass then -- special case for cite AV media & cite episode position transcript
idcommon = safe_join( { ID_list, URL, Archived, Transcript, AccessDate, Via, Lay, Quote }, sepc );
else
idcommon = safe_join( { ID_list, URL, Archived, AccessDate, Via, Lay, Quote }, sepc );
end
local text;
local pgtext = Position .. Sheet .. Sheets .. Page .. Pages .. At;
local OrigDate = A['OrigDate'];
OrigDate = utilities.is_set (OrigDate) and wrap_msg ('origdate', OrigDate) or '';
if utilities.is_set (Date) then
if utilities.is_set (Authors) or utilities.is_set (Editors) then -- date follows authors or editors when authors not set
Date = " (" .. Date .. ")" .. OrigDate .. sepc .. " "; -- in parentheses
else -- neither of authors and editors set
if (string.sub(tcommon, -1, -1) == sepc) then -- if the last character of tcommon is sepc
Date = " " .. Date .. OrigDate; -- Date does not begin with sepc
else
Date = sepc .. " " .. Date .. OrigDate; -- Date begins with sepc
end
end
end
if utilities.is_set (Authors) then
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Authors termination
Authors = terminate_name_list (Authors, sepc); -- when no date, terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Editors) then
local in_text = " ";
local post_text = "";
if utilities.is_set (Chapter) and 0 == #c then
in_text = in_text .. cfg.messages['in'] .. " "
if (sepc ~= '.') then
in_text = in_text:lower() -- lowercase for cs2
end
end
if EditorCount <= 1 then
post_text = " (" .. cfg.messages['editor'] .. ")"; -- be consistent with no-author, no-date case
else
post_text = " (" .. cfg.messages['editors'] .. ")";
end
Editors = terminate_name_list (in_text .. Editors .. post_text, sepc); -- terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Contributors) then -- book cite and we're citing the intro, preface, etc.
local by_text = sepc .. ' ' .. cfg.messages['by'] .. ' ';
if (sepc ~= '.') then by_text = by_text:lower() end -- lowercase for cs2
Authors = by_text .. Authors; -- author follows title so tweak it here
if utilities.is_set (Editors) and utilities.is_set (Date) then -- when Editors make sure that Authors gets terminated
Authors = terminate_name_list (Authors, sepc); -- terminate with 0 or 1 sepc and a space
end
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Contributors termination
Contributors = terminate_name_list (Contributors, sepc); -- terminate with 0 or 1 sepc and a space
end
text = safe_join( {Contributors, Date, Chapter, tcommon, Authors, Place, Editors, tcommon2, pgtext, idcommon }, sepc );
else
text = safe_join( {Authors, Date, Chapter, Place, Editors, tcommon, pgtext, idcommon }, sepc );
end
elseif utilities.is_set (Editors) then
if utilities.is_set (Date) then
if EditorCount <= 1 then
Editors = Editors .. cfg.presentation['sep_name'] .. cfg.messages['editor'];
else
Editors = Editors .. cfg.presentation['sep_name'] .. cfg.messages['editors'];
end
else
if EditorCount <= 1 then
Editors = Editors .. " (" .. cfg.messages['editor'] .. ")" .. sepc .. " "
else
Editors = Editors .. " (" .. cfg.messages['editors'] .. ")" .. sepc .. " "
end
end
text = safe_join( {Editors, Date, Chapter, Place, tcommon, pgtext, idcommon}, sepc );
else
if utilities.in_array (config.CitationClass, {"journal", "citation"}) and utilities.is_set (Periodical) then
text = safe_join( {Chapter, Place, tcommon, pgtext, Date, idcommon}, sepc );
else
text = safe_join( {Chapter, Place, tcommon, Date, pgtext, idcommon}, sepc );
end
end
if utilities.is_set (PostScript) and PostScript ~= sepc then
text = safe_join( {text, sepc}, sepc ); -- Deals with italics, spaces, etc.
text = text:sub(1, -sepc:len() - 1);
end
text = safe_join( {text, PostScript}, sepc );
-- Now enclose the whole thing in a <cite> element
local options_t = {};
options_t.class = cite_class_attribute_make (config.CitationClass, Mode);
local Ref = is_valid_parameter_value (A['Ref'], A:ORIGIN('Ref'), cfg.keywords_lists['ref'], nil, true); -- nil when |ref=harv; A['Ref'] else
if 'none' ~= cfg.keywords_xlate[(Ref and Ref:lower()) or ''] then
local namelist_t = {}; -- holds selected contributor, author, editor name list
local year = first_set ({Year, anchor_year}, 2); -- Year first for legacy citations and for YMD dates that require disambiguation
if #c > 0 then -- if there is a contributor list
namelist_t = c; -- select it
elseif #a > 0 then -- or an author list
namelist_t = a;
elseif #e > 0 then -- or an editor list
namelist_t = e;
end
local citeref_id;
if #namelist_t > 0 then -- if there are names in namelist_t
citeref_id = make_citeref_id (namelist_t, year); -- go make the CITEREF anchor
if mw.uri.anchorEncode (citeref_id) == ((Ref and mw.uri.anchorEncode (Ref)) or '') then -- Ref may already be encoded (by {{sfnref}}) so citeref_id must be encoded before comparison
utilities.set_message ('maint_ref_duplicates_default');
end
else
citeref_id = ''; -- unset
end
options_t.id = Ref or citeref_id;
end
if string.len (text:gsub('%b<>', '')) <= 2 then -- remove html and html-like tags; then get length of what remains;
z.error_cats_t = {}; -- blank the categories list
z.error_msgs_t = {}; -- blank the error messages list
OCinSoutput = nil; -- blank the metadata string
text = ''; -- blank the the citation
utilities.set_message ('err_empty_citation'); -- set empty citation message and category
end
local render_t = {}; -- here we collect the final bits for concatenation into the rendered citation
if utilities.is_set (options_t.id) then -- here we wrap the rendered citation in <cite ...>...</cite> tags
table.insert (render_t, utilities.substitute (cfg.presentation['cite-id'], {mw.uri.anchorEncode(options_t.id), mw.text.nowiki(options_t.class), text})); -- when |ref= is set or when there is a namelist
else
table.insert (render_t, utilities.substitute (cfg.presentation['cite'], {mw.text.nowiki(options_t.class), text})); -- when |ref=none or when namelist_t empty and |ref= is missing or is empty
end
if OCinSoutput then -- blanked when citation is 'empty' so don't bother to add boilerplate metadata span
table.insert (render_t, utilities.substitute (cfg.presentation['ocins'], OCinSoutput)); -- format and append metadata to the citation
end
local template_name = ('citation' == config.CitationClass) and 'citation' or 'cite ' .. (cfg.citation_class_map_t[config.CitationClass] or config.CitationClass);
local template_link = '[[Template:' .. template_name .. '|' .. template_name .. ']]';
local msg_prefix = '<code class="cs1-code">{{' .. template_link .. '}}</code>: ';
if 0 ~= #z.error_msgs_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_e, template_link));
table.insert (render_t, ' '); -- insert a space between citation and its error messages
table.sort (z.error_msgs_t); -- sort the error messages list; sorting includes wrapping <span> and <code> tags; hidden-error sorts ahead of visible-error
local hidden = true; -- presume that the only error messages emited by this template are hidden
for _, v in ipairs (z.error_msgs_t) do -- spin through the list of error messages
if v:find ('cs1-visible-error', 1, true) then -- look for the visible error class name
hidden = false; -- found one; so don't hide the error message prefix
break; -- and done because no need to look further
end
end
z.error_msgs_t[1] = table.concat ({utilities.error_comment (msg_prefix, hidden), z.error_msgs_t[1]}); -- add error message prefix to first error message to prevent extraneous punctuation
table.insert (render_t, table.concat (z.error_msgs_t, '; ')); -- make a big string of error messages and add it to the rendering
end
if 0 ~= #z.maint_cats_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_m, template_link));
table.sort (z.maint_cats_t); -- sort the maintenance messages list
local maint_msgs_t = {}; -- here we collect all of the maint messages
if 0 == #z.error_msgs_t then -- if no error messages
table.insert (maint_msgs_t, msg_prefix); -- insert message prefix in maint message livery
end
for _, v in ipairs( z.maint_cats_t ) do -- append maintenance categories
table.insert (maint_msgs_t, -- assemble new maint message and add it to the maint_msgs_t table
table.concat ({v, ' (', utilities.substitute (cfg.messages[':cat wikilink'], v), ')'})
);
end
table.insert (render_t, utilities.substitute (cfg.presentation['hidden-maint'], table.concat (maint_msgs_t, ' '))); -- wrap the group of maint messages with proper presentation and save
end
if not no_tracking_cats then
for _, v in ipairs (z.error_cats_t) do -- append error categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v));
end
for _, v in ipairs (z.maint_cats_t) do -- append maintenance categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v));
end
for _, v in ipairs (z.prop_cats_t) do -- append properties categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v));
end
end
return table.concat (render_t); -- make a big string and done
end
--[[--------------------------< V A L I D A T E >--------------------------------------------------------------
Looks for a parameter's name in one of several whitelists.
Parameters in the whitelist can have three values:
true - active, supported parameters
false - deprecated, supported parameters
nil - unsupported parameters
]]
local function validate (name, cite_class, empty)
local name = tostring (name);
local enum_name; -- for enumerated parameters, is name with enumerator replaced with '#'
local state;
local function state_test (state, name) -- local function to do testing of state values
if true == state then return true; end -- valid actively supported parameter
if false == state then
if empty then return nil; end -- empty deprecated parameters are treated as unknowns
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
if 'tracked' == state then
local base_name = name:gsub ('%d', ''); -- strip enumerators from parameter names that have them to get the base name
utilities.add_prop_cat ('tracked-param', {base_name}, base_name); -- add a properties category; <base_name> modifies <key>
return true;
end
return nil;
end
if name:find ('#') then -- # is a cs1|2 reserved character so parameters with # not permitted
return nil;
end
if utilities.in_array (cite_class, whitelist.preprint_template_list ) then -- limited parameter sets allowed for these templates
state = whitelist.limited_basic_arguments[name];
if true == state_test (state, name) then return true; end
state = whitelist.preprint_arguments[cite_class][name]; -- look in the parameter-list for the template identified by cite_class
if true == state_test (state, name) then return true; end
-- limited enumerated parameters list
enum_name = name:gsub("%d+", "#" ); -- replace digit(s) with # (last25 becomes last#) (mw.ustring because non-Western 'local' digits)
state = whitelist.limited_numbered_arguments[enum_name];
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end -- end limited parameter-set templates
if utilities.in_array (cite_class, whitelist.unique_param_template_list) then -- experiment for template-specific parameters for templates that accept parameters from the basic argument list
state = whitelist.unique_arguments[cite_class][name]; -- look in the template-specific parameter-lists for the template identified by cite_class
if true == state_test (state, name) then return true; end
end -- if here, fall into general validation
state = whitelist.basic_arguments[name]; -- all other templates; all normal parameters allowed
if true == state_test (state, name) then return true; end
-- all enumerated parameters allowed
enum_name = name:gsub("%d+", "#" ); -- replace digit(s) with # (last25 becomes last#) (mw.ustring because non-Western 'local' digits)
state = whitelist.numbered_arguments[enum_name];
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end
--[=[-------------------------< I N T E R _ W I K I _ C H E C K >----------------------------------------------
check <value> for inter-language interwiki-link markup. <prefix> must be a MediaWiki-recognized language
code. when these values have the form (without leading colon):
[[<prefix>:link|label]] return label as plain-text
[[<prefix>:link]] return <prefix>:link as plain-text
return value as is else
]=]
local function inter_wiki_check (parameter, value)
local prefix = value:match ('%[%[(%a+):'); -- get an interwiki prefix if one exists
local _;
if prefix and cfg.inter_wiki_map[prefix:lower()] then -- if prefix is in the map, needs preceding colon so
utilities.set_message ('err_bad_paramlink', parameter); -- emit an error message
_, value, _ = utilities.is_wikilink (value); -- extract label portion from wikilink
end
return value;
end
--[[--------------------------< M I S S I N G _ P I P E _ C H E C K >------------------------------------------
Look at the contents of a parameter. If the content has a string of characters and digits followed by an equal
sign, compare the alphanumeric string to the list of cs1|2 parameters. If found, then the string is possibly a
parameter that is missing its pipe. There are two tests made:
{{cite ... |title=Title access-date=2016-03-17}} -- the first parameter has a value and whitespace separates that value from the missing pipe parameter name
{{cite ... |title=access-date=2016-03-17}} -- the first parameter has no value (whitespace after the first = is trimmed by MediaWiki)
cs1|2 shares some parameter names with XML/HTML attributes: class=, title=, etc. To prevent false positives XML/HTML
tags are removed before the search.
If a missing pipe is detected, this function adds the missing pipe maintenance category.
]]
local function missing_pipe_check (parameter, value)
local capture;
value = value:gsub ('%b<>', ''); -- remove XML/HTML tags because attributes: class=, title=, etc.
capture = value:match ('%s+(%a[%w%-]+)%s*=') or value:match ('^(%a[%w%-]+)%s*='); -- find and categorize parameters with possible missing pipes
if capture and validate (capture) then -- if the capture is a valid parameter name
utilities.set_message ('err_missing_pipe', parameter);
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ P U N C T >--------------------------------------
look for extraneous terminal punctuation in most parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_punc (param, value)
if 'number' == type (param) then
return;
end
param = param:gsub ('%d+', '#'); -- enumerated name-list mask params allow terminal punct; normalize
if cfg.punct_skip[param] then
return; -- parameter name found in the skip table so done
end
if value:match ('[,;:]$') then
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
if value:match ('^=') then -- sometimes an extraneous '=' character appears ...
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ U R L >------------------------------------------
look for extraneous url parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_url (url_param_t)
local url_error_t = {};
check_for_url (url_param_t, url_error_t); -- extraneous url check
if 0 ~= #url_error_t then -- non-zero when there are errors
table.sort (url_error_t);
utilities.set_message ('err_param_has_ext_link', {utilities.make_sep_list (#url_error_t, url_error_t)}); -- add this error message
end
end
--[[--------------------------< C I T A T I O N >--------------------------------------------------------------
This is used by templates such as {{cite book}} to create the actual citation text.
]]
local function citation(frame)
Frame = frame; -- save a copy in case we need to display an error message in preview mode
local config = {}; -- table to store parameters from the module {{#invoke:}}
for k, v in pairs( frame.args ) do -- get parameters from the {{#invoke}} frame
config[k] = v;
-- args[k] = v; -- crude debug support that allows us to render a citation from module {{#invoke:}}; skips parameter validation; TODO: keep?
end
-- i18n: set the name that your wiki uses to identify sandbox subpages from sandbox template invoke (or can be set here)
local sandbox = ((config.SandboxPath and '' ~= config.SandboxPath) and config.SandboxPath) or '/sandbox'; -- sandbox path from {{#invoke:Citation/CS1/sandbox|citation|SandboxPath=/...}}
is_sandbox = nil ~= string.find (frame:getTitle(), sandbox, 1, true); -- is this invoke the sandbox module?
sandbox = is_sandbox and sandbox or ''; -- use i18n sandbox to load sandbox modules when this module is the sandox; live modules else
local pframe = frame:getParent()
local styles;
cfg = mw.loadData ('Module:Citation/CS1/Configuration' .. sandbox); -- load sandbox versions of support modules when {{#invoke:Citation/CS1/sandbox|...}}; live modules else
whitelist = mw.loadData ('Module:Citation/CS1/Whitelist' .. sandbox);
utilities = require ('Module:Citation/CS1/Utilities' .. sandbox);
validation = require ('Module:Citation/CS1/Date_validation' .. sandbox);
identifiers = require ('Module:Citation/CS1/Identifiers' .. sandbox);
metadata = require ('Module:Citation/CS1/COinS' .. sandbox);
styles = 'Module:Citation/CS1' .. sandbox .. '/styles.css';
utilities.set_selected_modules (cfg); -- so that functions in Utilities can see the selected cfg tables
identifiers.set_selected_modules (cfg, utilities); -- so that functions in Identifiers can see the selected cfg tables and selected Utilities module
validation.set_selected_modules (cfg, utilities); -- so that functions in Date validataion can see selected cfg tables and the selected Utilities module
metadata.set_selected_modules (cfg, utilities); -- so that functions in COinS can see the selected cfg tables and selected Utilities module
z = utilities.z; -- table of error and category tables in Module:Citation/CS1/Utilities
is_preview_mode = not utilities.is_set (frame:preprocess ('{{REVISIONID}}'));
local args = {}; -- table where we store all of the template's arguments
local suggestions = {}; -- table where we store suggestions if we need to loadData them
local error_text; -- used as a flag
local capture; -- the single supported capture when matching unknown parameters using patterns
local empty_unknowns = {}; -- sequence table to hold empty unknown params for error message listing
for k, v in pairs( pframe.args ) do -- get parameters from the parent (template) frame
v = mw.ustring.gsub (v, '^%s*(.-)%s*$', '%1'); -- trim leading/trailing whitespace; when v is only whitespace, becomes empty string
if v ~= '' then
if ('string' == type (k)) then
k = mw.ustring.gsub (k, '%d', cfg.date_names.local_digits); -- for enumerated parameters, translate 'local' digits to Western 0-9
end
if not validate( k, config.CitationClass ) then
if type (k) ~= 'string' then -- exclude empty numbered parameters
if v:match("%S+") ~= nil then
error_text = utilities.set_message ('err_text_ignored', {v});
end
elseif validate (k:lower(), config.CitationClass) then
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, k:lower()}); -- suggest the lowercase version of the parameter
else
if nil == suggestions.suggestions then -- if this table is nil then we need to load it
suggestions = mw.loadData ('Module:Citation/CS1/Suggestions' .. sandbox); --load sandbox version of suggestion module when {{#invoke:Citation/CS1/sandbox|...}}; live module else
end
for pattern, param in pairs (suggestions.patterns) do -- loop through the patterns to see if we can suggest a proper parameter
capture = k:match (pattern); -- the whole match if no capture in pattern else the capture if a match
if capture then -- if the pattern matches
param = utilities.substitute (param, capture); -- add the capture to the suggested parameter (typically the enumerator)
if validate (param, config.CitationClass) then -- validate the suggestion to make sure that the suggestion is supported by this template (necessary for limited parameter lists)
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, param}); -- set the suggestion error message
else
error_text = utilities.set_message ('err_parameter_ignored', {k}); -- suggested param not supported by this template
v = ''; -- unset
end
end
end
if not utilities.is_set (error_text) then -- couldn't match with a pattern, is there an explicit suggestion?
if (suggestions.suggestions[ k:lower() ] ~= nil) and validate (suggestions.suggestions[ k:lower() ], config.CitationClass) then
utilities.set_message ('err_parameter_ignored_suggest', {k, suggestions.suggestions[ k:lower() ]});
else
utilities.set_message ('err_parameter_ignored', {k});
v = ''; -- unset value assigned to unrecognized parameters (this for the limited parameter lists)
end
end
end
end
args[k] = v; -- save this parameter and its value
elseif not utilities.is_set (v) then -- for empty parameters
if not validate (k, config.CitationClass, true) then -- is this empty parameter a valid parameter
k = ('' == k) and '(empty string)' or k; -- when k is empty string (or was space(s) trimmed to empty string), replace with descriptive text
table.insert (empty_unknowns, utilities.wrap_style ('parameter', k)); -- format for error message and add to the list
end
-- crude debug support that allows us to render a citation from module {{#invoke:}} TODO: keep?
-- elseif args[k] ~= nil or (k == 'postscript') then -- when args[k] has a value from {{#invoke}} frame (we don't normally do that)
-- args[k] = v; -- overwrite args[k] with empty string from pframe.args[k] (template frame); v is empty string here
end -- not sure about the postscript bit; that gets handled in parameter validation; historical artifact?
end
if 0 ~= #empty_unknowns then -- create empty unknown error message
utilities.set_message ('err_param_unknown_empty', {
1 == #empty_unknowns and '' or 's',
utilities.make_sep_list (#empty_unknowns, empty_unknowns)
});
end
local url_param_t = {};
for k, v in pairs( args ) do
if 'string' == type (k) then -- don't evaluate positional parameters
has_invisible_chars (k, v); -- look for invisible characters
end
has_extraneous_punc (k, v); -- look for extraneous terminal punctuation in parameter values
missing_pipe_check (k, v); -- do we think that there is a parameter that is missing a pipe?
args[k] = inter_wiki_check (k, v); -- when language interwiki-linked parameter missing leading colon replace with wiki-link label
if 'string' == type (k) and not cfg.url_skip[k] then -- when parameter k is not positional and not in url skip table
url_param_t[k] = v; -- make a parameter/value list for extraneous url check
end
end
has_extraneous_url (url_param_t); -- look for url in parameter values where a url does not belong
return table.concat ({
frame:extensionTag ('templatestyles', '', {src=styles}),
citation0( config, args)
});
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {citation = citation};
9bfe095ac3f64719c64a17280b76d0add203ad61
Module:If empty
828
132
272
2023-01-26T18:33:28Z
wikipedia>MSGJ
0
lastk is not needed
Scribunto
text/plain
local p = {}
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})
for k,v in ipairs(args) do
if v ~= '' then
return v
end
end
end
return p
4790391408957dea3ff9f453834c05f6b379a45c
Template:Dated maintenance category (articles)
10
195
407
2023-02-03T03:07:34Z
wikipedia>UtherSRG
0
UtherSRG moved page [[Template:DMCA]] to [[Template:Dated maintenance category (articles)]]: [[Special:Permalink/1137158761|Requested]] by Robertsky at [[WP:RM/TR]]: Per RM discussion. See [[Template_talk:DMCA#Requested_move_26_January_2023]]. Template protected at template editor/admin level
wikitext
text/x-wiki
{{Dated maintenance category
|onlyarticles=yes
|1={{{1|}}}
|2={{{2|}}}
|3={{{3|}}}
|4={{{4|}}}
|5={{{5|}}}
}}<noinclude>
{{documentation|Template:Dated maintenance category/doc}}
</noinclude>
6bbc57c75cc28708a0e71dd658224d5945d80d68
Template:DMCA
10
181
379
2023-02-03T21:12:07Z
wikipedia>Paine Ellsworth
0
add [[WP:RCAT|rcat template]]
wikitext
text/x-wiki
#REDIRECT [[Template:Dated maintenance category (articles)]]
{{Redirect category shell|
{{R from move}}
{{R from modification}}
{{R from template shortcut}}
}}
711d3f1c53fa704297f675a8dcf1a56719c5b654
Module:Lua banner
828
76
154
2023-02-16T14:39:53Z
wikipedia>Uzume
0
[[Module:Citation]] has been blanked since [[Wikipedia:Templates for discussion/Log/2018 May 13#Module:Citation]]; remove special handling
Scribunto
text/plain
-- This module implements the {{lua}} template.
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local p = {}
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args)
local modules = mTableTools.compressSparseArray(args)
local box = p.renderBox(modules)
local trackingCategories = p.renderTrackingCategories(args, modules)
return box .. trackingCategories
end
function p.renderBox(modules)
local boxArgs = {}
if #modules < 1 then
boxArgs.text = '<strong class="error">Error: no modules specified</strong>'
else
local moduleLinks = {}
for i, module in ipairs(modules) do
moduleLinks[i] = string.format('[[:%s]]', module)
local maybeSandbox = mw.title.new(module .. '/sandbox')
if maybeSandbox.exists then
moduleLinks[i] = moduleLinks[i] .. string.format(' ([[:%s|sandbox]])', maybeSandbox.fullText)
end
end
local moduleList = mList.makeList('bulleted', moduleLinks)
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" then
title = title.basePageTitle
end
if title.contentModel == "Scribunto" then
boxArgs.text = 'This module depends on the following other modules:' .. moduleList
else
boxArgs.text = 'This template uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
end
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = '[[File:Lua-Logo.svg|30px|alt=|link=]]'
return mMessageBox.main('mbox', boxArgs)
end
function p.renderTrackingCategories(args, modules, titleObj)
if yesno(args.nocat) then
return ''
end
local cats = {}
-- Error category
if #modules < 1 then
cats[#cats + 1] = 'Lua templates with errors'
end
-- Lua templates category
titleObj = titleObj or mw.title.getCurrentTitle()
local subpageBlacklist = {
doc = true,
sandbox = true,
sandbox2 = true,
testcases = true
}
if not subpageBlacklist[titleObj.subpageText] then
local protCatName
if titleObj.namespace == 10 then
local category = args.category
if not category then
local categories = {
['Module:String'] = 'Templates based on the String Lua module',
['Module:Math'] = 'Templates based on the Math Lua module',
['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module',
['Module:Citation/CS1'] = 'Templates based on the Citation/CS1 Lua module'
}
category = modules[1] and categories[modules[1]]
category = category or 'Lua-based templates'
end
cats[#cats + 1] = category
protCatName = "Templates using under-protected Lua modules"
elseif titleObj.namespace == 828 then
protCatName = "Modules depending on under-protected modules"
end
if not args.noprotcat and protCatName then
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
local currentProt
if titleObj.id ~= 0 then
-- id is 0 (page does not exist) if am previewing before creating a template.
currentProt = titleObj.protectionLevels["edit"][1]
end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
if module ~= "WP:libraryUtil" then
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt < currentProt then
cats[#cats + 1] = protCatName
break
end
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
return p
03ec1b34a40121efc562c0c64a67ebbf57d56dff
Module:Shortcut/styles.css
828
88
178
2023-03-14T15:53:59Z
wikipedia>Izno
0
Undid revision 1144571295 by [[Special:Contributions/TheDJ|TheDJ]] ([[User talk:TheDJ|talk]]) I'm sorry, that's not what we discussed or agreed to
text
text/plain
/* {{pp-template}} */
.module-shortcutboxplain {
float: right;
margin: 0 0 0 1em;
border: 1px solid #aaa;
background: #fff;
padding: 0.3em 0.6em 0.2em 0.6em;
text-align: center;
font-size: 85%;
}
.module-shortcutboxleft {
float: left;
margin: 0 1em 0 0;
}
.module-shortcutlist {
display: inline-block;
border-bottom: 1px solid #aaa;
margin-bottom: 0.2em;
}
.module-shortcutboxplain ul {
font-weight: bold;
}
.module-shortcutanchordiv {
position: relative;
top: -3em;
}
li .module-shortcutanchordiv {
float: right; /* IE/Edge in list items */
}
.mbox-imageright .module-shortcutboxplain {
padding: 0.4em 1em 0.4em 1em;
line-height: 1.3;
margin: 0;
}
ccf3877e4b14726147d3b1d8a297fbecacdb2cf8
Module:LuaCall
828
83
168
2023-04-04T19:01:48Z
wikipedia>Lemondoge
0
Modified code formatting
Scribunto
text/plain
local p={}
function p.main(frame)
local parent = frame.getParent(frame) or {}
local reserved_value = {}
local reserved_function, reserved_contents
for k, v in pairs(parent.args or {}) do
_G[k] = tonumber(v) or v -- transfer every parameter directly to the global variable table
end
for k, v in pairs(frame.args or {}) do
_G[k] = tonumber(v) or v -- transfer every parameter directly to the global variable table
end
--- Alas Scribunto does NOT implement coroutines, according to
--- http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#string.format
--- this will not stop us from trying to implement one single lousy function call
if _G[1] then
reserved_function, reserved_contents = mw.ustring.match(_G[1], "^%s*(%a[^%s%(]*)%(([^%)]*)%)%s*$")
end
if reserved_contents then
local reserved_counter = 0
repeat
reserved_counter = reserved_counter + 1
reserved_value[reserved_counter] = _G[mw.ustring.match(reserved_contents, "([^%,]+)")]
reserved_contents = mw.ustring.match(reserved_contents, "[^%,]+,(.*)$")
until not reserved_contents
end
local reserved_arraypart = _G
while mw.ustring.match(reserved_function, "%.") do
reserved_functionpart, reserved_function = mw.ustring.match(reserved_function, "^(%a[^%.]*)%.(.*)$")
reserved_arraypart = reserved_arraypart[reserved_functionpart]
end
local reserved_call = reserved_arraypart[reserved_function]
if type(reserved_call) ~= "function" then
return tostring(reserved_call)
else
reserved_output = {reserved_call(unpack(reserved_value))}
return reserved_output[reserved_return or 1]
end
end
local function tonumberOrString(v)
return tonumber(v) or v:gsub("^\\", "", 1)
end
local function callWithTonumberOrStringOnPairs(f, ...)
local args = {}
for _, v in ... do
table.insert(args, tonumberOrString(v))
end
return (f(unpack(args)))
end
--[[
------------------------------------------------------------------------------------
-- ipairsAtOffset
-- This is an iterator for arrays. It can be used like ipairs, but with
-- specified i as first index to iterate. i is an offset from 1
--
------------------------------------------------------------------------------------
--]]
local function ipairsAtOffset(t, i)
local f, s, i0 = ipairs(t)
return f, s, i0+i
end
local function get(s)
local G = _G; for _ in mw.text.gsplit(
mw.text.trim(s, '%s'), '%s*%.%s*'
) do
G = G[_]
end
return G
end
--[[
------------------------------------------------------------------------------------
-- call
--
-- This function is usually useful for debugging template parameters.
-- Prefix parameter with backslash (\) to force interpreting parameter as string.
-- The leading backslash will be removed before passed to Lua function.
--
-- Example:
-- {{#invoke:LuaCall|call|mw.log|a|1|2|3}} will return results of mw.log('a', 1, 2, 3)
-- {{#invoke:LuaCall|call|mw.logObject|\a|321|\321| \321 }} will return results of mw.logObject('a', 321, '321', ' \\321 ')
--
-- This example show the debugging to see which Unicode characters are allowed in template parameters,
-- {{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x0061}}}} return 97
-- {{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x0000}}}} return 65533
-- {{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x0001}}}} return 65533
-- {{#invoke:LuaCall|call|string.format|0x%04x|{{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x0002}}}}}} return 0xfffd
-- {{#invoke:LuaCall|call|string.format|0x%04x|{{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x007e}}}}}} return 0x007e
-- {{#invoke:LuaCall|call|string.format|0x%04x|{{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x007f}}}}}} return 0x007f
-- {{#invoke:LuaCall|call|string.format|0x%04x|{{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x0080}}}}}} return 0x0080
-- {{#invoke:LuaCall|call|string.format|0x%04x|{{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x00a0}}}}}} return 0x00a0
--
------------------------------------------------------------------------------------
--]]
function p.call(frame)
return callWithTonumberOrStringOnPairs(get(frame.args[1]),
ipairsAtOffset(frame.args, 1)
)
end
--local TableTools = require('Module:TableTools')
--[[
------------------------------------------------------------------------------------
-- get
--
-- Example:
-- {{#invoke:LuaCall|get| math.pi }} will return value of math.pi
-- {{#invoke:LuaCall|get|math|pi}} will return value of math.pi
-- {{#invoke:LuaCall|get| math |pi}} will return value of _G[' math '].pi
-- {{#invoke:LuaCall|get|_G| math.pi }} will return value of _G[' math.pi ']
-- {{#invoke:LuaCall|get|obj.a.5.c}} will return value of obj.a['5'].c
-- {{#invoke:LuaCall|get|obj|a|5|c}} will return value of obj.a[5].c
--
------------------------------------------------------------------------------------
--]]
function p.get(frame)
-- #frame.args always return 0, regardless of number of unnamed
-- template parameters, so check manually instead
if frame.args[2] == nil then
-- not do tonumber() for this args style,
-- always treat it as string,
-- so 'obj.1' will mean obj['1'] rather obj[1]
return get(frame.args[1])
else
local G = _G
for _, v in ipairs(frame.args) do
G = G[tonumberOrString(v)]
end
return G
end
end
--[[
------------------------------------------------------------------------------------
-- invoke
--
-- This function is used by Template:Invoke
--
------------------------------------------------------------------------------------
--]]
function p.invoke(frame)
local pframe, usedpargs = frame:getParent(), {}
-- get module and function names from parent args if not provided
local pfargs = setmetatable({frame.args[1], frame.args[2]}, {__index = table})
if not pfargs[1] then
pfargs[1], usedpargs[1] = pframe.args[1], true
if not pfargs[2] then
pfargs[2], usedpargs[2] = pframe.args[2], true
end
elseif not pfargs[2] then
pfargs[2], usedpargs[1] = pframe.args[1], true
end
-- repack sequential args
for i, v in ipairs(pframe.args) do
if not usedpargs[i] then
pfargs:insert(v)
usedpargs[i] = true
end
end
-- copy other args
for k, v in pairs(pframe.args) do
if not pfargs[k] and not usedpargs[k] then
pfargs[k], usedpargs[k] = v, true
end
end
-- #invoke off parent frame so the new frame has the same parent
return pframe:callParserFunction{name = '#invoke', args = pfargs}
end
return p
d6ec342627682bf90e61bbad921fcc6190f2e090
Template:Uses TemplateStyles
10
155
318
2023-04-18T22:22:16Z
wikipedia>Grufo
0
Move the preview inside the documentation
wikitext
text/x-wiki
<includeonly>{{#invoke:Uses TemplateStyles|main}}</includeonly><noinclude>{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
60f2fc73c4d69b292455879f9fcb3c68f6c63c2a
Template:Elc
10
191
399
2023-04-19T17:10:44Z
wikipedia>Grufo
0
Add includeonly
wikitext
text/x-wiki
<includeonly><code>[<nowiki/>[{{{1}}}{{#if:{{{2|}}}|{{!}}{{{2}}}}}]<nowiki/>]{{{3|}}}</code></includeonly><!--
--><noinclude>
{{documentation}}
</noinclude>
d76ca6072fb7ca852811a573aa38e9026487417c
Template:Infobox YouTube personality/styles.css
10
167
342
2023-04-21T18:26:25Z
wikipedia>Prefall
0
fix per talk
sanitized-css
text/css
/* {{pp|small=yes}} */
/* youtube color branding */
.ib-youtube-title,
.ib-youtube-above,
.ib-youtube-header,
.ib-youtube-awards-color {
background-color: #B60000;
color: white;
}
.ib-youtube-above {
font-size: 125%;
}
.ib-youtube-above .honorific-prefix,
.ib-youtube-above .honorific-suffix {
font-size: small;
font-weight: normal;
}
/* override blue link on red background */
.ib-youtube-above .honorific-prefix a,
.ib-youtube-above .honorific-suffix a,
.ib-youtube-awards-color a,
.ib-youtube-awards-color .mw-collapsible-text,
.ib-youtube-awards-color .mw-collapsible-toggle::before,
.ib-youtube-awards-color .mw-collapsible-toggle::after {
color: white;
}
.ib-youtube-header {
line-height: 1.5em;
}
.ib-youtube-title {
line-height: 1.6em;
}
.ib-youtube .infobox-full-data {
padding: 0;
}
.ib-youtube div.nickname,
.ib-youtube div.birthplace,
.ib-youtube div.deathplace {
display: inline;
}
.ib-youtube-awards {
width: 100%;
display: inline-table;
border-spacing: 0;
margin: 0; /* mobile fix */
}
.ib-youtube-awards th div {
text-align: center;
margin: 0 4em;
}
.ib-youtube-awards td {
vertical-align: middle;
}
.ib-youtube-below {
color: darkslategray;
}
/* mobile fixes */
body.skin-minerva .ib-youtube-title {
padding: 7px;
}
body:not(.skin-minerva) .ib-youtube-awards td {
padding: 3px;
}
body.skin-minerva .ib-youtube-below hr:first-of-type {
display: none;
}
111c6691e3dc7827fe4fee42345186e0eb20fd0d
Template:Documentation subpage
10
63
128
2023-04-29T17:27:17Z
wikipedia>Paine Ellsworth
0
m
wikitext
text/x-wiki
<includeonly><!--
-->{{#ifeq:{{lc:{{SUBPAGENAME}}}} |{{{override|doc}}}
| <!--(this template has been transcluded on a /doc or /{{{override}}} page)-->
</includeonly><!--
-->{{#ifeq:{{{doc-notice|show}}} |show
| {{Mbox
| type = notice
| style = margin-bottom:1.0em;
| image = [[File:Edit-copy green.svg|40px|alt=|link=]]
| text =
{{strong|This is a [[Wikipedia:Template documentation|documentation]] [[Wikipedia:Subpages|subpage]]}} for {{terminate sentence|{{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}}}<br />It may contain usage information, [[Wikipedia:Categorization|categories]] and other content that is not part of the original {{#if:{{{text2|}}} |{{{text2}}} |{{#if:{{{text1|}}} |{{{text1}}} |{{#ifeq:{{SUBJECTSPACE}} |{{ns:User}} |{{lc:{{SUBJECTSPACE}}}} template page |{{#if:{{SUBJECTSPACE}} |{{lc:{{SUBJECTSPACE}}}} page|article}}}}}}}}.
}}
}}<!--
-->{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}<!--
-->{{#if:{{{inhibit|}}} |<!--(don't categorize)-->
| <includeonly><!--
-->{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}
| [[Category:{{#switch:{{SUBJECTSPACE}} |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
| [[Category:Documentation subpages without corresponding pages]]
}}<!--
--></includeonly>
}}<!--
(completing initial #ifeq: at start of template:)
--><includeonly>
| <!--(this template has not been transcluded on a /doc or /{{{override}}} page)-->
}}<!--
--></includeonly><noinclude>{{Documentation}}</noinclude>
41ca90af0945442788a2dbd08c8c54a61a23c057
Template:Infobox Twitch streamer/styles.css
10
166
340
2023-05-01T11:00:19Z
wikipedia>Prefall
0
update
sanitized-css
text/css
/* {{pp|small=yes}} */
/* twitch color branding */
.ib-twitch-title,
.ib-twitch-above,
.ib-twitch-header {
background-color: #6441A4;
color: white;
}
.ib-twitch-above {
font-size: 125%;
}
.ib-twitch-above .honorific-prefix,
.ib-twitch-above .honorific-suffix {
font-size: small;
font-weight: normal;
}
/* override blue link on purple background */
.ib-twitch-above .honorific-prefix a,
.ib-twitch-above .honorific-suffix a {
color: white;
}
.ib-twitch-header {
line-height: 1.5em;
}
.ib-twitch-title {
line-height: 1.6em;
}
.ib-twitch .infobox-full-data {
padding: 0;
}
.ib-twitch div.nickname,
.ib-twitch div.birthplace,
.ib-twitch div.deathplace {
display: inline;
}
.ib-twitch-below {
color: darkslategray;
}
/* mobile fixes */
body.skin-minerva .ib-twitch-title {
padding: 7px;
}
body.skin-minerva .ib-twitch-below hr:first-of-type {
display: none;
}
f972ac5a3688c2930702bb6a37a6de39fd9c993a
Module:Protection banner/config
828
34
70
2023-05-08T11:41:01Z
wikipedia>Fayenatic london
0
Update categories from "fully-protected" to "fully protected", removing hyphen, per valid request at [[WP:CFDS]]
Scribunto
text/plain
-- This module provides configuration data for [[Module:Protection banner]].
return {
--------------------------------------------------------------------------------
--
-- BANNER DATA
--
--------------------------------------------------------------------------------
--[[
-- Banner data consists of six fields:
-- * text - the main protection text that appears at the top of protection
-- banners.
-- * explanation - the text that appears below the main protection text, used
-- to explain the details of the protection.
-- * tooltip - the tooltip text you see when you move the mouse over a small
-- padlock icon.
-- * link - the page that the small padlock icon links to.
-- * alt - the alt text for the small padlock icon. This is also used as tooltip
-- text for the large protection banners.
-- * image - the padlock image used in both protection banners and small padlock
-- icons.
--
-- The module checks in three separate tables to find a value for each field.
-- First it checks the banners table, which has values specific to the reason
-- for the page being protected. Then the module checks the defaultBanners
-- table, which has values specific to each protection level. Finally, the
-- module checks the masterBanner table, which holds data for protection
-- templates to use if no data has been found in the previous two tables.
--
-- The values in the banner data can take parameters. These are specified
-- using ${TEXTLIKETHIS} (a dollar sign preceding a parameter name
-- enclosed in curly braces).
--
-- Available parameters:
--
-- ${CURRENTVERSION} - a link to the page history or the move log, with the
-- display message "current-version-edit-display" or
-- "current-version-move-display".
--
-- ${EDITREQUEST} - a link to create an edit request for the current page.
--
-- ${EXPLANATIONBLURB} - an explanation blurb, e.g. "Please discuss any changes
-- on the talk page; you may submit a request to ask an administrator to make
-- an edit if it is minor or supported by consensus."
--
-- ${IMAGELINK} - a link to set the image to, depending on the protection
-- action and protection level.
--
-- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry
-- is set. E.g. "Editing of this page by new or unregistered users is currently
-- disabled until dd Month YYYY."
--
-- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation
-- so that it can be used in run-on sentences.
--
-- ${PAGETYPE} - the type of the page, e.g. "article" or "template".
-- Defined in the cfg.pagetypes table.
--
-- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g.
-- "Editing of this page by new or unregistered users is currently disabled"
--
-- ${PROTECTIONDATE} - the protection date, if it has been supplied to the
-- template.
--
-- ${PROTECTIONLEVEL} - the protection level, e.g. "fully protected" or
-- "semi-protected".
--
-- ${PROTECTIONLOG} - a link to the protection log or the pending changes log,
-- depending on the protection action.
--
-- ${TALKPAGE} - a link to the talk page. If a section is specified, links
-- straight to that talk page section.
--
-- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to
-- create a blurb like "This template is semi-protected", or "This article is
-- move-protected until DD Month YYYY".
--
-- ${VANDAL} - links for the specified username (or the root page name)
-- using Module:Vandal-m.
--
-- Functions
--
-- For advanced users, it is possible to use Lua functions instead of strings
-- in the banner config tables. Using functions gives flexibility that is not
-- possible just by using parameters. Functions take two arguments, the
-- protection object and the template arguments, and they must output a string.
--
-- For example:
--
-- text = function (protectionObj, args)
-- if protectionObj.level == 'autoconfirmed' then
-- return 'foo'
-- else
-- return 'bar'
-- end
-- end
--
-- Some protection object properties and methods that may be useful:
-- protectionObj.action - the protection action
-- protectionObj.level - the protection level
-- protectionObj.reason - the protection reason
-- protectionObj.expiry - the expiry. Nil if unset, the string "indef" if set
-- to indefinite, and the protection time in unix time if temporary.
-- protectionObj.protectionDate - the protection date in unix time, or nil if
-- unspecified.
-- protectionObj.bannerConfig - the banner config found by the module. Beware
-- of editing the config field used by the function, as it could create an
-- infinite loop.
-- protectionObj:isProtected - returns a boolean showing whether the page is
-- protected.
-- protectionObj:isTemporary - returns a boolean showing whether the expiry is
-- temporary.
-- protectionObj:isIncorrect - returns a boolean showing whether the protection
-- template is incorrect.
--]]
-- The master banner data, used if no values have been found in banners or
-- defaultBanners.
masterBanner = {
text = '${INTROBLURB}',
explanation = '${EXPLANATIONBLURB}',
tooltip = '${TOOLTIPBLURB}',
link = '${IMAGELINK}',
alt = 'Page ${PROTECTIONLEVEL}'
},
-- The default banner data. This holds banner data for different protection
-- levels.
-- *required* - this table needs edit, move, autoreview and upload subtables.
defaultBanners = {
edit = {},
move = {},
autoreview = {
default = {
alt = 'Page protected with pending changes',
tooltip = 'All edits by unregistered and new users are subject to review prior to becoming visible to unregistered users',
image = 'Pending-protection-shackle.svg'
}
},
upload = {}
},
-- The banner data. This holds banner data for different protection reasons.
-- In fact, the reasons specified in this table control which reasons are
-- valid inputs to the first positional parameter.
--
-- There is also a non-standard "description" field that can be used for items
-- in this table. This is a description of the protection reason for use in the
-- module documentation.
--
-- *required* - this table needs edit, move, autoreview and upload subtables.
banners = {
edit = {
blp = {
description = 'For pages protected to promote compliance with the'
.. ' [[Wikipedia:Biographies of living persons'
.. '|biographies of living persons]] policy',
text = '${INTROFRAGMENT} to promote compliance with'
.. ' [[Wikipedia:Biographies of living persons'
.. "|Wikipedia's policy on the biographies"
.. ' of living people]].',
tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on'
.. ' biographies of living persons',
},
dmca = {
description = 'For pages protected by the Wikimedia Foundation'
.. ' due to [[Digital Millennium Copyright Act]] takedown requests',
explanation = function (protectionObj, args)
local ret = 'Pursuant to a rights owner notice under the Digital'
.. ' Millennium Copyright Act (DMCA) regarding some content'
.. ' in this article, the Wikimedia Foundation acted under'
.. ' applicable law and took down and restricted the content'
.. ' in question.'
if args.notice then
ret = ret .. ' A copy of the received notice can be found here: '
.. args.notice .. '.'
end
ret = ret .. ' For more information, including websites discussing'
.. ' how to file a counter-notice, please see'
.. " [[Wikipedia:Office actions]] and the article's ${TALKPAGE}."
.. "'''Do not remove this template from the article until the"
.. " restrictions are withdrawn'''."
return ret
end,
image = 'Office-protection-shackle.svg',
},
dispute = {
description = 'For pages protected due to editing disputes',
text = function (protectionObj, args)
-- Find the value of "disputes".
local display = 'disputes'
local disputes
if args.section then
disputes = string.format(
'[[%s:%s#%s|%s]]',
mw.site.namespaces[protectionObj.title.namespace].talk.name,
protectionObj.title.text,
args.section,
display
)
else
disputes = display
end
-- Make the blurb, depending on the expiry.
local msg
if type(protectionObj.expiry) == 'number' then
msg = '${INTROFRAGMENT} or until editing %s have been resolved.'
else
msg = '${INTROFRAGMENT} until editing %s have been resolved.'
end
return string.format(msg, disputes)
end,
explanation = "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
tooltip = '${TOOLTIPFRAGMENT} due to editing disputes',
},
ecp = {
description = 'For articles in topic areas authorized by'
.. ' [[Wikipedia:Arbitration Committee|ArbCom]] or'
.. ' meets the criteria for community use',
tooltip = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
alt = 'Extended-protected ${PAGETYPE}',
},
mainpage = {
description = 'For pages protected for being displayed on the [[Main Page]]',
text = 'This file is currently'
.. ' [[Wikipedia:This page is protected|protected]] from'
.. ' editing because it is currently or will soon be displayed'
.. ' on the [[Main Page]].',
explanation = 'Images on the Main Page are protected due to their high'
.. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.'
.. '<br /><span style="font-size:90%;">'
.. "'''Administrators:''' Once this image is definitely off the Main Page,"
.. ' please unprotect this file, or reduce to semi-protection,'
.. ' as appropriate.</span>',
},
office = {
description = 'For pages protected by the Wikimedia Foundation',
text = function (protectionObj, args)
local ret = 'This ${PAGETYPE} is currently under the'
.. ' scrutiny of the'
.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
.. ' and is protected.'
if protectionObj.protectionDate then
ret = ret .. ' It has been protected since ${PROTECTIONDATE}.'
end
return ret
end,
explanation = "If you can edit this page, please discuss all changes and"
.. " additions on the ${TALKPAGE} first. '''Do not remove protection from this"
.. " page unless you are authorized by the Wikimedia Foundation to do"
.. " so.'''",
image = 'Office-protection-shackle.svg',
},
reset = {
description = 'For pages protected by the Wikimedia Foundation and'
.. ' "reset" to a bare-bones version',
text = 'This ${PAGETYPE} is currently under the'
.. ' scrutiny of the'
.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
.. ' and is protected.',
explanation = function (protectionObj, args)
local ret = ''
if protectionObj.protectionDate then
ret = ret .. 'On ${PROTECTIONDATE} this ${PAGETYPE} was'
else
ret = ret .. 'This ${PAGETYPE} has been'
end
ret = ret .. ' reduced to a'
.. ' simplified, "bare bones" version so that it may be completely'
.. ' rewritten to ensure it meets the policies of'
.. ' [[WP:NPOV|Neutral Point of View]] and [[WP:V|Verifiability]].'
.. ' Standard Wikipedia policies will apply to its rewriting—which'
.. ' will eventually be open to all editors—and will be strictly'
.. ' enforced. The ${PAGETYPE} has been ${PROTECTIONLEVEL} while'
.. ' it is being rebuilt.\n\n'
.. 'Any insertion of material directly from'
.. ' pre-protection revisions of the ${PAGETYPE} will be removed, as'
.. ' will any material added to the ${PAGETYPE} that is not properly'
.. ' sourced. The associated talk page(s) were also cleared on the'
.. " same date.\n\n"
.. "If you can edit this page, please discuss all changes and"
.. " additions on the ${TALKPAGE} first. '''Do not override"
.. " this action, and do not remove protection from this page,"
.. " unless you are authorized by the Wikimedia Foundation"
.. " to do so. No editor may remove this notice.'''"
return ret
end,
image = 'Office-protection-shackle.svg',
},
sock = {
description = 'For pages protected due to'
.. ' [[Wikipedia:Sock puppetry|sock puppetry]]',
text = '${INTROFRAGMENT} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
.. ' [[Wikipedia:Blocking policy|blocked]] or'
.. ' [[Wikipedia:Banning policy|banned users]]'
.. ' from editing it.',
tooltip = '${TOOLTIPFRAGMENT} to prevent sock puppets of blocked or banned users from'
.. ' editing it',
},
template = {
description = 'For [[Wikipedia:High-risk templates|high-risk]]'
.. ' templates and Lua modules',
text = 'This is a permanently [[Help:Protection|protected]] ${PAGETYPE},'
.. ' as it is [[Wikipedia:High-risk templates|high-risk]].',
explanation = 'Please discuss any changes on the ${TALKPAGE}; you may'
.. ' ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] or'
.. ' [[Wikipedia:Template editor|template editor]] to make an edit if'
.. ' it is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by'
.. ' [[Wikipedia:Consensus|consensus]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.',
tooltip = 'This high-risk ${PAGETYPE} is permanently ${PROTECTIONLEVEL}'
.. ' to prevent vandalism',
alt = 'Permanently protected ${PAGETYPE}',
},
usertalk = {
description = 'For pages protected against disruptive edits by a'
.. ' particular user',
text = '${INTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,'
.. ' such as abusing the'
.. ' {{[[Template:unblock|unblock]]}} template.',
explanation = 'If you cannot edit this user talk page and you need to'
.. ' make a change or leave a message, you can'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for edits to a protected page'
.. '|request an edit]],'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]],'
.. ' [[Special:Userlogin|log in]],'
.. ' or [[Special:UserLogin/signup|create an account]].',
},
vandalism = {
description = 'For pages protected against'
.. ' [[Wikipedia:Vandalism|vandalism]]',
text = '${INTROFRAGMENT} due to [[Wikipedia:Vandalism|vandalism]].',
explanation = function (protectionObj, args)
local ret = ''
if protectionObj.level == 'sysop' then
ret = ret .. "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. '
end
return ret .. '${EXPLANATIONBLURB}'
end,
tooltip = '${TOOLTIPFRAGMENT} due to vandalism',
}
},
move = {
dispute = {
description = 'For pages protected against page moves due to'
.. ' disputes over the page title',
explanation = "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
image = 'Move-protection-shackle.svg'
},
vandalism = {
description = 'For pages protected against'
.. ' [[Wikipedia:Vandalism#Page-move vandalism'
.. ' |page-move vandalism]]'
}
},
autoreview = {},
upload = {}
},
--------------------------------------------------------------------------------
--
-- GENERAL DATA TABLES
--
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Protection blurbs
--------------------------------------------------------------------------------
-- This table produces the protection blurbs available with the
-- ${PROTECTIONBLURB} parameter. It is sorted by protection action and
-- protection level, and is checked by the module in the following order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
-- 3. "edit" protection action, default protection level
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
protectionBlurbs = {
edit = {
default = 'This ${PAGETYPE} is currently [[Help:Protection|'
.. 'protected]] from editing',
autoconfirmed = 'Editing of this ${PAGETYPE} by [[Wikipedia:User access'
.. ' levels#New users|new]] or [[Wikipedia:User access levels#Unregistered'
.. ' users|unregistered]] users is currently [[Help:Protection|disabled]]',
extendedconfirmed = 'This ${PAGETYPE} is currently under extended confirmed protection',
},
move = {
default = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'
.. ' from [[Help:Moving a page|page moves]]'
},
autoreview = {
default = 'All edits made to this ${PAGETYPE} by'
.. ' [[Wikipedia:User access levels#New users|new]] or'
.. ' [[Wikipedia:User access levels#Unregistered users|unregistered]]'
.. ' users are currently'
.. ' [[Wikipedia:Pending changes|subject to review]]'
},
upload = {
default = 'Uploading new versions of this ${PAGETYPE} is currently disabled'
}
},
--------------------------------------------------------------------------------
-- Explanation blurbs
--------------------------------------------------------------------------------
-- This table produces the explanation blurbs available with the
-- ${EXPLANATIONBLURB} parameter. It is sorted by protection action,
-- protection level, and whether the page is a talk page or not. If the page is
-- a talk page it will have a talk key of "talk"; otherwise it will have a talk
-- key of "subject". The table is checked in the following order:
-- 1. page's protection action, page's protection level, page's talk key
-- 2. page's protection action, page's protection level, default talk key
-- 3. page's protection action, default protection level, page's talk key
-- 4. page's protection action, default protection level, default talk key
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
explanationBlurbs = {
edit = {
autoconfirmed = {
subject = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
.. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
.. ' ${EDITREQUEST}, discuss changes on the ${TALKPAGE},'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]], [[Special:Userlogin|log in]], or'
.. ' [[Special:UserLogin/signup|create an account]].',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
.. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]], [[Special:Userlogin|log in]], or'
.. ' [[Special:UserLogin/signup|create an account]].',
},
extendedconfirmed = {
default = 'Extended confirmed protection prevents edits from all unregistered editors'
.. ' and registered users with fewer than 30 days tenure and 500 edits.'
.. ' The [[Wikipedia:Protection policy#extended|policy on community use]]'
.. ' specifies that extended confirmed protection can be applied to combat'
.. ' disruption, if semi-protection has proven to be ineffective.'
.. ' Extended confirmed protection may also be applied to enforce'
.. ' [[Wikipedia:Arbitration Committee|arbitration sanctions]].'
.. ' Please discuss any changes on the ${TALKPAGE}; you may'
.. ' ${EDITREQUEST} to ask for uncontroversial changes supported by'
.. ' [[Wikipedia:Consensus|consensus]].'
},
default = {
subject = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Please discuss any changes on the ${TALKPAGE}; you'
.. ' may ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
.. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
.. '|consensus]]. You may also [[Wikipedia:Requests for'
.. ' page protection#Current requests for reduction in protection level'
.. '|request]] that this page be unprotected.',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' You may [[Wikipedia:Requests for page'
.. ' protection#Current requests for edits to a protected page|request an'
.. ' edit]] to this page, or [[Wikipedia:Requests for'
.. ' page protection#Current requests for reduction in protection level'
.. '|ask]] for it to be unprotected.'
}
},
move = {
default = {
subject = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' The page may still be edited but cannot be moved'
.. ' until unprotected. Please discuss any suggested moves on the'
.. ' ${TALKPAGE} or at [[Wikipedia:Requested moves]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' The page may still be edited but cannot be moved'
.. ' until unprotected. Please discuss any suggested moves at'
.. ' [[Wikipedia:Requested moves]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.'
}
},
autoreview = {
default = {
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Edits to this ${PAGETYPE} by new and unregistered users'
.. ' will not be visible to readers until they are accepted by'
.. ' a reviewer. To avoid the need for your edits to be'
.. ' reviewed, you may'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]], [[Special:Userlogin|log in]], or'
.. ' [[Special:UserLogin/signup|create an account]].'
},
},
upload = {
default = {
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' The page may still be edited but new versions of the file'
.. ' cannot be uploaded until it is unprotected. You can'
.. ' request that a new version be uploaded by using a'
.. ' [[Wikipedia:Edit requests|protected edit request]], or you'
.. ' can [[Wikipedia:Requests for page protection|request]]'
.. ' that the file be unprotected.'
}
}
},
--------------------------------------------------------------------------------
-- Protection levels
--------------------------------------------------------------------------------
-- This table provides the data for the ${PROTECTIONLEVEL} parameter, which
-- produces a short label for different protection levels. It is sorted by
-- protection action and protection level, and is checked in the following
-- order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
-- 3. "edit" protection action, default protection level
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
protectionLevels = {
edit = {
default = 'protected',
templateeditor = 'template-protected',
extendedconfirmed = 'extended-protected',
autoconfirmed = 'semi-protected',
},
move = {
default = 'move-protected'
},
autoreview = {
},
upload = {
default = 'upload-protected'
}
},
--------------------------------------------------------------------------------
-- Images
--------------------------------------------------------------------------------
-- This table lists different padlock images for each protection action and
-- protection level. It is used if an image is not specified in any of the
-- banner data tables, and if the page does not satisfy the conditions for using
-- the ['image-filename-indef'] image. It is checked in the following order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
images = {
edit = {
default = 'Full-protection-shackle.svg',
templateeditor = 'Template-protection-shackle.svg',
extendedconfirmed = 'Extended-protection-shackle.svg',
autoconfirmed = 'Semi-protection-shackle.svg'
},
move = {
default = 'Move-protection-shackle.svg',
},
autoreview = {
default = 'Pending-protection-shackle.svg'
},
upload = {
default = 'Upload-protection-shackle.svg'
}
},
-- Pages with a reason specified in this table will show the special "indef"
-- padlock, defined in the 'image-filename-indef' message, if no expiry is set.
indefImageReasons = {
template = true
},
--------------------------------------------------------------------------------
-- Image links
--------------------------------------------------------------------------------
-- This table provides the data for the ${IMAGELINK} parameter, which gets
-- the image link for small padlock icons based on the page's protection action
-- and protection level. It is checked in the following order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
-- 3. "edit" protection action, default protection level
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
imageLinks = {
edit = {
default = 'Wikipedia:Protection policy#full',
templateeditor = 'Wikipedia:Protection policy#template',
extendedconfirmed = 'Wikipedia:Protection policy#extended',
autoconfirmed = 'Wikipedia:Protection policy#semi'
},
move = {
default = 'Wikipedia:Protection policy#move'
},
autoreview = {
default = 'Wikipedia:Protection policy#pending'
},
upload = {
default = 'Wikipedia:Protection policy#upload'
}
},
--------------------------------------------------------------------------------
-- Padlock indicator names
--------------------------------------------------------------------------------
-- This table provides the "name" attribute for the <indicator> extension tag
-- with which small padlock icons are generated. All indicator tags on a page
-- are displayed in alphabetical order based on this attribute, and with
-- indicator tags with duplicate names, the last tag on the page wins.
-- The attribute is chosen based on the protection action; table keys must be a
-- protection action name or the string "default".
padlockIndicatorNames = {
autoreview = 'pp-autoreview',
default = 'pp-default'
},
--------------------------------------------------------------------------------
-- Protection categories
--------------------------------------------------------------------------------
--[[
-- The protection categories are stored in the protectionCategories table.
-- Keys to this table are made up of the following strings:
--
-- 1. the expiry date
-- 2. the namespace
-- 3. the protection reason (e.g. "dispute" or "vandalism")
-- 4. the protection level (e.g. "sysop" or "autoconfirmed")
-- 5. the action (e.g. "edit" or "move")
--
-- When the module looks up a category in the table, first it will will check to
-- see a key exists that corresponds to all five parameters. For example, a
-- user page semi-protected from vandalism for two weeks would have the key
-- "temp-user-vandalism-autoconfirmed-edit". If no match is found, the module
-- changes the first part of the key to "all" and checks the table again. It
-- keeps checking increasingly generic key combinations until it finds the
-- field, or until it reaches the key "all-all-all-all-all".
--
-- The module uses a binary matrix to determine the order in which to search.
-- This is best demonstrated by a table. In this table, the "0" values
-- represent "all", and the "1" values represent the original data (e.g.
-- "indef" or "file" or "vandalism").
--
-- expiry namespace reason level action
-- order
-- 1 1 1 1 1 1
-- 2 0 1 1 1 1
-- 3 1 0 1 1 1
-- 4 0 0 1 1 1
-- 5 1 1 0 1 1
-- 6 0 1 0 1 1
-- 7 1 0 0 1 1
-- 8 0 0 0 1 1
-- 9 1 1 1 0 1
-- 10 0 1 1 0 1
-- 11 1 0 1 0 1
-- 12 0 0 1 0 1
-- 13 1 1 0 0 1
-- 14 0 1 0 0 1
-- 15 1 0 0 0 1
-- 16 0 0 0 0 1
-- 17 1 1 1 1 0
-- 18 0 1 1 1 0
-- 19 1 0 1 1 0
-- 20 0 0 1 1 0
-- 21 1 1 0 1 0
-- 22 0 1 0 1 0
-- 23 1 0 0 1 0
-- 24 0 0 0 1 0
-- 25 1 1 1 0 0
-- 26 0 1 1 0 0
-- 27 1 0 1 0 0
-- 28 0 0 1 0 0
-- 29 1 1 0 0 0
-- 30 0 1 0 0 0
-- 31 1 0 0 0 0
-- 32 0 0 0 0 0
--
-- In this scheme the action has the highest priority, as it is the last
-- to change, and the expiry has the least priority, as it changes the most.
-- The priorities of the expiry, the protection level and the action are
-- fixed, but the priorities of the reason and the namespace can be swapped
-- through the use of the cfg.bannerDataNamespaceHasPriority table.
--]]
-- If the reason specified to the template is listed in this table,
-- namespace data will take priority over reason data in the protectionCategories
-- table.
reasonsWithNamespacePriority = {
vandalism = true,
},
-- The string to use as a namespace key for the protectionCategories table for each
-- namespace number.
categoryNamespaceKeys = {
[ 2] = 'user',
[ 3] = 'user',
[ 4] = 'project',
[ 6] = 'file',
[ 8] = 'mediawiki',
[ 10] = 'template',
[ 12] = 'project',
[ 14] = 'category',
[100] = 'portal',
[828] = 'module',
},
protectionCategories = {
['all|all|all|all|all'] = 'Wikipedia fully protected pages',
['all|all|office|all|all'] = 'Wikipedia Office-protected pages',
['all|all|reset|all|all'] = 'Wikipedia Office-protected pages',
['all|all|dmca|all|all'] = 'Wikipedia Office-protected pages',
['all|all|mainpage|all|all'] = 'Wikipedia fully protected main page files',
['all|all|all|extendedconfirmed|all'] = 'Wikipedia extended-confirmed-protected pages',
['all|all|ecp|extendedconfirmed|all'] = 'Wikipedia extended-confirmed-protected pages',
['all|template|all|all|edit'] = 'Wikipedia fully protected templates',
['all|all|all|autoconfirmed|edit'] = 'Wikipedia semi-protected pages',
['indef|all|all|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected pages',
['all|all|blp|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected biographies of living people',
['temp|all|blp|autoconfirmed|edit'] = 'Wikipedia temporarily semi-protected biographies of living people',
['all|all|dispute|autoconfirmed|edit'] = 'Wikipedia pages semi-protected due to dispute',
['all|all|sock|autoconfirmed|edit'] = 'Wikipedia pages semi-protected from banned users',
['all|all|vandalism|autoconfirmed|edit'] = 'Wikipedia pages semi-protected against vandalism',
['all|category|all|autoconfirmed|edit'] = 'Wikipedia semi-protected categories',
['all|file|all|autoconfirmed|edit'] = 'Wikipedia semi-protected files',
['all|portal|all|autoconfirmed|edit'] = 'Wikipedia semi-protected portals',
['all|project|all|autoconfirmed|edit'] = 'Wikipedia semi-protected project pages',
['all|talk|all|autoconfirmed|edit'] = 'Wikipedia semi-protected talk pages',
['all|template|all|autoconfirmed|edit'] = 'Wikipedia semi-protected templates',
['all|user|all|autoconfirmed|edit'] = 'Wikipedia semi-protected user and user talk pages',
['all|all|all|templateeditor|edit'] = 'Wikipedia template-protected pages other than templates and modules',
['all|template|all|templateeditor|edit'] = 'Wikipedia template-protected templates',
['all|template|all|templateeditor|move'] = 'Wikipedia template-protected templates', -- move-protected templates
['all|all|blp|sysop|edit'] = 'Wikipedia indefinitely protected biographies of living people',
['temp|all|blp|sysop|edit'] = 'Wikipedia temporarily protected biographies of living people',
['all|all|dispute|sysop|edit'] = 'Wikipedia pages protected due to dispute',
['all|all|sock|sysop|edit'] = 'Wikipedia pages protected from banned users',
['all|all|vandalism|sysop|edit'] = 'Wikipedia pages protected against vandalism',
['all|category|all|sysop|edit'] = 'Wikipedia fully protected categories',
['all|file|all|sysop|edit'] = 'Wikipedia fully protected files',
['all|project|all|sysop|edit'] = 'Wikipedia fully protected project pages',
['all|talk|all|sysop|edit'] = 'Wikipedia fully protected talk pages',
['all|template|all|extendedconfirmed|edit'] = 'Wikipedia extended-confirmed-protected templates',
['all|template|all|sysop|edit'] = 'Wikipedia fully protected templates',
['all|user|all|sysop|edit'] = 'Wikipedia fully protected user and user talk pages',
['all|module|all|all|edit'] = 'Wikipedia fully protected modules',
['all|module|all|templateeditor|edit'] = 'Wikipedia template-protected modules',
['all|module|all|extendedconfirmed|edit'] = 'Wikipedia extended-confirmed-protected modules',
['all|module|all|autoconfirmed|edit'] = 'Wikipedia semi-protected modules',
['all|all|all|sysop|move'] = 'Wikipedia move-protected pages',
['indef|all|all|sysop|move'] = 'Wikipedia indefinitely move-protected pages',
['all|all|dispute|sysop|move'] = 'Wikipedia pages move-protected due to dispute',
['all|all|vandalism|sysop|move'] = 'Wikipedia pages move-protected due to vandalism',
['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals',
['all|project|all|sysop|move'] = 'Wikipedia move-protected project pages',
['all|talk|all|sysop|move'] = 'Wikipedia move-protected talk pages',
['all|template|all|sysop|move'] = 'Wikipedia move-protected templates',
['all|user|all|sysop|move'] = 'Wikipedia move-protected user and user talk pages',
['all|all|all|autoconfirmed|autoreview'] = 'Wikipedia pending changes protected pages',
['all|file|all|all|upload'] = 'Wikipedia upload-protected files',
},
--------------------------------------------------------------------------------
-- Expiry category config
--------------------------------------------------------------------------------
-- This table configures the expiry category behaviour for each protection
-- action.
-- * If set to true, setting that action will always categorise the page if
-- an expiry parameter is not set.
-- * If set to false, setting that action will never categorise the page.
-- * If set to nil, the module will categorise the page if:
-- 1) an expiry parameter is not set, and
-- 2) a reason is provided, and
-- 3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck
-- table.
expiryCheckActions = {
edit = nil,
move = false,
autoreview = true,
upload = false
},
reasonsWithoutExpiryCheck = {
blp = true,
template = true,
},
--------------------------------------------------------------------------------
-- Pagetypes
--------------------------------------------------------------------------------
-- This table produces the page types available with the ${PAGETYPE} parameter.
-- Keys are namespace numbers, or the string "default" for the default value.
pagetypes = {
[0] = 'article',
[6] = 'file',
[10] = 'template',
[14] = 'category',
[828] = 'module',
default = 'page'
},
--------------------------------------------------------------------------------
-- Strings marking indefinite protection
--------------------------------------------------------------------------------
-- This table contains values passed to the expiry parameter that mean the page
-- is protected indefinitely.
indefStrings = {
['indef'] = true,
['indefinite'] = true,
['indefinitely'] = true,
['infinite'] = true,
},
--------------------------------------------------------------------------------
-- Group hierarchy
--------------------------------------------------------------------------------
-- This table maps each group to all groups that have a superset of the original
-- group's page editing permissions.
hierarchy = {
sysop = {},
reviewer = {'sysop'},
filemover = {'sysop'},
templateeditor = {'sysop'},
extendedconfirmed = {'sysop'},
autoconfirmed = {'reviewer', 'filemover', 'templateeditor', 'extendedconfirmed'},
user = {'autoconfirmed'},
['*'] = {'user'}
},
--------------------------------------------------------------------------------
-- Wrapper templates and their default arguments
--------------------------------------------------------------------------------
-- This table contains wrapper templates used with the module, and their
-- default arguments. Templates specified in this table should contain the
-- following invocation, and no other template content:
--
-- {{#invoke:Protection banner|main}}
--
-- If other content is desired, it can be added between
-- <noinclude>...</noinclude> tags.
--
-- When a user calls one of these wrapper templates, they will use the
-- default arguments automatically. However, users can override any of the
-- arguments.
wrappers = {
['Template:Pp'] = {},
['Template:Pp-extended'] = {'ecp'},
['Template:Pp-blp'] = {'blp'},
-- we don't need Template:Pp-create
['Template:Pp-dispute'] = {'dispute'},
['Template:Pp-main-page'] = {'mainpage'},
['Template:Pp-move'] = {action = 'move', catonly = 'yes'},
['Template:Pp-move-dispute'] = {'dispute', action = 'move', catonly = 'yes'},
-- we don't need Template:Pp-move-indef
['Template:Pp-move-vandalism'] = {'vandalism', action = 'move', catonly = 'yes'},
['Template:Pp-office'] = {'office'},
['Template:Pp-office-dmca'] = {'dmca'},
['Template:Pp-pc'] = {action = 'autoreview', small = true},
['Template:Pp-pc1'] = {action = 'autoreview', small = true},
['Template:Pp-reset'] = {'reset'},
['Template:Pp-semi-indef'] = {small = true},
['Template:Pp-sock'] = {'sock'},
['Template:Pp-template'] = {'template', small = true},
['Template:Pp-upload'] = {action = 'upload'},
['Template:Pp-usertalk'] = {'usertalk'},
['Template:Pp-vandalism'] = {'vandalism'},
},
--------------------------------------------------------------------------------
--
-- MESSAGES
--
--------------------------------------------------------------------------------
msg = {
--------------------------------------------------------------------------------
-- Intro blurb and intro fragment
--------------------------------------------------------------------------------
-- These messages specify what is produced by the ${INTROBLURB} and
-- ${INTROFRAGMENT} parameters. If the protection is temporary they use the
-- intro-blurb-expiry or intro-fragment-expiry, and if not they use
-- intro-blurb-noexpiry or intro-fragment-noexpiry.
-- It is possible to use banner parameters in these messages.
['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.',
['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.',
['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},',
['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',
--------------------------------------------------------------------------------
-- Tooltip blurb
--------------------------------------------------------------------------------
-- These messages specify what is produced by the ${TOOLTIPBLURB} parameter.
-- If the protection is temporary the tooltip-blurb-expiry message is used, and
-- if not the tooltip-blurb-noexpiry message is used.
-- It is possible to use banner parameters in these messages.
['tooltip-blurb-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY}.',
['tooltip-blurb-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}.',
['tooltip-fragment-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY},',
['tooltip-fragment-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
--------------------------------------------------------------------------------
-- Special explanation blurb
--------------------------------------------------------------------------------
-- An explanation blurb for pages that cannot be unprotected, e.g. for pages
-- in the MediaWiki namespace.
-- It is possible to use banner parameters in this message.
['explanation-blurb-nounprotect'] = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Please discuss any changes on the ${TALKPAGE}; you'
.. ' may ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
.. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
.. '|consensus]].',
--------------------------------------------------------------------------------
-- Protection log display values
--------------------------------------------------------------------------------
-- These messages determine the display values for the protection log link
-- or the pending changes log link produced by the ${PROTECTIONLOG} parameter.
-- It is possible to use banner parameters in these messages.
['protection-log-display'] = 'protection log',
['pc-log-display'] = 'pending changes log',
--------------------------------------------------------------------------------
-- Current version display values
--------------------------------------------------------------------------------
-- These messages determine the display values for the page history link
-- or the move log link produced by the ${CURRENTVERSION} parameter.
-- It is possible to use banner parameters in these messages.
['current-version-move-display'] = 'current title',
['current-version-edit-display'] = 'current version',
--------------------------------------------------------------------------------
-- Talk page
--------------------------------------------------------------------------------
-- This message determines the display value of the talk page link produced
-- with the ${TALKPAGE} parameter.
-- It is possible to use banner parameters in this message.
['talk-page-link-display'] = 'talk page',
--------------------------------------------------------------------------------
-- Edit requests
--------------------------------------------------------------------------------
-- This message determines the display value of the edit request link produced
-- with the ${EDITREQUEST} parameter.
-- It is possible to use banner parameters in this message.
['edit-request-display'] = 'submit an edit request',
--------------------------------------------------------------------------------
-- Expiry date format
--------------------------------------------------------------------------------
-- This is the format for the blurb expiry date. It should be valid input for
-- the first parameter of the #time parser function.
['expiry-date-format'] = 'F j, Y "at" H:i e',
--------------------------------------------------------------------------------
-- Tracking categories
--------------------------------------------------------------------------------
-- These messages determine which tracking categories the module outputs.
['tracking-category-incorrect'] = 'Wikipedia pages with incorrect protection templates',
['tracking-category-template'] = 'Wikipedia template-protected pages other than templates and modules',
--------------------------------------------------------------------------------
-- Images
--------------------------------------------------------------------------------
-- These are images that are not defined by their protection action and protection level.
['image-filename-indef'] = 'Full-protection-shackle.svg',
['image-filename-default'] = 'Transparent.gif',
--------------------------------------------------------------------------------
-- End messages
--------------------------------------------------------------------------------
}
--------------------------------------------------------------------------------
-- End configuration
--------------------------------------------------------------------------------
}
a20552ae38cb5253a4fa29aa126abc74215a589f
Template:Infobox YouTube personality/doc
10
162
332
2023-05-10T14:42:37Z
wikipedia>WOSlinker
0
syntaxhighlight lang="wikitext"
wikitext
text/x-wiki
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AT THE BOTTOM OF THIS PAGE -->
{{WikiProject YouTube/Used Template}}
{{Template shortcut|Infobox YouTube|Infobox YouTuber|Infobox YouTube channel}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters|Module:YouTubeSubscribers}}
{{Uses TemplateStyles|Template:Infobox YouTube personality/styles.css}}
This infobox is intended to be used in articles about [[YouTube]] personalities, rather than using the generic {{tl|Infobox person}} template. The template may be used for individual YouTube personalities or collective YouTube channels run by more than one person.
== Usage ==
The infobox may be added by pasting the template as shown below into an article and then filling in the desired fields. Any parameters left blank or omitted will not be displayed.
=== Blank template with basic parameters ===
{{Parameter names example |name |image=Pessoa Neutra.svg |caption
|birth_name |birth_date |birth_place |death_date |death_place |nationality
|other_names |occupation |organization |website
|pseudonym |channel_name |years_active |genre |subscribers |views |network |associated_acts |language
|silver_year |gold_year |diamond_year |ruby_year |red_diamond_year |stats_update
}}
This blank template pattern shows some basic parameters needed to fill the infobox, with comments about many parameters. For actual examples, see the section "[[#Examples|Examples]]" below.
<syntaxhighlight lang="wikitext" style="overflow:auto; line-height:1.2em;">
{{Infobox YouTube personality
| name =
| image = <!-- filename only, no "File:" or "Image:" prefix, and no enclosing [[brackets]] -->
| caption =
| birth_name = <!-- use only if different from "name" -->
| birth_date = <!-- {{Birth date and age|YYYY|MM|DD}} -->
| birth_place =
| death_date = <!-- {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} (DEATH date then BIRTH date) -->
| death_place =
| nationality = <!-- use only when necessary per [[WP:INFONAT]] -->
| other_names =
| occupation =
| organization =
| website = <!-- official website of the personality. format: {{URL|example.com}} -->
| pseudonym =
<!-- THE FOLLOWING THREE PARAMETERS ARE INTERCHANGEABLE; USE ONLY ONE -->
| channel_name = <!-- primary channel, enter ONLY what comes after www.youtube.com/user/ -->
| channel_url = <!-- primary channel, enter ONLY what comes after www.youtube.com/channel/ -->
| channel_direct_url = <!-- primary channel, enter ONLY what comes after www.youtube.com/ -->
| channel_display_name = <!-- if the primary channel's display name differs from "channel_(name/url/direct_url)" -->
| years_active = <!-- year of channel's creation until its discontinuation or present day -->
| genre =
| subscribers =
| views =
| network =
| language = <!-- the channel's primary language(s) -->
| associated_acts =
| silver_year = <!-- year the channel reached 100,000 subscribers. if not known, use "silver_button=yes" instead -->
| gold_year = <!-- year the channel reached 1,000,000 subscribers. if not known, use "gold_button=yes" instead -->
| diamond_year = <!-- year the channel reached 10,000,000 subscribers. if not known, use "diamond_button=yes" instead -->
| ruby_year = <!-- year the channel reached 50,000,000 subscribers. if not known, use "ruby_button=yes" instead -->
| red_diamond_year = <!-- year the channel reached 100,000,000 subscribers. if not known, use "red_diamond_button=yes" instead -->
| stats_update = <!-- date of given channel statistics -->
}}
</syntaxhighlight>
{{Clear}}
=== Blank template with all parameters ===
{{Parameter names example|honorific_prefix|name|honorific_suffix|logo|logo_size|logo_alt|logo_caption|image|image_upright|alt|caption|birth_name|birth_date|birth_place|death_date|death_place|origin|nationality|other_names|education|occupation|spouse|partner|children|parents|relatives|organization|signature|signature_size|signature_alt|website|module_personal|pseudonym|channel_name|channel_display_name|creator|presenter|location|years_active|genre|subscribers|subscriber_date|views|view_date|network|language|associated_acts|channel_website|silver_year|gold_year|diamond_year|ruby_year|red_diamond_year|module|stats_update|extra_information}}
Only the most pertinent information should be included. Please remove unused parameters, and refrain from inserting dubious trivia in an attempt to fill all parameters.
<syntaxhighlight lang="wikitext" style="overflow:auto; line-height:1.2em;">
{{Infobox YouTube personality
| honorific_prefix =
| name =
| honorific_suffix =
| logo = <!-- filename only, no "File:" or "Image:" prefix, and no enclosing [[brackets]] -->
| logo_size =
| logo_alt =
| logo_caption =
| image = <!-- filename only, no "File:" or "Image:" prefix, and no enclosing [[brackets]] -->
| image_upright =
| alt =
| caption =
| birth_name = <!-- use only if different from "name" -->
| birth_date = <!-- {{Birth date and age|YYYY|MM|DD}} -->
| birth_place =
| death_date = <!-- {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} (DEATH date then BIRTH date) -->
| death_place =
| origin = <!-- use for groups or companies -->
| nationality = <!-- use only when necessary per [[WP:INFONAT]] -->
| other_names =
| education =
| occupation =
| spouse =
| partner = <!-- unmarried long-term partner -->
| children =
| parents =
| mother =
| father =
| relatives =
| organization =
| signature =
| signature_size =
| signature_alt =
| website = <!-- official website of the personality. format: {{URL|example.com}} -->
| module_personal =
| pseudonym =
<!-- THE FOLLOWING THREE PARAMETERS ARE INTERCHANGEABLE; USE ONLY ONE -->
| channel_name = <!-- primary channel, enter ONLY what comes after www.youtube.com/user/ -->
| channel_url = <!-- primary channel, enter ONLY what comes after www.youtube.com/channel/ -->
| channel_direct_url = <!-- primary channel, enter ONLY what comes after www.youtube.com/ -->
<!-- DO NOT LINK TO SECONDARY CHANNELS UNLESS COVERED BY RELIABLE SOURCES IN THE BODY OF THE ARTICLE. SEE WP:ELMIN, WP:RS -->
| channel_name2 = <!-- second channel, enter ONLY what comes after www.youtube.com/user/ -->
| channel_url2 = <!-- second channel, enter ONLY what comes after www.youtube.com/channel/ -->
| channel_direct_url2 = <!-- second channel, enter ONLY what comes after www.youtube.com/ -->
| channel_name3 = <!-- third channel, enter ONLY what comes after www.youtube.com/user/ -->
| channel_url3 = <!-- third channel, enter ONLY what comes after www.youtube.com/channel/ -->
| channel_direct_url3 = <!-- third channel, enter ONLY what comes after www.youtube.com/ -->
| channel_display_name = <!-- if the primary channel's display name differs from "channel_(name/url/direct_url)" -->
| channel_display_name2 = <!-- if the second channel's display name differs from "channel_(name2/url2/direct_url2)" -->
| channel_display_name3 = <!-- if the third channel's display name differs from "channel_(name3/url3/direct_url3)" -->
| channels =
| creator =
| presenter =
| location = <!-- use only when the channel's location is notable, not for mere residence -->
| years_active = <!-- year of channel's creation until its discontinuation or present day -->
| genre =
| subscribers =
| subscriber_date = <!-- date of given subscriber count -->
| views =
| view_date = <!-- date of given view count -->
| network =
| language = <!-- the channel's primary language(s) -->
| associated_acts =
| channel_website = <!-- official website of the channel. format: {{URL|example.com}} -->
| silver_year = <!-- year the channel reached 100,000 subscribers -->
| silver_button = <!-- yes; only if the year the channel reached 100,000 subscribers is not known -->
| gold_year = <!-- year the channel reached 1,000,000 subscribers -->
| gold_button = <!-- yes; only if the year the channel reached 1,000,000 subscribers is not known -->
| diamond_year = <!-- year the channel reached 10,000,000 subscribers -->
| diamond_button = <!-- yes; only if the year the channel reached 10,000,000 subscribers is not known -->
| ruby_year = <!-- year the channel reached 50,000,000 subscribers -->
| ruby_button = <!-- yes; only if the year the channel reached 50,000,000 subscribers is not known -->
| red_diamond_year = <!-- year the channel reached 100,000,000 subscribers -->
| red_diamond_button = <!-- yes; only if the year the channel reached 100,000,000 subscribers is not known -->
| module =
| stats_update = <!-- date of given channel statistics -->
| extra_information =
}}
</syntaxhighlight>
{{Clear}}
== Examples ==
=== Individual ===
{{Infobox YouTube personality
| name = Fuslie
| image = Fuslie TwitchCon 2022 (cropped).jpg
| caption = Fuslie in 2022
| birth_name = Leslie Ann Fu
| birth_date = {{birth date and age|1992|11|23}}
| birth_place = [[San Francisco Bay Area]], [[California]], U.S.
| education = [[University of California, Irvine]] ([[Bachelor of Science|BS]])
| occupation = {{flatlist|
* [[Live streamer]]
* [[YouTuber]]
}}
| organization = [[100 Thieves]]
| website = {{URL|fuslie.com}}
| years_active = 2015–present
| channel_direct_url = fuslie
| genre = {{flatlist|
* [[Video game|Gaming]]
* [[vlog]]
}}
| subscribers = 787,000
| views = 165.9 million
| associated_acts = {{flatlist|
* [[OfflineTV]]
* [[Valkyrae]]
* [[Sykkuno]]
}}
| silver_year = 2019
| module =
{{Infobox Twitch streamer | subbox=yes
| years_active = 2015–2022
| channel_name = fuslie
| genre = Gaming
}}
| stats_update = April 2, 2023
}}
<syntaxhighlight lang="wikitext" style="overflow: auto">
{{Infobox YouTube personality
| name = Fuslie
| image = Fuslie TwitchCon 2022 (cropped).jpg
| caption = Fuslie in 2022
| birth_name = Leslie Ann Fu
| birth_date = {{birth date and age|1992|11|23}}
| birth_place = [[San Francisco Bay Area]], [[California]], U.S.
| education = [[University of California, Irvine]] ([[Bachelor of Science|BS]])
| occupation = {{flatlist|
* [[Live streamer]]
* [[YouTuber]]
}}
| organization = [[100 Thieves]]
| website = {{URL|fuslie.com}}
| years_active = 2015–present
| channel_direct_url = fuslie
| genre = {{flatlist|
* [[Video game|Gaming]]
* [[vlog]]
}}
| subscribers = 787,000
| views = 165.9 million
| associated_acts = {{flatlist|
* [[OfflineTV]]
* [[Valkyrae]]
* [[Sykkuno]]
}}
| silver_year = 2019
| module =
{{Infobox Twitch streamer | subbox=yes
| years_active = 2015–2022
| channel_name = fuslie
| genre = Gaming
}}
| stats_update = April 2, 2023
}}
</syntaxhighlight>
{{Clear}}
=== Collective ===
{{Infobox YouTube personality
| name = Sidemen
| logo = Sidemen Logo.svg
| image = Sidemen collage 4.5.jpg
| caption = Top to bottom from left column: [[Vikkstar123|Barn]], [[TBJZL|Brown]]; [[KSI|Olatunji]], Minter, Lewis; [[Behzinga|Payne]], and [[Zerkaa|Bradley]].
| birth_date = {{Unbulleted list
|Olajide Olayinka Williams Olatunji ([[KSI]])|{{birth date and age|1993|6|19|df=yes}}
|<hr>Simon Minter (Miniminter)|{{birth date and age|1992|09|07|df=y}}
|<hr>Joshua Bradley ([[Zerkaa]])|{{birth date and age|1992|09|04|df=y}}
|<hr>Tobit John Brown ([[TBJZL]])|{{birth date and age|df=y|1993|4|8}}
|<hr>Ethan Payne ([[Behzinga]])|{{birth date and age|df=y|1995|6|20}}
|<hr>Vikram Singh Barn ([[Vikkstar123]])|{{birth date and age|df=y|1995|8|2}}
|<hr>Harry Lewis (W2S)|{{birth date and age|1996|11|24|df=y}}
}}
| occupation = [[YouTuber]]s
| website = {{url|https://sidemen.com}}
| origin = London, England
| channels = [https://www.youtube.com/channel/UCDogdKl7t7NHzQ95aEwkdMw Sidemen]<br />[https://www.youtube.com/channel/UCh5mLn90vUaB1PbRRx_AiaA MoreSidemen]<br />[https://www.youtube.com/channel/UCjRkTl_HP4zOh3UFaThgRZw SidemenReacts]<br />[https://www.youtube.com/channel/UCbAZH3nTxzyNmehmTUhuUsA SidemenShorts]<br />
{{Collapsible list
| framestyle = border:none; padding:0;
| title = Associated channels <!-- Only include the individual channels that were created before they transitioned their content to the first two group channels -->
| 1 = [https://www.youtube.com/channel/UCVtFOytbRpEvzLjvqGG5gxQ KSI]
| 2 = [https://www.youtube.com/channel/UCGmnsW623G1r-Chmo5RB4Yw JJ Olatunji]
| 3 = [https://www.youtube.com/channel/UCWZmCMB7mmKWcXJSIPRhzZw Miniminter]
| 4 = [https://www.youtube.com/channel/UCjB_adDAIxOL8GA4Y4OCt8g MM7Games]
| 5 = [https://www.youtube.com/user/ZerkaaHD Zerkaa]
| 6 = [https://www.youtube.com/user/ZerkaaPlays ZerkaaPlays]
| 7 = [https://www.youtube.com/user/TBJZL TBJZL]
| 8 = [https://www.youtube.com/user/EDITinGAMING TBJZLPlays]
| 9 = [https://www.youtube.com/user/Behzinga Behzinga]
| 10 = [https://www.youtube.com/channel/UCbzZFTHge5zk2yebSiWRZRg Beh2inga]
| 11 = [https://www.youtube.com/user/Vikkstar123 Vikkstar123]
| 12 = [https://www.youtube.com/user/VikkstarPlays VikkstarPlays]
| 13 = [https://www.youtube.com/user/Vikkstar123HD Vikkstar123HD]
| 14 = [https://www.youtube.com/user/wroetoshaw W2S]
| 15 = [https://www.youtube.com/channel/UC5_IT4-XpinnvNQwM1e15eQ W2S+]
}}
| years_active = 2013–present
| genre = {{flatlist|
* [[Entertainment]]
* [[Let's Play|gaming]]
* [[vlog]]
* reaction
}}
| subscribers = {{Rounddown|{{Sum|<!-- Sidemen -->16.9|7.00|4.81|1.82|<!-- JJ -->24.0|16.0|<!-- Simon -->10.1|5.21|<!-- Josh -->4.66|2.80|<!-- Tobi -->4.87|1.67|<!-- Ethan -->4.88|1.96|<!-- Vik -->7.58|1.10|3.29|<!-- Harry -->16.3|3.79}}|1}} million (combined)
| views = {{Rounddown|{{Sum|<!-- Sidemen -->4.45|2.85|1.72|1.08|<!-- JJ -->5.93|3.77|<!-- Simon -->3.54|2.68|<!-- Josh -->0.70|1.02|<!-- Tobi -->0.51|0.16|<!-- Ethan -->0.56|0.29|<!-- Vik -->2.10|0.14|1.10|<!-- Harry -->4.75|0.55}}|1}} billion (combined)
| stats_update = 14 October 2022
| network = {{flatlist|
* [[Omnia Media]]
* [[OP Talent]]
}}
| associated_acts = [[Jme (musician)|Jme]]
| silver_year = <abbr title="Sidemen">2016</abbr>, <abbr title="MoreSidemen">2018</abbr>, <abbr title="SidemenReacts">2020</abbr>, <abbr title="SidemenShorts">2021</abbr>
| gold_year = <abbr title="Sidemen">2016</abbr>, <abbr title="MoreSidemen">2018</abbr>, <abbr title="SidemenReacts">2020</abbr>, <abbr title="SidemenShorts">2021</abbr>
| diamond_year = <abbr title="Sidemen">2020</abbr>
}}
<syntaxhighlight lang="wikitext" style="overflow: auto">
{{Infobox YouTube personality
| name = Sidemen
| logo = Sidemen Logo.svg
| image = Sidemen collage 4.5.jpg
| caption = Top to bottom from left column: [[Vikkstar123|Barn]], [[TBJZL|Brown]]; [[KSI|Olatunji]], Minter, Lewis; [[Behzinga|Payne]], and [[Zerkaa|Bradley]].
| birth_date = {{Unbulleted list
|Olajide Olayinka Williams Olatunji ([[KSI]])|{{birth date and age|1993|6|19|df=yes}}
|<hr>Simon Minter (Miniminter)|{{birth date and age|1992|09|07|df=y}}
|<hr>Joshua Bradley ([[Zerkaa]])|{{birth date and age|1992|09|04|df=y}}
|<hr>Tobit John Brown ([[TBJZL]])|{{birth date and age|df=y|1993|4|8}}
|<hr>Ethan Payne ([[Behzinga]])|{{birth date and age|df=y|1995|6|20}}
|<hr>Vikram Singh Barn ([[Vikkstar123]])|{{birth date and age|df=y|1995|8|2}}
|<hr>Harry Lewis (W2S)|{{birth date and age|1996|11|24|df=y}}
}}
| occupation = [[YouTuber]]s
| website = {{url|https://sidemen.com}}
| origin = London, England
| channels = [https://www.youtube.com/channel/UCDogdKl7t7NHzQ95aEwkdMw Sidemen]<br />[https://www.youtube.com/channel/UCh5mLn90vUaB1PbRRx_AiaA MoreSidemen]<br />[https://www.youtube.com/channel/UCjRkTl_HP4zOh3UFaThgRZw SidemenReacts]<br />[https://www.youtube.com/channel/UCbAZH3nTxzyNmehmTUhuUsA SidemenShorts]<br />
{{Collapsible list
| framestyle = border:none; padding:0;
| title = Associated channels <!-- Only include the individual channels that were created before they transitioned their content to the first two group channels -->
| 1 = [https://www.youtube.com/channel/UCVtFOytbRpEvzLjvqGG5gxQ KSI]
| 2 = [https://www.youtube.com/channel/UCGmnsW623G1r-Chmo5RB4Yw JJ Olatunji]
| 3 = [https://www.youtube.com/channel/UCWZmCMB7mmKWcXJSIPRhzZw Miniminter]
| 4 = [https://www.youtube.com/channel/UCjB_adDAIxOL8GA4Y4OCt8g MM7Games]
| 5 = [https://www.youtube.com/user/ZerkaaHD Zerkaa]
| 6 = [https://www.youtube.com/user/ZerkaaPlays ZerkaaPlays]
| 7 = [https://www.youtube.com/user/TBJZL TBJZL]
| 8 = [https://www.youtube.com/user/EDITinGAMING TBJZLPlays]
| 9 = [https://www.youtube.com/user/Behzinga Behzinga]
| 10 = [https://www.youtube.com/channel/UCbzZFTHge5zk2yebSiWRZRg Beh2inga]
| 11 = [https://www.youtube.com/user/Vikkstar123 Vikkstar123]
| 12 = [https://www.youtube.com/user/VikkstarPlays VikkstarPlays]
| 13 = [https://www.youtube.com/user/Vikkstar123HD Vikkstar123HD]
| 14 = [https://www.youtube.com/user/wroetoshaw W2S]
| 15 = [https://www.youtube.com/channel/UC5_IT4-XpinnvNQwM1e15eQ W2S+]
}}
| years_active = 2013–present
| genre = {{flatlist|
* [[Entertainment]]
* [[Let's Play|gaming]]
* [[vlog]]
* reaction
}}
| subscribers = {{Rounddown|{{Sum|<!-- Sidemen -->16.9|7.00|4.81|1.82|<!-- JJ -->24.0|16.0|<!-- Simon -->10.1|5.21|<!-- Josh -->4.66|2.80|<!-- Tobi -->4.87|1.67|<!-- Ethan -->4.88|1.96|<!-- Vik -->7.58|1.10|3.29|<!-- Harry -->16.3|3.79}}|1}} million (combined)
| views = {{Rounddown|{{Sum|<!-- Sidemen -->4.45|2.85|1.72|1.08|<!-- JJ -->5.93|3.77|<!-- Simon -->3.54|2.68|<!-- Josh -->0.70|1.02|<!-- Tobi -->0.51|0.16|<!-- Ethan -->0.56|0.29|<!-- Vik -->2.10|0.14|1.10|<!-- Harry -->4.75|0.55}}|1}} billion (combined)
| stats_update = 14 October 2022
| network = {{flatlist|
* [[Omnia Media]]
* [[OP Talent]]
}}
| associated_acts = [[Jme (musician)|Jme]]
| silver_year = <abbr title="Sidemen">2016</abbr>, <abbr title="MoreSidemen">2018</abbr>, <abbr title="SidemenReacts">2020</abbr>, <abbr title="SidemenShorts">2021</abbr>
| gold_year = <abbr title="Sidemen">2016</abbr>, <abbr title="MoreSidemen">2018</abbr>, <abbr title="SidemenReacts">2020</abbr>, <abbr title="SidemenShorts">2021</abbr>
| diamond_year = <abbr title="Sidemen">2020</abbr>
}}
</syntaxhighlight>
{{Clear}}
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"description": "An infobox for a YouTube personality or channel.",
"format": "{{_\n| ____________________ = _\n}}\n",
"params": {
"honorific_prefix": {
"aliases": [
"honorific prefix"
],
"label": "Honorific prefix",
"description": "Honorific prefix(es), to appear above the YouTube personality's name.",
"example": "[[Sir]]",
"type": "line"
},
"name": {
"label": {
"en": "Name",
"ar": "الإسم"
},
"description": {
"en": "The name of the YouTube personality or channel.",
"ar": "اسم الشخصية"
},
"type": "string",
"suggested": true
},
"honorific_suffix": {
"aliases": [
"honorific suffix"
],
"label": "Honorific suffix",
"description": "Honorific suffix(es), to appear below the YouTube personality's name.",
"example": "[[PhD]]",
"type": "line"
},
"logo": {
"label": {
"en": "Logo"
},
"description": {
"en": "The logo of the YouTube channel, if applicable."
},
"example": "Dude Perfect logo.svg",
"type": "wiki-file-name"
},
"logo_size": {
"label": {
"en": "Logo size"
},
"description": {
"en": "The logo width in pixels (\"px\" is automatically added if omitted)."
},
"default": "250px",
"example": "120px"
},
"logo_alt": {
"label": {
"en": "Logo alt text"
},
"description": {
"en": "Alt text for the logo, for visually impaired readers. One word (such as \"photograph\") is rarely sufficient. See WP:ALT."
},
"type": "string"
},
"logo_caption": {
"aliases": [
"logo caption"
],
"label": "Logo caption",
"description": "A caption for the logo, if needed.",
"type": "string"
},
"image": {
"label": {
"en": "Image"
},
"description": {
"en": "An image of the YouTube personality."
},
"type": "wiki-file-name"
},
"image_upright": {
"aliases": [
"upright"
],
"label": {
"en": "Image upright"
},
"description": {
"en": "Scales the image thumbnail from its default size by the given factor. Values less than 1 scale the image down (0.9 = 90%) and values greater than 1 scale the image up (1.15 = 115%)."
},
"default": "1",
"example": "1.15",
"type": "line"
},
"image_size": {
"label": {
"en": "Image size"
},
"description": {
"en": "The image width in pixels (\"px\" is automatically added if omitted)."
},
"default": "220px",
"example": "120px",
"aliases": [
"image size",
"imagesize"
],
"deprecated": "Use of this parameter is discouraged as per WP:IMGSIZE. Use \"image_upright\" instead.",
"type": "line"
},
"alt": {
"label": "Image alt text",
"description": "Alt text for the image, for visually impaired readers. One word (such as \"photograph\") is rarely sufficient. See WP:ALT.",
"type": "string"
},
"caption": {
"aliases": [
"image_caption",
"image caption"
],
"label": "Image caption",
"description": "A caption for the image, if needed. Try to include year of photo.",
"type": "string"
},
"birth_name": {
"label": "Birth name",
"description": "The birth name of the YouTube personality. Only use if different from \"name\".",
"type": "string"
},
"birth_date": {
"label": "Birth date",
"description": "The birth date of the YouTube personality. Use Template:Birth date and age (for living people) or Template:Birth date (for people who have died). If only a year of birth is known, or age as of a certain date, consider using Template:Birth year and age or Template:Birth based on age as of date.",
"example": "{{Birth date and age|1990|01|26}}"
},
"birth_place": {
"label": "Birth place",
"description": "The birth place of the YouTube personality: city, administrative region, sovereign state. Use the name of the birth place at the time of birth.",
"example": "[[Los Angeles]], California, United States",
"type": "string"
},
"death_date": {
"label": "Death date",
"description": "The death date of the YouTube personality. Use Template:Death date and age (if birth date is known) or Template:Death date (if birth date unknown).",
"example": "{{Death date and age|2010|12|30|1990|01|26}}"
},
"death_place": {
"label": "Death place",
"description": "The death place of the YouTube personality: city, administrative region, sovereign state. Use the name of the death place at the time of death.",
"example": "[[Paris]], France",
"type": "string"
},
"origin": {
"label": "Origin",
"description": "The city from which the subject originated. Usually appropriate for groups or companies.",
"example": "[[Paris]], France",
"type": "string"
},
"nationality": {
"label": "Nationality",
"description": "The nationality of the YouTube personality. Only use if nationality cannot be inferred from the birthplace per WP:INFONAT.",
"example": "American",
"type": "string"
},
"other_names": {
"label": "Other names",
"description": "Notable aliases of the subject. Listed outside of the \"YouTube information\" section, contrary to the \"pseudonym\" parameter.",
"type": "string"
},
"education": {
"label": "Education",
"description": "The YouTube personality's institution of higher education and degree, if notable. It is usually not relevant to include for non-graduates.",
"example": "[[University of Oxford]]",
"type": "string"
},
"occupation": {
"aliases": [
"occupations"
],
"label": "Occupation(s)",
"description": "The occupation(s) of the YouTube personality, as given in the lead.",
"example": "[[YouTuber]]",
"type": "string"
},
"spouse": {
"aliases": [
"spouses"
],
"label": "Spouse(s)",
"description": "Name of spouse(s), followed by years of marriage. Use Template:Marriage."
},
"partner": {
"aliases": [
"partners"
],
"label": "Partner(s)",
"description": "Name of long-term unmarried partner(s), followed by years.",
"example": "[[Name]] (1980–present)"
},
"children": {
"label": "Children",
"description": "Number of children (e.g., 3), or list of independently notable names."
},
"parents": {
"aliases": [
"parent"
],
"label": "Parent(s)",
"description": "Names of notable parent(s). If subject has only one notable mother or father, \"mother\" and \"father\" parameters may be used instead."
},
"mother": {
"label": "Mother",
"description": "Name of mother; include only if subject has one mother who is independently notable or particularly relevant. Overridden by \"parents\" parameter."
},
"father": {
"label": "Father",
"description": "Name of father; include only if subject has one father who is independently notable or particularly relevant. Overridden by \"parents\" parameter."
},
"relatives": {
"label": "Relatives",
"description": "Notable relative(s) of the YouTube personality."
},
"organization": {
"aliases": [
"organisation",
"organisations",
"organizations"
],
"label": "Organization(s)",
"description": "Organization(s) the YouTube personality has been signed to. Omit dates.",
"example": "[[OfflineTV]]"
},
"signature": {
"label": "Signature",
"description": "An image of the YouTube personality's signature.",
"type": "wiki-file-name"
},
"signature_size": {
"label": "Signature size",
"description": "The signature width in pixels (\"px\" is automatically added if omitted).",
"default": "150px",
"example": "100px"
},
"signature_alt": {
"aliases": [
"signature alt"
],
"label": "Signature alt",
"description": "Alt text for the signature image."
},
"website": {
"aliases": [
"homepage",
"URL"
],
"label": "Website (personal)",
"description": "The official website of the YouTube personality.",
"example": "{{URL|example.com}}",
"type": "content"
},
"module_personal": {
"label": "Module personal",
"description": "Used for embedding other infoboxes into the \"Personal information\" section of this one."
},
"pseudonym": {
"label": "Also known as",
"description": "Notable aliases of the YouTube personality or channel. Listed in the \"YouTube information\" section, contrary to the \"other_names\" parameter.",
"type": "string"
},
"channel_name": {
"label": {
"en": "Channel name"
},
"description": {
"en": "The primary YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/user/\". Use only one of \"channel_name\", \"channel_url\" or \"channel_direct_url\"."
},
"type": "string"
},
"channel_url": {
"label": {
"en": "Channel URL"
},
"description": {
"en": "The primary YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/channel/\". Use only one of \"channel_name\", \"channel_url\" or \"channel_direct_url\"."
},
"type": "string"
},
"channel_direct_url": {
"label": {
"en": "Channel direct URL"
},
"description": {
"en": "The primary YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/\". Use only one of \"channel_name\", \"channel_url\" or \"channel_direct_url\"."
},
"type": "string"
},
"channel_display_name": {
"label": {
"en": "Channel display name"
},
"description": {
"en": "The primary YouTube channel's display name, if it differs from \"channel_name\", \"channel_url\" or \"channel_direct_url\"."
},
"type": "string"
},
"channel_name2": {
"label": {
"en": "Second channel name"
},
"description": {
"en": "The second YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/user/\". Use only one of \"channel_name2\", \"channel_url2\" or \"channel_direct_url2\". Do not include secondary channels unless they are covered by reliable sources in the body of the article."
},
"type": "string"
},
"channel_url2": {
"label": {
"en": "Second channel URL"
},
"description": {
"en": "The second YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/channel/\". Use only one of \"channel_name2\", \"channel_url2\" or \"channel_direct_url2\". Do not include secondary channels unless they are covered by reliable sources in the body of the article."
},
"type": "string"
},
"channel_direct_url2": {
"label": {
"en": "Second channel direct URL"
},
"description": {
"en": "The second YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/\". Use only one of \"channel_name2\", \"channel_url2\" or \"channel_direct_url2\". Do not include secondary channels unless they are covered by reliable sources in the body of the article."
},
"type": "string"
},
"channel_display_name2": {
"label": {
"en": "Second channel display name"
},
"description": {
"en": "The second YouTube channel's display name, if it differs from \"channel_name2\", \"channel_url2\" or \"channel_direct_url2\"."
},
"type": "string"
},
"channel_name3": {
"label": {
"en": "Third channel name"
},
"description": {
"en": "The third YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/user/\". Use only one of \"channel_name3\", \"channel_url3\" or \"channel_direct_url3\". Do not include secondary channels unless they are covered by reliable sources in the body of the article."
},
"type": "string"
},
"channel_url3": {
"label": {
"en": "Third channel URL"
},
"description": {
"en": "The third YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/channel/\". Use only one of \"channel_name3\", \"channel_url3\" or \"channel_direct_url3\". Do not include secondary channels unless they are covered by reliable sources in the body of the article."
},
"type": "string"
},
"channel_direct_url3": {
"label": {
"en": "Third channel direct URL"
},
"description": {
"en": "The third YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/\". Use only one of \"channel_name3\", \"channel_url3\" or \"channel_direct_url3\". Do not include secondary channels unless they are covered by reliable sources in the body of the article."
},
"type": "string"
},
"channel_display_name3": {
"label": {
"en": "Third channel display name"
},
"description": {
"en": "The third YouTube channel's display name, if it differs from \"channel_name3\", \"channel_url3\" or \"channel_direct_url3\"."
},
"type": "string"
},
"channels": {
"label": "Channels",
"description": "Custom styling for the YouTube channels affiliated with the subject. Overridden by \"channel_name\", \"channel_url\" and \"channel_direct_url\".",
"type": "string"
},
"creator": {
"aliases": [
"creators",
"created_by"
],
"label": "Created by",
"description": "The creator(s) of the YouTube channel.",
"type": "string"
},
"presenter": {
"aliases": [
"presenters",
"presented_by"
],
"label": "Presented by",
"description": "The presenter(s) of the YouTube channel.",
"type": "string"
},
"location": {
"label": "Location",
"description": "The location of the YouTube channel, if notable. Not for mere residence.",
"example": "[[Los Angeles]], California, United States",
"type": "string"
},
"years_active": {
"aliases": [
"years active",
"yearsactive"
],
"label": "Years active",
"description": "Date range in years during which the YouTube channel was active. Use an en dash (–) to separate the years.",
"example": "2009–present",
"type": "string"
},
"genre": {
"label": "Genre",
"description": "The genre(s) of content produced by the YouTube channel.",
"example": "Comedy",
"type": "string",
"aliases": [
"genres"
]
},
"subscribers": {
"label": "Subscribers",
"description": "The number of subscribers the YouTube channel has.",
"example": "1.5 million",
"type": "string"
},
"subscriber_date": {
"description": "The month and year when the YouTube channel's subscriber count was last updated. The date is listed inline with the subscriber count. The all-encompassing \"stats_update\" parameter is generally recommended instead.",
"label": "Subscribers date",
"type": "string"
},
"views": {
"label": {
"en": "Total views"
},
"description": {
"en": "The number of views the YouTube channel has."
},
"example": "1.5 billion",
"type": "string"
},
"view_date": {
"label": {
"en": "Total views date"
},
"description": {
"en": "The month and year when the YouTube channel's view count was last updated. The date is listed inline with the view count. The all-encompassing \"stats_update\" parameter is generally recommended instead."
}
},
"network": {
"description": "The multi-channel network (MCN) that the YouTube channel has been a part of.",
"label": "Network",
"example": "[[Machinima Inc.]] (2013–2015)"
},
"language": {
"label": "Contents are in",
"description": "The primary language(s) of the YouTube channel. Use their English name.",
"type": "string",
"example": "Spanish"
},
"associated_acts": {
"label": "Associated acts",
"description": "Associated YouTube personalities or channels, such as those that collaborate with the subject.",
"type": "string"
},
"channel_website": {
"label": "Website (channel)",
"description": "The official website of the YouTube channel.",
"example": "{{URL|example.com}}"
},
"silver_year": {
"description": "The year the YouTube channel reached 100,000 subscribers. If the year is not known, use \"silver_button=yes\" instead.",
"label": "Silver Creator Award year",
"type": "string"
},
"silver_button": {
"description": "Enter \"yes\" if the YouTube channel has been awarded a Silver Creator Award for reaching 100,000 subscribers. Overriden by \"silver_year\".",
"label": "Silver Creator Award?",
"type": "line"
},
"gold_year": {
"description": "The year the YouTube channel reached 1,000,000 subscribers. If the year is not known, use \"gold_button=yes\" instead.",
"label": "Gold Creator Award year",
"type": "string"
},
"gold_button": {
"description": "Enter \"yes\" if the YouTube channel has been awarded a Gold Creator Award for reaching 1,000,000 subscribers. Overriden by \"gold_year\".",
"label": "Gold Creator Award?",
"type": "line"
},
"diamond_year": {
"description": "The year the YouTube channel reached 10,000,000 subscribers. If the year is not known, use \"diamond_button=yes\" instead.",
"label": "Diamond Creator Award year",
"type": "string"
},
"diamond_button": {
"description": "Enter \"yes\" if the YouTube channel has been awarded a Diamond Creator Award for reaching 10,000,000 subscribers. Overriden by \"diamond_year\".",
"label": "Diamond Creator Award?",
"type": "line"
},
"ruby_year": {
"description": "The year the YouTube channel reached 50,000,000 subscribers. If the year is not known, use \"ruby_button=yes\" instead.",
"label": "Custom Creator Award year",
"type": "string"
},
"ruby_button": {
"description": "Enter \"yes\" if the YouTube channel has been awarded a Custom Creator Award for reaching 50,000,000 subscribers. Overriden by \"ruby_year\".",
"label": "Custom Creator Award?",
"type": "line"
},
"red_diamond_year": {
"description": "The year the YouTube channel reached 100,000,000 subscribers. If the year is not known, use \"red_diamond_button=yes\" instead.",
"label": "Red Diamond Creator Award year",
"type": "string"
},
"red_diamond_button": {
"description": "Enter \"yes\" if the YouTube channel has been awarded a Red Diamond Creator Award for reaching 100,000,000 subscribers. Overridden by \"red_diamond_year\".",
"label": "Red Diamond Creator Award?",
"type": "line"
},
"expand": {
"label": "Expand",
"description": "Enter \"yes\" to expand the \"Creator Awards\" section by default."
},
"module": {
"label": "Module",
"description": "Used for embedding other infoboxes into this one."
},
"stats_update": {
"label": "Last updated",
"description": "The date when the YouTube channel's statistics were last updated. The date is listed at the bottom of the infobox."
},
"extra_information": {
"label": "Extra information",
"description": "If necessary, extra information can be added to the bottom of the infobox."
},
"subbox": {
"label": "Subbox",
"description": "Enter \"yes\" when embedding this infobox into another to retain the red-colored headings."
},
"embed": {
"label": "Embed",
"description": "Enter \"yes\" when embedding this infobox into another to remove the red-colored headings."
}
},
"paramOrder": [
"honorific_prefix",
"name",
"honorific_suffix",
"logo",
"logo_size",
"logo_alt",
"logo_caption",
"image",
"image_upright",
"image_size",
"alt",
"caption",
"birth_name",
"birth_date",
"birth_place",
"death_date",
"death_place",
"origin",
"nationality",
"other_names",
"education",
"occupation",
"spouse",
"partner",
"children",
"parents",
"mother",
"father",
"relatives",
"organization",
"signature",
"signature_size",
"signature_alt",
"website",
"module_personal",
"pseudonym",
"channel_name",
"channel_url",
"channel_direct_url",
"channel_display_name",
"channel_name2",
"channel_url2",
"channel_direct_url2",
"channel_display_name2",
"channel_name3",
"channel_url3",
"channel_direct_url3",
"channel_display_name3",
"channels",
"creator",
"presenter",
"location",
"years_active",
"genre",
"subscribers",
"subscriber_date",
"views",
"view_date",
"network",
"language",
"associated_acts",
"channel_website",
"silver_year",
"silver_button",
"gold_year",
"gold_button",
"diamond_year",
"diamond_button",
"ruby_year",
"ruby_button",
"red_diamond_year",
"red_diamond_button",
"expand",
"module",
"stats_update",
"extra_information",
"subbox",
"embed"
]
}
</templatedata>
== Tracking categories ==
* {{Category link with count|Pages using infobox YouTube personality with unknown parameters}}
* {{Category link with count|Pages with YouTubeSubscribers module errors}}
== See also ==
* [[Template:Infobox Twitch streamer]]
* [[Template:Infobox video game player]]
* [[Template:Infobox podcast]]
== References ==
<references />
<includeonly>{{Basepage subpage|
<!-- Categories go here and interwikis go in Wikidata. -->
[[Category:People and person infobox templates|YouTube personality]]
[[Category:Arts and culture infobox templates|YouTube personality]]
[[Category:Biographical templates usable as a module|YouTube personality]]
[[Category:Infobox templates with module parameter|YouTube personality]]
[[Category:Infobox templates with updated parameter]]
[[Category:Templates that add a tracking category]]
[[Category:Templates that generate named references]]
}}</includeonly>
49374506bdf6fc3f8dba26d2bba380f7daf59e48
Module:Infobox/doc
828
197
411
2023-05-19T18:05:05Z
wikipedia>Andrybak
0
add [[Module:Italic title]] to Lua
wikitext
text/x-wiki
{{High-use|3308957|all-pages = yes}}
{{module rating|protected}}
{{Lua|Module:Navbar|Module:Italic title}}
{{Uses TemplateStyles|Module:Infobox/styles.css|Template:Hlist/styles.css|Template:Plainlist/styles.css}}
'''Module:Infobox''' is a [[WP:Module|module]] that implements the {{tl|Infobox}} template. Please see the template page for usage instructions.
== Tracking categories ==
* {{clc|Pages using infobox templates with ignored data cells}}
* {{clc|Articles using infobox templates with no data rows}}
* {{clc|Pages using embedded infobox templates with the title parameter}}
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
[[Category:Modules that add a tracking category]]
[[Category:Wikipedia infoboxes]]
[[Category:Infobox modules]]
[[Category:Modules that check for strip markers]]
}}</includeonly>
936ad219eb263a6f3293d62f667bd7b5db1059c1
Module:YouTubeSubscribers
828
165
338
2023-05-25T23:29:40Z
wikipedia>Wbm1058
0
see [[Wikipedia talk:WikiProject YouTube#Category:Pages with YouTubeSubscribers module errors]]
Scribunto
text/plain
POINT_IN_TIME_PID = "P585"
YT_CHAN_ID_PID= "P2397"
SUB_COUNT_PID = "P8687"
local p = {}
-- taken from https://en.wikipedia.org/wiki/Module:Wd
function parseDate(dateStr, precision)
precision = precision or "d"
local i, j, index, ptr
local parts = {nil, nil, nil}
if dateStr == nil then
return parts[1], parts[2], parts[3] -- year, month, day
end
-- 'T' for snak values, '/' for outputs with '/Julian' attached
i, j = dateStr:find("[T/]")
if i then
dateStr = dateStr:sub(1, i-1)
end
local from = 1
if dateStr:sub(1,1) == "-" then
-- this is a negative number, look further ahead
from = 2
end
index = 1
ptr = 1
i, j = dateStr:find("-", from)
if i then
-- year
parts[index] = tonumber(mw.ustring.gsub(dateStr:sub(ptr, i-1), "^%+(.+)$", "%1"), 10) -- remove '+' sign (explicitly give base 10 to prevent error)
if parts[index] == -0 then
parts[index] = tonumber("0") -- for some reason, 'parts[index] = 0' may actually store '-0', so parse from string instead
end
if precision == "y" then
-- we're done
return parts[1], parts[2], parts[3] -- year, month, day
end
index = index + 1
ptr = i + 1
i, j = dateStr:find("-", ptr)
if i then
-- month
parts[index] = tonumber(dateStr:sub(ptr, i-1), 10)
if precision == "m" then
-- we're done
return parts[1], parts[2], parts[3] -- year, month, day
end
index = index + 1
ptr = i + 1
end
end
if dateStr:sub(ptr) ~= "" then
-- day if we have month, month if we have year, or year
parts[index] = tonumber(dateStr:sub(ptr), 10)
end
return parts[1], parts[2], parts[3] -- year, month, day
end
-- taken from https://en.wikipedia.org/wiki/Module:Wd
local function datePrecedesDate(aY, aM, aD, bY, bM, bD)
if aY == nil or bY == nil then
return nil
end
aM = aM or 1
aD = aD or 1
bM = bM or 1
bD = bD or 1
if aY < bY then
return true
elseif aY > bY then
return false
elseif aM < bM then
return true
elseif aM > bM then
return false
elseif aD < bD then
return true
end
return false
end
function getClaimDate(claim)
if claim['qualifiers'] and claim['qualifiers'][POINT_IN_TIME_PID] then
local pointsInTime = claim['qualifiers'][POINT_IN_TIME_PID]
if #pointsInTime ~= 1 then
-- be conservative in what we accept
error("Encountered a statement with zero or multiple point in time (P85) qualifiers. Please add or remove point in time information so each statement has exactly one")
end
local pointInTime = pointsInTime[1]
if pointInTime and pointInTime['datavalue'] and pointInTime['datavalue']['value'] and pointInTime['datavalue']['value']['time'] then
return parseDate(pointInTime['datavalue']['value']['time'])
end
end
return nil
end
-- for a given list of statements find the newest one with a matching qual
function newestMatchingStatement(statements, qual, targetQualValue)
local newestStatement = nil
local newestStatementYr = nil
local newestStatementMo = nil
local newestStatementDay = nil
for k, v in pairs(statements) do
if v['rank'] ~= "deprecated" and v['qualifiers'] and v['qualifiers'][qual] then
local quals = v['qualifiers'][qual]
-- should only have one instance of the qualifier on a statement
if #quals == 1 then
local qual = quals[1]
if qual['datavalue'] and qual['datavalue']['value'] then
local qualValue = qual['datavalue']['value']
if qualValue == targetQualValue then
local targetYr, targetMo, targetDay = getClaimDate(v)
if targetYr then
local older = datePrecedesDate(targetYr, targetMo, targetDay, newestStatementYr, newestStatementMo, newestStatementDay)
if older == nil or not older then
newestStatementYr, newestStatementMo, newestStatementDay = targetYr, targetMo, targetDay
newestStatement = v
end
end
end
end
end
end
end
return newestStatement
end
-- for a given property and qualifier pair returns the newest statement that matches
function newestMatching(e, prop, qual, targetQualValue)
-- first check the best statements
local statements = e:getBestStatements(prop)
local newestStatement = newestMatchingStatement(statements, qual, targetQualValue)
if newestStatement then
return newestStatement
end
-- try again with all statements if nothing so far
statements = e:getAllStatements(prop)
newestStatement = newestMatchingStatement(statements, qual, targetQualValue)
if newestStatement then
return newestStatement
end
return nil
end
function getEntity ( frame )
local qid = nil
if frame.args then
qid = frame.args["qid"]
end
if not qid then
qid = mw.wikibase.getEntityIdForCurrentPage()
end
if not qid then
local e = nil
return e
end
local e = mw.wikibase.getEntity(qid)
assert(e, "No such item found: " .. qid)
return e
end
-- find the channel ID we are going to be getting the sub counts for
function getBestYtChanId(e)
local chanIds = e:getBestStatements(YT_CHAN_ID_PID)
if #chanIds == 1 then
local chan = chanIds[1]
if chan and chan["mainsnak"] and chan["mainsnak"]["datavalue"] and chan["mainsnak"]["datavalue"]["value"] then
return chan["mainsnak"]["datavalue"]["value"]
end
end
return nil
end
function returnError(frame, eMessage)
return frame:expandTemplate{ title = 'error', args = { eMessage } } .. "[[Category:Pages with YouTubeSubscribers module errors]]"
end
-- the date of the current YT subscriber count
function p.date( frame )
local e = getEntity(frame)
assert(e, "No qid found for page. Please make a Wikidata item for this article")
local chanId = getBestYtChanId(e)
assert(chanId, "Could not find a single best YouTube channel ID for this item. Add a YouTube channel ID or set the rank of one channel ID to be preferred")
local s = newestMatching(e, SUB_COUNT_PID, YT_CHAN_ID_PID, chanId)
if s then
local yt_year, yt_month, yt_day = getClaimDate(s)
if not yt_year then
return nil
end
local dateString = yt_year .. "|"
-- construct YYYY|mm|dd date string
if yt_month and yt_month ~= 0 then
dateString = dateString .. yt_month .. "|"
-- truncate the day of month
--if yt_day and yt_day ~= 0 then
-- dateString = dateString .. yt_day
--end
end
return frame:expandTemplate{title="Format date", args = {yt_year, yt_month, yd_day}}
end
error("Could not find a date for YouTube subscriber information. Is there a social media followers statement (P8687) qualified with good values for P585 and P2397?")
end
function p.dateNice( frame )
local status, obj = pcall(p.date, frame)
if status then
return obj
else
return returnError(frame, obj)
end
end
-- the most up to date number of subscribers
function p.subCount( frame )
local subCount = nil
local e = getEntity(frame)
if not e then
subCount = -424
return tonumber(subCount)
end
local chanId = getBestYtChanId(e)
if chanId then
local s = newestMatching(e, SUB_COUNT_PID, YT_CHAN_ID_PID, chanId)
if s and s["mainsnak"] and s['mainsnak']["datavalue"] and s['mainsnak']["datavalue"]["value"] and s['mainsnak']["datavalue"]['value']['amount'] then
subCount = s['mainsnak']["datavalue"]['value']['amount']
end
else
subCount = -404
end
if subCount then
return tonumber(subCount)
else
subCount = -412
return tonumber(subCount)
end
end
function p.subCountNice( frame )
local status, obj = pcall(p.subCount, frame)
if status then
if obj >= 0 then
return frame:expandTemplate{title="Format price", args = {obj}}
else
return obj
end
else
return returnError(frame, obj)
end
end
return p
98467dcdea470df426a9b002a85e7ae22390fb10
Template:Infobox YouTube personality
10
109
226
2023-05-26T02:19:35Z
wikipedia>Wbm1058
0
see [[Wikipedia talk:WikiProject YouTube#Category:Pages with YouTubeSubscribers module errors]]
wikitext
text/x-wiki
<includeonly>{{Infobox
| child = {{Yesno|{{{subbox|{{{embed|}}}}}}}}
| templatestyles = Template:Infobox YouTube personality/styles.css
| bodyclass = ib-youtube biography vcard
| title = {{#if:{{Yesno|{{{subbox|{{{embed|}}}}}}}}|<div {{#if:{{Yesno|{{{subbox|}}}}}|class="ib-youtube-title"}}>'''YouTube information'''</div>}}
| aboveclass = ib-youtube-above
| above = {{#if:{{Yesno|{{{subbox|{{{embed|}}}}}}}}||{{br separated entries
|1={{#if:{{{honorific_prefix|{{{honorific prefix|}}}}}}|<span class="honorific-prefix">{{{honorific_prefix|{{{honorific prefix|}}}}}}</span>}}
|2=<span class="fn">{{{name|{{PAGENAMEBASE}}}}}</span>
|3={{#if:{{{honorific_suffix|{{{honorific suffix|}}}}}}|<span class="honorific-suffix">{{{honorific_suffix|{{{honorific suffix|}}}}}}</span>}}
}}
}}
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{logo|}}}|size={{{logo_size|}}}|sizedefault=250px|alt={{{logo_alt|}}}}}
| caption = {{{logo_caption|{{{logo caption|}}}}}}
| image2 = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_size|{{{image size|{{{imagesize|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|{{{upright|1}}}}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
| caption2 = {{{image_caption|{{{caption|{{{image caption|}}}}}}}}}
| headerclass = ib-youtube-header
| header1 = {{#if:{{{birth_name|}}}{{{birth_date|}}}{{{birth_place|}}}{{{death_date|}}}{{{death_place|}}}{{{nationality|}}}{{{occupation|{{{occupations|}}}}}}|Personal information}}
| label2 = Born
| data2 = {{br separated entries|1={{#if:{{{birth_name|}}}|<div class="nickname">{{{birth_name}}}</div>}}|2={{{birth_date|}}}|3={{#if:{{{birth_place|}}}|<div class="birthplace">{{{birth_place|}}}</div>}}}}
| label3 = Died
| data3 = {{br separated entries|1={{{death_date|}}}|2={{#if:{{{death_place|}}}|<div class="deathplace">{{{death_place|}}}</div>}}}}
| label4 = Origin
| data4 = {{{origin|}}}
| label5 = Nationality
| data5 = {{{nationality|}}}
| class5 = category
| label6 = Other names
| data6 = {{{other_names|}}}
| class6 = nickname
| label7 = Education
| data7 = {{{education|}}}
| label8 = Occupation{{#if:{{{occupations|}}}|s|{{Pluralize from text|{{{occupation|}}}|likely=(s)|plural=s}}}}
| data8 = {{{occupation|{{{occupations|}}}}}}
| class8 = role
| label9 = Spouse{{#if:{{{spouses|}}}|s|{{Pluralize from text|{{{spouse|}}}|likely=(s)|plural=s}}}}
| data9 = {{{spouse|{{{spouses|}}}}}}
| label10 = Partner{{#if:{{{partners|}}}|s|{{Pluralize from text|{{{partner|}}}|likely=(s)|plural=s}}}}
| data10 = {{{partner|{{{partners|}}}}}}
| label11 = Children
| data11 = {{{children|}}}
| label12 = Parent{{if either|{{{parents|}}}|{{if both|{{{mother|}}}|{{{father|}}}|true}}|s|{{Pluralize from text|{{{parent|}}}|likely=(s)|plural=s}}}}
| data12 = {{#if:{{{parent|{{{parents|}}}}}}|{{{parent|{{{parents}}}}}}|{{Unbulleted list|{{#if:{{{father|}}}|{{{father}}} (father)}}|{{#if:{{{mother|}}}|{{{mother}}} (mother)}}}}}}
| label13 = Relatives
| data13 = {{{relatives|}}}
| label14 = Organi{{#if:{{{organisation|{{{organisations|}}}}}}|s|z}}ation{{#if:{{{organizations|{{{organisations|}}}}}}|s|{{pluralize from text|{{{organization|{{{organisation|}}}}}}|likely=(s)|plural=s}}}}
| data14 = {{{organization|{{{organisation|{{{organizations|{{{organisations|}}}}}}}}}}}}
| class14 = org
| label15 = Signature
| data15 = {{#invoke:InfoboxImage|InfoboxImage|image={{{signature|}}}|size={{{signature_size|}}}|sizedefault=150px|alt={{{signature_alt|{{{signature alt|}}}}}}}}
| label16 = Website
| data16 = {{{website|{{{homepage|{{{URL|}}}}}}}}}
| data17 = {{{module_personal|}}}
| header20 = {{#if:{{Yesno|{{{subbox|{{{embed|}}}}}}}}||{{#if:{{{pseudonym|}}}{{{channel_name|}}}{{{channel_url|}}}{{{channel_direct_url|}}}{{{channels|}}}{{{years_active|{{{years active|{{{yearsactive|}}}}}}}}}{{{genre|{{{genres|}}}}}}{{#switch:{{#invoke:YouTubeSubscribers|subCountNice}}|-404|-412|-424={{{subscribers|}}}|{{#invoke:YouTubeSubscribers|subCountNice}}}}{{{views|}}}{{{network|}}}{{{associated_acts|}}}|YouTube information}}}}
| label21 = {{Nowrap|Also known as}}
| data21 = {{{pseudonym|}}}
| class21 = nickname
| label22 = Channel{{#if:{{{channels|}}}{{{channel_name2|}}}{{{channel_url2|}}}{{{channel_direct_url2|}}}|s}}
| data22 = {{#if:{{{channel_name|}}}{{{channel_url|}}}{{{channel_direct_url|}}}|{{flatlist|
* [https://www.youtube.com/{{#switch:{{if empty|{{{channel_name|}}}|{{{channel_url|}}}|{{{channel_direct_url|}}}}}|{{{channel_name}}}=user/{{{channel_name}}}|{{{channel_url}}}=channel/{{{channel_url}}}|{{{channel_direct_url}}}}} {{if empty|{{{channel_display_name|}}}|{{{channel_name|}}}|{{{channel_direct_url|}}}|YouTube channel}}]{{#if:{{{channel_name2|}}}{{{channel_url2|}}}{{{channel_direct_url2|}}}|
* [https://www.youtube.com/{{#switch:{{if empty|{{{channel_name2|}}}|{{{channel_url2|}}}|{{{channel_direct_url2|}}}}}|{{{channel_name2}}}=user/{{{channel_name2}}}|{{{channel_url2}}}=channel/{{{channel_url2}}}|{{{channel_direct_url2}}}}} {{if empty|{{{channel_display_name2|}}}|{{{channel_name2|}}}|{{{channel_direct_url2|}}}|YouTube channel}}]{{#if:{{{channel_name3|}}}{{{channel_url3|}}}{{{channel_direct_url3|}}}|
* [https://www.youtube.com/{{#switch:{{if empty|{{{channel_name3|}}}|{{{channel_url3|}}}|{{{channel_direct_url3|}}}}}|{{{channel_name3}}}=user/{{{channel_name3}}}|{{{channel_url3}}}=channel/{{{channel_url3}}}|{{{channel_direct_url3}}}}} {{if empty|{{{channel_display_name3|}}}|{{{channel_name3|}}}|{{{channel_direct_url3|}}}|YouTube channel}}]}} }} }}|{{{channels|}}} }}
| label23 = Created by
| data23 = {{{creator|{{{creators|{{{created_by|}}}}}}}}}
| label24 = Presented by
| data24 = {{{presenter|{{{presenters|{{{presented_by|}}}}}}}}}
| label25 = Location
| data25 = {{{location|}}}
| label26 = Years active
| data26 = {{{years_active|{{{years active|{{{yearsactive|}}}}}}}}}
| label27 = Genre{{#if:{{{genres|}}}|s|{{Pluralize from text|{{{genre|}}}|likely=(s)|plural=s}}}}
| data27 = {{{genre|{{{genres|}}}}}}
| label28 = Subscribers
| data28 = {{#if:{{#switch:{{#invoke:YouTubeSubscribers|subCountNice}}|-404|-412|-424={{{subscribers|}}}|{{#invoke:YouTubeSubscribers|subCountNice}}}}|{{br separated entries|1={{#if:{{{subscribers|}}}|{{{subscribers}}}|{{#switch:{{#invoke:YouTubeSubscribers|subCountNice}}|-404|-412|-424={{main other|[[Category:Pages with YouTubeSubscribers module errors]]}}|{{#invoke:YouTubeSubscribers|subCountNice}}}}}}{{#if:{{{channel_name|}}}{{{channel_url|}}}{{{channel_direct_url|}}}|{{#tag:ref|{{Cite web|title=About {{if empty|{{{channel_display_name|}}}|{{{channel_name|}}}|{{{channel_direct_url|}}}|YouTube channel}}|url=https://www.youtube.com/{{#switch:{{if empty|{{{channel_name|}}}|{{{channel_url|}}}|{{{channel_direct_url|}}}}}|{{{channel_name}}}=user/{{{channel_name}}}|{{{channel_url}}}=channel/{{{channel_url}}}|{{{channel_direct_url}}}}}/about |publisher=[[YouTube]]}}|name="YouTubeStats{{Plain text|{{if empty|{{{channel_display_name|}}}|{{{channel_name|}}}|{{{name|}}}}}}}"}} }}|2={{#if:{{{subscriber_date|}}}|({{{subscriber_date}}})|{{#if:{{{subscribers|}}}||{{#iferror:{{#invoke:YouTubeSubscribers|dateNice}}||({{#invoke:YouTubeSubscribers|dateNice}})}}}}}}}}}}
| label29 = Total views
| data29 = {{#if:{{{views|}}}|{{br separated entries|1={{{views}}}{{if both|{{#switch:{{#invoke:YouTubeSubscribers|subCountNice}}|-404|-412|-424={{{subscribers|}}}|{{#invoke:YouTubeSubscribers|subCountNice}}}}|{{{channel_name|}}}{{{channel_url|}}}{{{channel_direct_url|}}}|{{#tag:ref||name="YouTubeStats{{Plain text|{{if empty|{{{channel_display_name|}}}|{{{channel_name|}}}|{{{name|}}}}}}}"}} }}|2={{#if:{{{view_date|}}}|({{{view_date|}}})}} }} }}
| label30 = [[Multi-channel network|Network]]
| data30 = {{{network|}}}
| label31 = Contents are in
| data31 = {{{language|}}}
| label32 = Associated acts
| data32 = {{{associated_acts|}}}
| label33 = Website
| data33 = {{{channel_website|}}}
| data42 = {{#if:{{{silver_year|}}}{{{silver_button|}}}{{{gold_year|}}}{{{gold_button|}}}{{{diamond_year|}}}{{{diamond_button|}}}{{{ruby_year|}}}{{{ruby_button|}}}{{{red_diamond_year|}}}{{{red_diamond_button|}}}|
<table class="ib-youtube-awards mw-collapsible {{#if:{{Yesno|{{{expand|}}}}}||mw-collapsed}}">
<tr><th colspan="3" {{#if:{{Yesno|{{{embed|}}}}}||class="ib-youtube-awards-color"}}><div>[[YouTube Creator Awards|Creator Awards]]</div></th></tr>
{{If either|{{{silver_year|}}}|{{Yesno|{{{silver_button|}}}}}|then=<tr><td>[[File:YouTube Silver Play Button 2.svg|32px|link=]]</td><td>100,000 subscribers</td><td>{{{silver_year|}}}</td></tr>}}
{{If either|{{{gold_year|}}}|{{Yesno|{{{gold_button|}}}}}|then=<tr><td>[[File:YouTube Gold Play Button 2.svg|32px|link=]]</td><td>1,000,000 subscribers</td><td>{{{gold_year|}}}</td></tr>}}
{{If either|{{{diamond_year|}}}|{{Yesno|{{{diamond_button|}}}}}|then=<tr><td>[[File:YouTube Diamond Play Button.svg|32px|link=]]</td><td>10,000,000 subscribers</td><td>{{{diamond_year|}}}</td></tr>}}
{{If either|{{{ruby_year|}}}|{{Yesno|{{{ruby_button|}}}}}|then=<tr><td>[[File:YouTube Ruby Play Button 2.svg|32px|link=]]</td><td>50,000,000 subscribers</td><td>{{{ruby_year|}}}</td></tr>}}
{{If either|{{{red_diamond_year|}}}|{{Yesno|{{{red_diamond_button|}}}}}|then=<tr><td>[[File:YouTube Red Diamond Play Button.svg|32px|link=]]</td><td>100,000,000 subscribers</td><td>{{{red_diamond_year|}}}</td></tr>}}
</table>}}
| data52 = {{{module|}}}
| belowclass = ib-youtube-below
| below = {{#if:{{{stats_update|}}}|{{hr}}''Last updated:'' {{{stats_update}}}}}{{#if:{{{extra_information|}}}|{{hr}}{{{extra_information}}}}}
}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox YouTube personality with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox YouTube personality]] with unknown parameter "_VALUE_"|ignoreblank=y| alt | associated_acts | birth_date | birth_name | birth_place | caption | channel_name | channel_name2 | channel_name3 | channel_url | channel_url2 | channel_url3 | channel_direct_url | channel_direct_url2 | channel_direct_url3 | channels | channel_display_name | channel_display_name2 | channel_display_name3 | channel_website | children | created_by | creator | creators | father | presented_by | presenter | presenters | death_date | death_place | diamond_button | diamond_year | education | embed | expand | extra_information | genre | genres | gold_button | gold_year | homepage | honorific prefix | honorific suffix | honorific_prefix | honorific_suffix | image | image caption | image size | image_caption | image_size | image_upright | imagesize | language | location | logo | logo caption | logo_caption | logo_alt | logo_size | module | module_personal | mother | name | nationality | network | occupation | occupations | organisation | organisations | organization | organizations | origin | other_names | parent | parents | partner | partners | pseudonym | red_diamond_button | red_diamond_year | relatives | ruby_button | ruby_year | subbox | signature | signature alt | signature_alt | signature_size | silver_button | silver_year | spouse | spouses | stats_update | subscriber_date | subscribers | upright | URL | view_date | views | website | years active | years_active | yearsactive }}</includeonly><noinclude>{{documentation}}</noinclude>
08cd10a16ba44c06a8803113d2bbca0a9127a601
Module:YouTubeSubscribers/doc
828
176
369
2023-05-26T17:38:04Z
wikipedia>Wbm1058
0
/* Data retrieval problem codes */ new section
wikitext
text/x-wiki
{{Module rating|beta}}
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
This module fetches a YouTube channel's subscriber count from its Wikidata entity.
== Usage ==
<code><nowiki>{{</nowiki>#invoke:YouTubeSubscribers|''subCount''<nowiki>|qid=</nowiki>''Wikidata entity ID'' (optional)<nowiki>}}</nowiki></code>
<code><nowiki>{{</nowiki>#invoke:YouTubeSubscribers|''subCountNice''<nowiki>|qid=</nowiki>''Wikidata entity ID'' (optional)<nowiki>}}</nowiki></code> – formats the subscriber count
<code><nowiki>{{</nowiki>#invoke:YouTubeSubscribers|''date''<nowiki>|qid=</nowiki>''Wikidata entity ID'' (optional)<nowiki>}}</nowiki></code>
<code><nowiki>{{</nowiki>#invoke:YouTubeSubscribers|''dateNice''<nowiki>|qid=</nowiki>''Wikidata entity ID'' (optional)<nowiki>}}</nowiki></code>
== Data retrieval problem codes ==
* '''-404''' – Could not find a single best YouTube channel ID for this item. Add a YouTube channel ID or set the rank of one channel ID to be preferred
* '''-412''' – Found an associated YouTube channel ID but could not find a most recent value for social media followers (i.e. P8687 qualified with P585 and P2397)
* '''-424''' – No qid found for page. Please make a Wikidata item for this article
==Error tracking category==
[[:Category:Pages with YouTubeSubscribers module errors]]
<includeonly>{{Sandbox other||
<!-- Categories below this line; interwikis at Wikidata -->
[[Category:Wikidata templates]]
}}</includeonly>
95e396dd285ce792eaf61ddaa36f81eb3de5de8e
Template:High-use
10
196
409
2023-05-30T09:39:48Z
wikipedia>Lectonar
0
Changed protection settings for "[[Template:High-use]]": [[WP:High-risk templates|High-risk template or module]] ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
wikitext
text/x-wiki
{{#invoke:High-use|main|1={{{1|}}}|2={{{2|}}}|info={{{info|}}}|demo={{{demo|}}}|form={{{form|}}}|expiry={{{expiry|}}}|system={{{system|}}}}}<noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage; interwiki links go to Wikidata, thank you! -->
</noinclude>
a3322d1bd47ac03df14fa2090855cff4fede9bc7
Module:High-use
828
73
148
2023-05-30T11:20:32Z
wikipedia>Lectonar
0
Changed protection settings for "[[Module:High-use]]": [[WP:High-risk templates|High-risk template or module]] ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
Scribunto
text/plain
local p = {}
-- _fetch looks at the "demo" argument.
local _fetch = require('Module:Transclusion_count').fetch
local yesno = require('Module:Yesno')
function p.num(frame, count)
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
-- Build output string
local return_value = ""
if count == nil then
if frame.args[1] == "risk" then
return_value = "a very large number of"
else
return_value = "many"
end
else
-- Use 2 significant figures for smaller numbers and 3 for larger ones
local sigfig = 2
if count >= 100000 then
sigfig = 3
end
-- Prepare to round to appropriate number of sigfigs
local f = math.floor(math.log10(count)) - sigfig + 1
-- Round and insert "approximately" or "+" when appropriate
if (frame.args[2] == "yes") or (mw.ustring.sub(frame.args[1],-1) == "+") then
-- Round down
return_value = string.format("%s+", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) ) * (10^(f))) )
else
-- Round to nearest
return_value = string.format("approximately %s", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) + 0.5) * (10^(f))) )
end
-- Insert percentage of pages if that is likely to be >= 1% and when |no-percent= not set to yes
if count and count > 250000 and not yesno (frame:getParent().args['no-percent']) then
local percent = math.floor( ( (count/frame:callParserFunction('NUMBEROFPAGES', 'R') ) * 100) + 0.5)
if percent >= 1 then
return_value = string.format("%s pages, or roughly %s%% of all", return_value, percent)
end
end
end
return return_value
end
-- Actions if there is a large (greater than or equal to 100,000) transclusion count
function p.risk(frame)
local return_value = ""
if frame.args[1] == "risk" then
return_value = "risk"
else
local count = _fetch(frame)
if count and count >= 100000 then return_value = "risk" end
end
return return_value
end
function p.text(frame, count)
-- Only show the information about how this template gets updated if someone
-- is actually editing the page and maybe trying to update the count.
local bot_text = (frame:preprocess("{{REVISIONID}}") == "") and "\n\n----\n'''Preview message''': Transclusion count updated automatically ([[Template:High-use/doc#Technical details|see documentation]])." or ''
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" or title.subpageText == "sandbox" then
title = title.basePageTitle
end
local systemMessages = frame.args['system']
if frame.args['system'] == '' then
systemMessages = nil
end
-- This retrieves the project URL automatically to simplify localiation.
local templateCount = ('on [https://linkcount.toolforge.org/index.php?project=%s&page=%s %s pages]'):format(
mw.title.getCurrentTitle():fullUrl():gsub('//(.-)/.*', '%1'),
mw.uri.encode(title.fullText), p.num(frame, count))
local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used ';
if systemMessages then
used_on_text = used_on_text .. systemMessages ..
((count and count > 2000) and ("''', and " .. templateCount) or ("'''"))
else
used_on_text = used_on_text .. templateCount .. "'''"
end
local sandbox_text = ("%s's [[%s/sandbox|/sandbox]] or [[%s/testcases|/testcases]] subpages, or in your own [[%s]]. "):format(
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"),
title.fullText, title.fullText,
mw.title.getCurrentTitle().namespace == 828 and "Module:Sandbox|module sandbox" or "Wikipedia:User pages#SUB|user subpage"
)
local infoArg = frame.args["info"] ~= "" and frame.args["info"]
if (systemMessages or frame.args[1] == "risk" or (count and count >= 100000) ) then
local info = systemMessages and '.<br/>Changes to it can cause immediate changes to the Wikipedia user interface.' or '.'
if infoArg then
info = info .. "<br />" .. infoArg
end
sandbox_text = info .. '<br /> To avoid major disruption' ..
(count and count >= 100000 and ' and server load' or '') ..
', any changes should be tested in the ' .. sandbox_text ..
'The tested changes can be added to this page in a single edit. '
else
sandbox_text = (infoArg and ('.<br />' .. infoArg .. ' C') or ' and c') ..
'hanges may be widely noticed. Test changes in the ' .. sandbox_text
end
local discussion_text = systemMessages and 'Please discuss changes ' or 'Consider discussing changes '
if frame.args["2"] and frame.args["2"] ~= "" and frame.args["2"] ~= "yes" then
discussion_text = string.format("%sat [[%s]]", discussion_text, frame.args["2"])
else
discussion_text = string.format("%son the [[%s|talk page]]", discussion_text, title.talkPageTitle.fullText )
end
return used_on_text .. sandbox_text .. discussion_text .. " before implementing them." .. bot_text
end
function p.main(frame)
local count = nil
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
local image = "[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]"
local type_param = "style"
local epilogue = ''
if frame.args['system'] and frame.args['system'] ~= '' then
image = "[[File:Ambox important.svg|40px|alt=Warning|link=]]"
type_param = "content"
local nocat = frame:getParent().args['nocat'] or frame.args['nocat']
local categorise = (nocat == '' or not yesno(nocat))
if categorise then
epilogue = frame:preprocess('{{Sandbox other||{{#switch:{{#invoke:Effective protection level|{{#switch:{{NAMESPACE}}|File=upload|#default=edit}}|{{FULLPAGENAME}}}}|sysop|templateeditor|interfaceadmin=|#default=[[Category:Pages used in system messages needing protection]]}}}}')
end
elseif (frame.args[1] == "risk" or (count and count >= 100000)) then
image = "[[File:Ambox warning orange.svg|40px|alt=Warning|link=]]"
type_param = "content"
end
if frame.args["form"] == "editnotice" then
return frame:expandTemplate{
title = 'editnotice',
args = {
["image"] = image,
["text"] = p.text(frame, count),
["expiry"] = (frame.args["expiry"] or "")
}
} .. epilogue
else
return require('Module:Message box').main('ombox', {
type = type_param,
image = image,
text = p.text(frame, count),
expiry = (frame.args["expiry"] or "")
}) .. epilogue
end
end
return p
134551888e066954a89c109d2faa8af71a4454a4
Module:Transclusion count
828
74
150
2023-05-30T20:51:38Z
wikipedia>Isabelle Belato
0
Changed protection settings for "[[Module:Transclusion count]]": [[WP:High-risk templates|Highly visible template]]; requested at [[WP:RfPP]] ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
Scribunto
text/plain
local p = {}
function p.fetch(frame)
local template = nil
local return_value = nil
-- Use demo parameter if it exists, otherswise use current template name
local namespace = mw.title.getCurrentTitle().namespace
if frame.args["demo"] and frame.args["demo"] ~= "" then
template = mw.ustring.gsub(frame.args["demo"],"^[Tt]emplate:","")
elseif namespace == 10 then -- Template namespace
template = mw.title.getCurrentTitle().text
elseif namespace == 828 then -- Module namespace
template = (mw.site.namespaces[828].name .. ":" .. mw.title.getCurrentTitle().text)
end
-- If in template or module namespace, look up count in /data
if template ~= nil then
namespace = mw.title.new(template, "Template").namespace
if namespace == 10 or namespace == 828 then
template = mw.ustring.gsub(template, "/doc$", "") -- strip /doc from end
template = mw.ustring.gsub(template, "/sandbox$", "") -- strip /sandbox from end
local index = mw.ustring.sub(mw.title.new(template).text,1,1)
local status, data = pcall(function ()
return(mw.loadData('Module:Transclusion_count/data/' .. (mw.ustring.find(index, "%a") and index or "other")))
end)
if status then
return_value = tonumber(data[mw.ustring.gsub(template, " ", "_")])
end
end
end
-- If database value doesn't exist, use value passed to template
if return_value == nil and frame.args[1] ~= nil then
local arg1=mw.ustring.match(frame.args[1], '[%d,]+')
if arg1 and arg1 ~= '' then
return_value = tonumber(frame:callParserFunction('formatnum', arg1, 'R'))
end
end
return return_value
end
-- Tabulate this data for [[Wikipedia:Database reports/Templates transcluded on the most pages]]
function p.tabulate(frame)
local list = {}
for i = 65, 91 do
local data = mw.loadData('Module:Transclusion count/data/' .. ((i == 91) and 'other' or string.char(i)))
for name, count in pairs(data) do
table.insert(list, {mw.title.new(name, "Template").fullText, count})
end
end
table.sort(list, function(a, b)
return (a[2] == b[2]) and (a[1] < b[1]) or (a[2] > b[2])
end)
local lang = mw.getContentLanguage();
for i = 1, #list do
list[i] = ('|-\n| %d || [[%s]] || %s\n'):format(i, list[i][1]:gsub('_', ' '), lang:formatNum(list[i][2]))
end
return table.concat(list)
end
return p
000ef6bcbf7b66e727870b0c300c4009da300513
Module:InfoboxImage/doc
828
193
403
2023-06-02T00:35:18Z
wikipedia>Voidxor
0
Use is discouraged per [[WP:THUMBSIZE]]; see {{Para|upright}} below instead.
wikitext
text/x-wiki
{{used in system}}
{{Module rating|protected}}
==Overview==
This module is used within infoboxes to process the image parameters and tidy up the formatting of the result.
==Parameters==
{| class="wikitable"
! Parameter
! Description
|-
| image
| Required. The main parameter that should be passed over which contains the image info.
|-
| size
| Size to display image, in pixels. Use is discouraged per [[WP:THUMBSIZE]]; see {{Para|upright}} below instead.
|-
| maxsize
| Maximum size to display image. Note: If no size or sizedefault params specified then image will be shown at maxsize.
|-
| sizedefault
| The size to use for the image if no size param is specified. Defaults to [[Wikipedia:Autosizing images|frameless]].
|-
| alt
| Alt text for the image.
|-
| title
| Title text for image (mouseover text).
|-
| border
| If yes, then a border is added.
|-
| page
| The page number to be displayed when using a multi-page image.
|-
| upright
| If upright=yes, adds "upright" which displays image at 75% of default image size (which is 220px if not changed at [[Special:Preferences]]). If a value, adds "upright=''value''" to image, where values less than 1 scale the image down (0.9 = 90%) and values greater than 1 scale the image up (1.15 = 115%).
|-
| center
| If yes, then the image is centered.
|-
| thumbtime
| thumbtime param, used for video clips.
|-
| suppressplaceholder
| If no, then will not suppress certain placeholder images. See {{section link||Placeholder images which can be suppressed}}.
|-
| link
| Page to go to when clicking on the image.
|-
| class
| HTML classes to add to the image.
|}
Note: If you specify the maxsize or sizedefault params, then you should include the px after the number.
{{Use dmy dates|date=July 2016}}
==Parameters displayed in image syntax==
All parameters:
:<syntaxhighlight lang="wikitext" style="overflow:auto;">{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | size={{{size}}} | maxsize={{{maxsize}}} | sizedefault={{{sizedefault}}} | upright={{{upright}}} | alt={{{alt}}} | title={{{title}}} | thumbtime={{{thumbtime}}} | link={{{link}}} | border=yes | center=yes | page={{{page}}} | class={{{class}}} }}</syntaxhighlight>
:<code>{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | size={{{size}}} | maxsize={{{maxsize}}} | sizedefault={{{sizedefault}}} | upright={{{upright}}} | alt={{{alt}}} | title={{{title}}} | thumbtime={{{thumbtime}}} | link={{{link}}} | border=yes | center=yes | page={{{page}}} | class={{{class}}}}}</code>
When "size" and "maxsize" are defined, the smaller of the two is used (if "px" is omitted it will be added by the module):
:<syntaxhighlight lang="wikitext" style="overflow:auto;">{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | size=300px | maxsize=250px }}</syntaxhighlight>
:<code>{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | size=300px | maxsize=250px }}</code>
When "size" is not defined, "sizedefault" is used, even if larger than "maxsize" (in actual use "px" is required after the number; omitted here to show it is not added by the module):
:<syntaxhighlight lang="wikitext" style="overflow:auto;">{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | sizedefault=250px | maxsize=200px }}</syntaxhighlight>
:<code>{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | sizedefault=250px | maxsize=200px }}</code>
When "size" and "sizedefault" are not defined, "maxsize" is used (in actual use "px" is required after the number; omitted here to show it is not added by the module):
:<syntaxhighlight lang="wikitext" style="overflow:auto;">{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | maxsize=250px }}</syntaxhighlight>
:<code>{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | maxsize=250px }}</code>
When "size", "sizedefault", and "maxsize" are not defined, "frameless" is added, which displays the image at the default thumbnail size (220px, but logged in users can change this at [[Special:Preferences]]) and is required if using "upright" to scale the default size:
:<syntaxhighlight lang="wikitext" style="overflow:auto;">{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} }}</syntaxhighlight>
:<code>{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} }}</code>
Use of "upright" without a number value, which displays the image at approximately 75% of the user's default size (multiplied by 0.75 then rounded to nearest 10):
:<syntaxhighlight lang="wikitext" style="overflow:auto;">{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | upright = yes }}</syntaxhighlight>
:<code>{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | upright = yes }}</code>
When "alt" is used without "title", the alt text is also used as the title:
:<syntaxhighlight lang="wikitext" style="overflow:auto;">{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | alt = Alt text }}</syntaxhighlight>
:<code>{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | alt = Alt text }}</code>
For more information, see [[Wikipedia:Extended image syntax]].
==Sample usage==
<syntaxhighlight lang="wikitext" style="overflow:auto;">
|image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|upright={{{image_upright|1}}}|alt={{{alt|}}}}}
</syntaxhighlight>
==Examples==
{| class="wikitable"
|-
| {{mlx|InfoboxImage|InfoboxImage}}
| {{#invoke:InfoboxImage|InfoboxImage}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}}}
| {{#invoke:InfoboxImage|InfoboxImage|image=}}
|-
|
{{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg}}<br />
{{mlx|InfoboxImage|InfoboxImage|image{{=}}File:Abbey Rd Studios.jpg}}<br />
{{mlx|InfoboxImage|InfoboxImage|image{{=}}Image:Abbey Rd Studios.jpg}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg}}
|-
|
{{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|upright{{=}}yes}}<br />
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|upright=yes}}
|-
|
{{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|upright{{=}}1.2}}<br />
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|upright=1.2}}
|-
|
{{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|size{{=}}100px}}<br />
{{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|size{{=}}100}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|size=100px}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}{{elc|Image:Abbey Rd Studios.jpg|200px}}}}
| {{#invoke:InfoboxImage|InfoboxImage|image=[[Image:Abbey Rd Studios.jpg|200px]]}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}{{elc|Image:Abbey Rd Studios.jpg|200px}}|title=Abbey Road!}}
| {{#invoke:InfoboxImage|InfoboxImage|image=[[Image:Abbey Rd Studios.jpg|200px]]|title=Abbey Road!}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|sizedefault{{=}}250px|alt{{=}}The front stairs and door of Abbey Road Studios}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|sizedefault=250px|alt=The front stairs and door of Abbey Road Studios}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|sizedefault{{=}}250|alt{{=}}The front stairs and door of Abbey Road Studios}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|sizedefault=250|alt=The front stairs and door of Abbey Road Studios}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|sizedefault{{=}}250px|alt{{=}}The front stairs and door of Abbey Road Studios|title=Exterior, front view of Abbey Road studios}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|sizedefault=250px|alt=The front stairs and door of Abbey Road Studios|title=Exterior, front view of Abbey Road studios}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|alt{{=}}The front stairs and door of Abbey Road Studios}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|alt=The front stairs and door of Abbey Road Studios}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|size{{=}}100px|alt{{=}}The front stairs and door of Abbey Road Studios}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|size=100px|alt=The front stairs and door of Abbey Road Studios}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Bandera de Bilbao.svg|size{{=}}100|border{{=}}yes}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Bandera de Bilbao.svg|size=200|border=yes}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Image is needed male.svg}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Image is needed male.svg}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Image is needed male.svg|suppressplaceholder=no}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Image is needed male.svg|suppressplaceholder=no}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}{{elc|File:Image is needed male.svg|200px}}}}
| {{#invoke:InfoboxImage|InfoboxImage|image=[[File:Image is needed male.svg|200px]]}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}{{elc|File:Image is needed male.svg|200px}}|suppressplaceholder{{=}}no}}
| {{#invoke:InfoboxImage|InfoboxImage|image=[[File:Image is needed male.svg|200px]]|suppressplaceholder=no}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|size=50px|maxsize{{=}}100px}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|size=50px|maxsize=100px}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|size=200px|maxsize{{=}}100px}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|size=200px|maxsize=100px}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}{{elc|File:Abbey Rd Studios.jpg|200px}}|maxsize{{=}}100px}}
| {{#invoke:InfoboxImage|InfoboxImage|image=[[File:Abbey Rd Studios.jpg|200px]]|maxsize=100px}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|maxsize{{=}}100px|center{{=}}yes}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|maxsize=100px|center=yes}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}no such image|maxsize{{=}}100px|center{{=}}yes}}<!-- this issue sh'd be fixed somewhow-->
| {{#invoke:InfoboxImage|InfoboxImage|image=no such image|maxsize=100px|center=yes}}
|}
== Placeholder images which can be suppressed ==
{|
| style="vertical-align:top;" |
* [[:File:Blue - replace this image female.svg]]
* [[:File:Blue - replace this image male.svg]]
* [[:File:Female no free image yet.png]]
* [[:File:Male no free image yet.png]]
* [[:File:Flag of None (square).svg]]
* [[:File:Flag of None.svg]]
* [[:File:Flag of.svg]]
* [[:File:Green - replace this image female.svg]]
* [[:File:Green - replace this image male.svg]]
* [[:File:Image is needed female.svg]]
* [[:File:Image is needed male.svg]]
* [[:File:Location map of None.svg]]
* [[:File:Male no free image yet.png]]
* [[:File:Missing flag.png]]
* [[:File:No flag.svg]]
* [[:File:No free portrait.svg]]
* [[:File:No portrait (female).svg]]
* [[:File:No portrait (male).svg]]
* [[:File:Red - replace this image female.svg]]
* [[:File:Red - replace this image male.svg]]
* [[:File:Replace this image female (blue).svg]]
* [[:File:Replace this image female.svg]]
* [[:File:Replace this image male (blue).svg]]
* [[:File:Replace this image male.svg]]
* [[:File:Silver - replace this image female.svg]]
* [[:File:Silver - replace this image male.svg]]
* [[:File:Replace this image.svg]]
* [[:File:Cricket no pic.png]]
* [[:File:CarersLogo.gif]]
* [[:File:Diagram Needed.svg]]
* [[:File:Example.jpg]]
* [[:File:Image placeholder.png]]
* [[:File:No male portrait.svg]]
* [[:File:Nocover-upload.png]]
* [[:File:NoDVDcover copy.png]]
* [[:File:Noribbon.svg]]
| style="vertical-align:top;" |
* [[:File:No portrait-BFD-test.svg]]
* [[:File:Placeholder barnstar ribbon.png]]
* [[:File:Project Trains no image.png]]
* [[:File:Image-request.png]]
* [[:File:Sin bandera.svg]]
* [[:File:Sin escudo.svg]]
* [[:File:Replace this image - temple.png]]
* [[:File:Replace this image butterfly.png]]
* [[:File:Replace this image.svg]]
* [[:File:Replace this image1.svg]]
* [[:File:Resolution angle.png]]
* [[:File:Image-No portrait-text-BFD-test.svg]]
* [[:File:Insert image here.svg]]
* [[:File:No image available.png]]
* [[:File:NO IMAGE YET square.png]]
* [[:File:NO IMAGE YET.png]]
* [[:File:No Photo Available.svg]]
* [[:File:No Screenshot.svg]]
* [[:File:No-image-available.jpg]]
* [[:File:Null.png]]
* [[:File:PictureNeeded.gif]]
* [[:File:Place holder.jpg]]
* [[:File:Unbenannt.JPG]]
* [[:File:UploadACopyrightFreeImage.svg]]
* [[:File:UploadAnImage.gif]]
* [[:File:UploadAnImage.svg]]
* [[:File:UploadAnImageShort.svg]]
* [[:File:CarersLogo.gif]]
* [[:File:Diagram Needed.svg]]
* [[:File:No male portrait.svg]]
* [[:File:NoDVDcover copy.png]]
* [[:File:Placeholder barnstar ribbon.png]]
* [[:File:Project Trains no image.png]]
* [[:File:Image-request.png]]
|}
== Tracking categories ==
* {{clc|Pages using infoboxes with thumbnail images}}
<includeonly>{{Sandbox other||
{{DEFAULTSORT:Image, {{PAGENAME}}}}
[[Category:Modules for image handling]]
[[Category:Modules that add a tracking category]]
[[Category:Infobox modules]]
}}</includeonly>
c94fcbc786f35c8e23c8f499b3090efc604852c7
Module:Age
828
133
274
2023-06-11T07:27:55Z
wikipedia>Johnuniq
0
change default for {{age}} from range=no to range=dash per [[Template talk:Age#Inaccurate age shown]]
Scribunto
text/plain
-- Implement various "age of" and other date-related templates.
local mtext = {
-- Message and other text that should be localized.
-- Also need to localize text in table names in function dateDifference.
['mt-bad-param1'] = 'Invalid parameter $1',
['mt-bad-param2'] = 'Parameter $1=$2 is invalid',
['mt-bad-show'] = 'Parameter show=$1 is not supported here',
['mt-cannot-add'] = 'Cannot add "$1"',
['mt-conflicting-show'] = 'Parameter show=$1 conflicts with round=$2',
['mt-date-wrong-order'] = 'The second date must be later in time than the first date',
['mt-dd-future'] = 'Death date (first date) must not be in the future',
['mt-dd-wrong-order'] = 'Death date (first date) must be later in time than the birth date (second date)',
['mt-invalid-bd-age'] = 'Invalid birth date for calculating age',
['mt-invalid-dates-age'] = 'Invalid dates for calculating age',
['mt-invalid-end'] = 'Invalid end date in second parameter',
['mt-invalid-start'] = 'Invalid start date in first parameter',
['mt-need-jdn'] = 'Need valid Julian date number',
['mt-need-valid-bd'] = 'Need valid birth date: year, month, day',
['mt-need-valid-bd2'] = 'Need valid birth date (second date): year, month, day',
['mt-need-valid-date'] = 'Need valid date',
['mt-need-valid-dd'] = 'Need valid death date (first date): year, month, day',
['mt-need-valid-ymd'] = 'Need valid year, month, day',
['mt-need-valid-ymd-current'] = 'Need valid year|month|day or "currentdate"',
['mt-need-valid-ymd2'] = 'Second date should be year, month, day',
['mt-template-bad-name'] = 'The specified template name is not valid',
['mt-template-x'] = 'The template invoking this must have "|template=x" where x is the wanted operation',
['txt-and'] = ' and ',
['txt-or'] = ' or ',
['txt-category'] = 'Category:Age error',
['txt-comma-and'] = ', and ',
['txt-error'] = 'Error: ',
['txt-format-default'] = 'mf', -- 'df' (day first = dmy) or 'mf' (month first = mdy)
['txt-module-convertnumeric'] = 'Module:ConvertNumeric',
['txt-module-date'] = 'Module:Date',
['txt-sandbox'] = 'sandbox',
['txt-bda'] = '<span style="display:none"> (<span class="bday">$1</span>) </span>$2<span class="noprint ForceAgeToShow"> (age $3)</span>',
['txt-dda'] = '$2<span style="display:none">($1)</span> (aged $3)',
['txt-bda-disp'] = 'disp_raw', -- disp_raw → age is a number only; disp_age → age is a number and unit (normally years but months or days if very young)
['txt-dda-disp'] = 'disp_raw',
['txt-dmy'] = '%-d %B %-Y',
['txt-mdy'] = '%B %-d, %-Y',
}
local isWarning = {
['mt-bad-param1'] = true,
}
local translate, from_en, to_en, isZero
if translate then
-- Functions to translate from en to local language and reverse go here.
-- See example at [[:bn:Module:বয়স]].
else
from_en = function (text)
return text
end
isZero = function (text)
return tonumber(text) == 0
end
end
local _Date, _currentDate
local function getExports(frame)
-- Return objects exported from the date module or its sandbox.
if not _Date then
local sandbox = frame:getTitle():find(mtext['txt-sandbox'], 1, true) and ('/' .. mtext['txt-sandbox']) or ''
local datemod = require(mtext['txt-module-date'] .. sandbox)
local realDate = datemod._Date
_currentDate = datemod._current
if to_en then
_Date = function (...)
local args = {}
for i, v in ipairs({...}) do
args[i] = to_en(v)
end
return realDate(unpack(args))
end
else
_Date = realDate
end
end
return _Date, _currentDate
end
local Collection -- a table to hold items
Collection = {
add = function (self, item)
if item ~= nil then
self.n = self.n + 1
self[self.n] = item
end
end,
join = function (self, sep)
return table.concat(self, sep)
end,
remove = function (self, pos)
if self.n > 0 and (pos == nil or (0 < pos and pos <= self.n)) then
self.n = self.n - 1
return table.remove(self, pos)
end
end,
sort = function (self, comp)
table.sort(self, comp)
end,
new = function ()
return setmetatable({n = 0}, Collection)
end
}
Collection.__index = Collection
local function stripToNil(text)
-- If text is a string, return its trimmed content, or nil if empty.
-- Otherwise return text (which may, for example, be nil).
if type(text) == 'string' then
text = text:match('(%S.-)%s*$')
end
return text
end
local function dateFormat(args)
-- Return string for wanted date format.
local default = mtext['txt-format-default']
local other = default == 'df' and 'mf' or 'df'
local wanted = stripToNil(args[other]) and other or default
return wanted == 'df' and mtext['txt-dmy'] or mtext['txt-mdy']
end
local function substituteParameters(text, ...)
-- Return text after substituting any given parameters for $1, $2, etc.
return mw.message.newRawMessage(text, ...):plain()
end
local function yes(parameter)
-- Return true if parameter should be interpreted as "yes".
-- Do not want to accept mixed upper/lowercase unless done by current templates.
-- Need to accept "on" because "round=on" is wanted.
return ({ y = true, yes = true, on = true })[parameter]
end
local function message(msg, ...)
-- Return formatted message text for an error or warning.
local function getText(msg)
return mtext[msg] or error('Bug: message "' .. tostring(msg) .. '" not defined')
end
local categories = {
error = mtext['txt-category'],
warning = mtext['txt-category'],
}
local a, b, k, category
local text = substituteParameters(getText(msg), ...)
if isWarning[msg] then
a = '<sup>[<i>'
b = '</i>]</sup>'
k = 'warning'
else
a = '<strong class="error">' .. getText('txt-error')
b = '</strong>'
k = 'error'
end
if mw.title.getCurrentTitle():inNamespaces(0) then
-- Category only in namespaces: 0=article.
category = '[[' .. categories[k] .. ']]'
end
return
a ..
mw.text.nowiki(text) ..
b ..
(category or '')
end
local function formatNumber(number)
-- Return the given number formatted with commas as group separators,
-- given that the number is an integer.
local numstr = tostring(number)
local length = #numstr
local places = Collection.new()
local pos = 0
repeat
places:add(pos)
pos = pos + 3
until pos >= length
places:add(length)
local groups = Collection.new()
for i = places.n, 2, -1 do
local p1 = length - places[i] + 1
local p2 = length - places[i - 1]
groups:add(numstr:sub(p1, p2))
end
return groups:join(',')
end
local function spellNumber(number, options, i)
-- Return result of spelling number, or
-- return number (as a string) if cannot spell it.
-- i == 1 for the first number which can optionally start with an uppercase letter.
number = tostring(number)
return require(mtext['txt-module-convertnumeric']).spell_number(
number,
nil, -- fraction numerator
nil, -- fraction denominator
i == 1 and options.upper, -- true: 'One' instead of 'one'
not options.us, -- true: use 'and' between tens/ones etc
options.adj, -- true: hyphenated
options.ordinal -- true: 'first' instead of 'one'
) or number
end
local function makeExtra(args, flagCurrent)
-- Return extra text that will be inserted before the visible result
-- but after any sort key.
local extra = args.prefix or ''
if mw.ustring.len(extra) > 1 then
-- Parameter "~" gives "~3" whereas "over" gives "over 3".
if extra:sub(-6, -1) ~= ' ' then
extra = extra .. ' '
end
end
if flagCurrent then
extra = '<span class="currentage"></span>' .. extra
end
return extra
end
local function makeSort(value, sortable)
-- Return a sort key if requested.
-- Assume value is a valid number which has not overflowed.
if sortable == 'sortable_table' or sortable == 'sortable_on' or sortable == 'sortable_debug' then
local sortKey
if value == 0 then
sortKey = '5000000000000000000'
else
local mag = math.floor(math.log10(math.abs(value)) + 1e-14)
if value > 0 then
sortKey = 7000 + mag
else
sortKey = 2999 - mag
value = value + 10^(mag+1)
end
sortKey = string.format('%d', sortKey) .. string.format('%015.0f', math.floor(value * 10^(14-mag)))
end
local result
if sortable == 'sortable_table' then
result = 'data-sort-value="_SORTKEY_"|'
elseif sortable == 'sortable_debug' then
result = '<span data-sort-value="_SORTKEY_♠"><span style="border:1px solid">_SORTKEY_♠</span></span>'
else
result = '<span data-sort-value="_SORTKEY_♠"></span>'
end
return (result:gsub('_SORTKEY_', sortKey))
end
end
local translateParameters = {
abbr = {
off = 'abbr_off',
on = 'abbr_on',
},
disp = {
age = 'disp_age',
raw = 'disp_raw',
},
format = {
raw = 'format_raw',
commas = 'format_commas',
},
round = {
on = 'on',
yes = 'on',
months = 'ym',
weeks = 'ymw',
days = 'ymd',
hours = 'ymdh',
},
sep = {
comma = 'sep_comma',
[','] = 'sep_comma',
serialcomma = 'sep_serialcomma',
space = 'sep_space',
},
show = {
hide = { id = 'hide' },
y = { 'y', id = 'y' },
ym = { 'y', 'm', id = 'ym' },
ymd = { 'y', 'm', 'd', id = 'ymd' },
ymw = { 'y', 'm', 'w', id = 'ymw' },
ymwd = { 'y', 'm', 'w', 'd', id = 'ymwd' },
yd = { 'y', 'd', id = 'yd', keepZero = true },
m = { 'm', id = 'm' },
md = { 'm', 'd', id = 'md' },
w = { 'w', id = 'w' },
wd = { 'w', 'd', id = 'wd' },
h = { 'H', id = 'h' },
hm = { 'H', 'M', id = 'hm' },
hms = { 'H', 'M', 'S', id = 'hms' },
M = { 'M', id = 'M' },
s = { 'S', id = 's' },
d = { 'd', id = 'd' },
dh = { 'd', 'H', id = 'dh' },
dhm = { 'd', 'H', 'M', id = 'dhm' },
dhms = { 'd', 'H', 'M', 'S', id = 'dhms' },
ymdh = { 'y', 'm', 'd', 'H', id = 'ymdh' },
ymdhm = { 'y', 'm', 'd', 'H', 'M', id = 'ymdhm' },
ymwdh = { 'y', 'm', 'w', 'd', 'H', id = 'ymwdh' },
ymwdhm = { 'y', 'm', 'w', 'd', 'H', 'M', id = 'ymwdhm' },
},
sortable = {
off = false,
on = 'sortable_on',
table = 'sortable_table',
debug = 'sortable_debug',
},
}
local spellOptions = {
cardinal = {},
Cardinal = { upper = true },
cardinal_us = { us = true },
Cardinal_us = { us = true, upper = true },
ordinal = { ordinal = true },
Ordinal = { ordinal = true, upper = true },
ordinal_us = { ordinal = true, us = true },
Ordinal_us = { ordinal = true, us = true, upper = true },
}
local function dateExtract(frame)
-- Return part of a date after performing an optional operation.
local Date = getExports(frame)
local args = frame:getParent().args
local parms = {}
for i, v in ipairs(args) do
parms[i] = v
end
if yes(args.fix) then
table.insert(parms, 'fix')
end
if yes(args.partial) then
table.insert(parms, 'partial')
end
local show = stripToNil(args.show) or 'dmy'
local date = Date(unpack(parms))
if not date then
if show == 'format' then
return 'error'
end
return message('mt-need-valid-date')
end
local add = stripToNil(args.add)
if add then
for item in add:gmatch('%S+') do
date = date + item
if not date then
return message('mt-cannot-add', item)
end
end
end
local sortKey, result
local sortable = translateParameters.sortable[args.sortable]
if sortable then
local value = (date.partial and date.partial.first or date).jdz
sortKey = makeSort(value, sortable)
end
if show ~= 'hide' then
result = date[show]
if result == nil then
result = from_en(date:text(show))
elseif type(result) == 'boolean' then
result = result and '1' or '0'
else
result = from_en(tostring(result))
end
end
return (sortKey or '') .. makeExtra(args) .. (result or '')
end
local function rangeJoin(range)
-- Return text to be used between a range of ages.
return range == 'dash' and '–' or mtext['txt-or']
end
local function makeText(values, components, names, options, noUpper)
-- Return wikitext representing an age or duration.
local text = Collection.new()
local count = #values
local sep = names.sep or ''
for i, v in ipairs(values) do
-- v is a number (say 4 for 4 years), or a table ({4,5} for 4 or 5 years).
local islist = type(v) == 'table'
if (islist or v > 0) or (text.n == 0 and i == count) or (text.n > 0 and components.keepZero) then
local fmt, vstr
if options.spell then
fmt = function(number)
return spellNumber(number, options.spell, noUpper or i)
end
elseif i == 1 and options.format == 'format_commas' then
-- Numbers after the first should be small and not need formatting.
fmt = formatNumber
else
fmt = tostring
end
if islist then
vstr = fmt(v[1]) .. rangeJoin(options.range)
noUpper = true
vstr = vstr .. fmt(v[2])
else
vstr = fmt(v)
end
local name = names[components[i]]
if name then
if type(name) == 'table' then
name = mw.getContentLanguage():plural(islist and v[2] or v, name)
end
text:add(vstr .. sep .. name)
else
text:add(vstr)
end
end
end
local first, last
if options.join == 'sep_space' then
first = ' '
last = ' '
elseif options.join == 'sep_comma' then
first = ', '
last = ', '
elseif options.join == 'sep_serialcomma' and text.n > 2 then
first = ', '
last = mtext['txt-comma-and']
else
first = ', '
last = mtext['txt-and']
end
for i, v in ipairs(text) do
if i < text.n then
text[i] = v .. (i + 1 < text.n and first or last)
end
end
local sign = ''
if options.isnegative then
-- Do not display negative zero.
if text.n > 1 or (text.n == 1 and text[1]:sub(1, 1) ~= '0' ) then
if options.format == 'format_raw' then
sign = '-' -- plain hyphen so result can be used in a calculation
else
sign = '−' -- Unicode U+2212 MINUS SIGN
end
end
end
return
(options.sortKey or '') ..
(options.extra or '') ..
sign ..
text:join() ..
(options.suffix or '')
end
local function dateDifference(parms)
-- Return a formatted date difference using the given parameters
-- which have been validated.
local names = {
-- Each name is:
-- * a string if no plural form of the name is used; or
-- * a table of strings, one of which is selected using the rules at
-- https://translatewiki.net/wiki/Plural/Mediawiki_plural_rules
abbr_off = {
sep = ' ',
y = {'year', 'years'},
m = {'month', 'months'},
w = {'week', 'weeks'},
d = {'day', 'days'},
H = {'hour', 'hours'},
M = {'minute', 'minutes'},
S = {'second', 'seconds'},
},
abbr_on = {
y = 'y',
m = 'm',
w = 'w',
d = 'd',
H = 'h',
M = 'm',
S = 's',
},
abbr_infant = { -- for {{age for infant}}
sep = ' ',
y = {'yr', 'yrs'},
m = {'mo', 'mos'},
w = {'wk', 'wks'},
d = {'day', 'days'},
H = {'hr', 'hrs'},
M = {'min', 'mins'},
S = {'sec', 'secs'},
},
abbr_raw = {},
}
local diff = parms.diff -- must be a valid date difference
local show = parms.show -- may be nil; default is set below
local abbr = parms.abbr or 'abbr_off'
local defaultJoin
if abbr ~= 'abbr_off' then
defaultJoin = 'sep_space'
end
if not show then
show = 'ymd'
if parms.disp == 'disp_age' then
if diff.years < 3 then
defaultJoin = 'sep_space'
if diff.years >= 1 then
show = 'ym'
else
show = 'md'
end
else
show = 'y'
end
end
end
if type(show) ~= 'table' then
show = translateParameters.show[show]
end
if parms.disp == 'disp_raw' then
defaultJoin = 'sep_space'
abbr = 'abbr_raw'
elseif parms.wantSc then
defaultJoin = 'sep_serialcomma'
end
local diffOptions = {
round = parms.round,
duration = parms.wantDuration,
range = parms.range and true or nil,
}
local sortKey
if parms.sortable then
local value = diff.age_days + (parms.wantDuration and 1 or 0) -- days and fraction of a day
if diff.isnegative then
value = -value
end
sortKey = makeSort(value, parms.sortable)
end
local textOptions = {
extra = parms.extra,
format = parms.format,
join = parms.sep or defaultJoin,
isnegative = diff.isnegative,
range = parms.range,
sortKey = sortKey,
spell = parms.spell,
suffix = parms.suffix, -- not currently used
}
if show.id == 'hide' then
return sortKey or ''
end
local values = { diff:age(show.id, diffOptions) }
if values[1] then
return makeText(values, show, names[abbr], textOptions)
end
if diff.partial then
-- Handle a more complex range such as
-- {{age_yd|20 Dec 2001|2003|range=yes}} → 1 year, 12 days or 2 years, 11 days
local opt = {
format = textOptions.format,
join = textOptions.join,
isnegative = textOptions.isnegative,
spell = textOptions.spell,
}
return
(textOptions.sortKey or '') ..
makeText({ diff.partial.mindiff:age(show.id, diffOptions) }, show, names[abbr], opt) ..
rangeJoin(textOptions.range) ..
makeText({ diff.partial.maxdiff:age(show.id, diffOptions) }, show, names[abbr], opt, true) ..
(textOptions.suffix or '')
end
return message('mt-bad-show', show.id)
end
local function getDates(frame, getopt)
-- Parse template parameters and return one of:
-- * date (a date table, if single)
-- * date1, date2 (two date tables, if not single)
-- * text (a string error message)
-- A missing date is optionally replaced with the current date.
-- If wantMixture is true, a missing date component is replaced
-- from the current date, so can get a bizarre mixture of
-- specified/current y/m/d as has been done by some "age" templates.
-- Some results may be placed in table getopt.
local Date, currentDate = getExports(frame)
getopt = getopt or {}
local function flagCurrent(text)
-- This allows the calling template to detect if the current date has been used,
-- that is, whether both dates have been entered in a template expecting two.
-- For example, an infobox may want the age when an event occurred, not the current age.
-- Don't bother detecting if wantMixture is used because not needed and it is a poor option.
if not text then
if getopt.noMissing then
return nil -- this gives a nil date which gives an error
end
text = 'currentdate'
if getopt.flag == 'usesCurrent' then
getopt.usesCurrent = true
end
end
return text
end
local args = frame:getParent().args
local fields = {}
local isNamed = args.year or args.year1 or args.year2 or
args.month or args.month1 or args.month2 or
args.day or args.day1 or args.day2
if isNamed then
fields[1] = args.year1 or args.year
fields[2] = args.month1 or args.month
fields[3] = args.day1 or args.day
fields[4] = args.year2
fields[5] = args.month2
fields[6] = args.day2
else
for i = 1, 6 do
fields[i] = args[i]
end
end
local imax = 0
for i = 1, 6 do
fields[i] = stripToNil(fields[i])
if fields[i] then
imax = i
end
if getopt.omitZero and i % 3 ~= 1 then -- omit zero months and days as unknown values but keep year 0 which is 1 BCE
if isZero(fields[i]) then
fields[i] = nil
getopt.partial = true
end
end
end
local fix = getopt.fix and 'fix' or ''
local partialText = getopt.partial and 'partial' or ''
local dates = {}
if isNamed or imax >= 3 then
local nrDates = getopt.single and 1 or 2
if getopt.wantMixture then
-- Cannot be partial since empty fields are set from current.
local components = { 'year', 'month', 'day' }
for i = 1, nrDates * 3 do
fields[i] = fields[i] or currentDate[components[i > 3 and i - 3 or i]]
end
for i = 1, nrDates do
local index = i == 1 and 1 or 4
local y, m, d = fields[index], fields[index+1], fields[index+2]
if (m == 2 or m == '2') and (d == 29 or d == '29') then
-- Workaround error with following which attempt to use invalid date 2001-02-29.
-- {{age_ymwd|year1=2001|year2=2004|month2=2|day2=29}}
-- {{age_ymwd|year1=2001|month1=2|year2=2004|month2=1|day2=29}}
-- TODO Get rid of wantMixture because even this ugly code does not handle
-- 'Feb' or 'February' or 'feb' or 'february'.
if not ((y % 4 == 0 and y % 100 ~= 0) or y % 400 == 0) then
d = 28
end
end
dates[i] = Date(y, m, d)
end
else
-- If partial dates are allowed, accept
-- year only, or
-- year and month only
-- Do not accept year and day without a month because that makes no sense
-- (and because, for example, Date('partial', 2001, nil, 12) sets day = nil, not 12).
for i = 1, nrDates do
local index = i == 1 and 1 or 4
local y, m, d = fields[index], fields[index+1], fields[index+2]
if (getopt.partial and y and (m or not d)) or (y and m and d) then
dates[i] = Date(fix, partialText, y, m, d)
elseif not y and not m and not d then
dates[i] = Date(flagCurrent())
end
end
end
else
getopt.textdates = true -- have parsed each date from a single text field
dates[1] = Date(fix, partialText, flagCurrent(fields[1]))
if not getopt.single then
dates[2] = Date(fix, partialText, flagCurrent(fields[2]))
end
end
if not dates[1] then
return message(getopt.missing1 or 'mt-need-valid-ymd')
end
if getopt.single then
return dates[1]
end
if not dates[2] then
return message(getopt.missing2 or 'mt-need-valid-ymd2')
end
return dates[1], dates[2]
end
local function ageGeneric(frame)
-- Return the result required by the specified template.
-- Can use sortable=x where x = on/table/off/debug in any supported template.
-- Some templates default to sortable=on but can be overridden.
local name = frame.args.template
if not name then
return message('mt-template-x')
end
local args = frame:getParent().args
local specs = {
age_days = { -- {{age in days}}
show = 'd',
disp = 'disp_raw',
},
age_days_nts = { -- {{age in days nts}}
show = 'd',
disp = 'disp_raw',
format = 'format_commas',
sortable = 'on',
},
duration_days = { -- {{duration in days}}
show = 'd',
disp = 'disp_raw',
duration = true,
},
duration_days_nts = { -- {{duration in days nts}}
show = 'd',
disp = 'disp_raw',
format = 'format_commas',
sortable = 'on',
duration = true,
},
age_full_years = { -- {{age}}
show = 'y',
abbr = 'abbr_raw',
flag = 'usesCurrent',
omitZero = true,
range = 'dash',
},
age_full_years_nts = { -- {{age nts}}
show = 'y',
abbr = 'abbr_raw',
format = 'format_commas',
sortable = 'on',
},
age_in_years = { -- {{age in years}}
show = 'y',
abbr = 'abbr_raw',
negative = 'error',
range = 'dash',
},
age_in_years_nts = { -- {{age in years nts}}
show = 'y',
abbr = 'abbr_raw',
negative = 'error',
range = 'dash',
format = 'format_commas',
sortable = 'on',
},
age_infant = { -- {{age for infant}}
-- Do not set show because special processing is done later.
abbr = yes(args.abbr) and 'abbr_infant' or 'abbr_off',
disp = 'disp_age',
sep = 'sep_space',
sortable = 'on',
},
age_m = { -- {{age in months}}
show = 'm',
disp = 'disp_raw',
},
age_w = { -- {{age in weeks}}
show = 'w',
disp = 'disp_raw',
},
age_wd = { -- {{age in weeks and days}}
show = 'wd',
},
age_yd = { -- {{age in years and days}}
show = 'yd',
format = 'format_commas',
sep = args.sep ~= 'and' and 'sep_comma' or nil,
},
age_yd_nts = { -- {{age in years and days nts}}
show = 'yd',
format = 'format_commas',
sep = args.sep ~= 'and' and 'sep_comma' or nil,
sortable = 'on',
},
age_ym = { -- {{age in years and months}}
show = 'ym',
sep = 'sep_comma',
},
age_ymd = { -- {{age in years, months and days}}
show = 'ymd',
range = true,
},
age_ymwd = { -- {{age in years, months, weeks and days}}
show = 'ymwd',
wantMixture = true,
},
}
local spec = specs[name]
if not spec then
return message('mt-template-bad-name')
end
if name == 'age_days' then
local su = stripToNil(args['show unit'])
if su then
if su == 'abbr' or su == 'full' then
spec.disp = nil
spec.abbr = su == 'abbr' and 'abbr_on' or nil
end
end
end
local partial, autofill
local range = stripToNil(args.range) or spec.range
if range then
-- Suppose partial dates are used and age could be 11 or 12 years.
-- "|range=" (empty value) has no effect (spec is used).
-- "|range=yes" or spec.range == true sets range = true (gives "11 or 12")
-- "|range=dash" or spec.range == 'dash' sets range = 'dash' (gives "11–12").
-- "|range=no" or spec.range == 'no' sets range = nil and fills each date in the diff (gives "12").
-- ("on" is equivalent to "yes", and "off" is equivalent to "no").
-- "|range=OTHER" sets range = nil and rejects partial dates.
range = ({ dash = 'dash', off = 'no', no = 'no', [true] = true })[range] or yes(range)
if range then
partial = true -- accept partial dates with a possible age range for the result
if range == 'no' then
autofill = true -- missing month/day in first or second date are filled from other date or 1
range = nil
end
end
end
local getopt = {
fix = yes(args.fix),
flag = stripToNil(args.flag) or spec.flag,
omitZero = spec.omitZero,
partial = partial,
wantMixture = spec.wantMixture,
}
local date1, date2 = getDates(frame, getopt)
if type(date1) == 'string' then
return date1
end
local format = stripToNil(args.format)
local spell = spellOptions[format]
if format then
format = 'format_' .. format
elseif name == 'age_days' and getopt.textdates then
format = 'format_commas'
end
local parms = {
diff = date2:subtract(date1, { fill = autofill }),
wantDuration = spec.duration or yes(args.duration),
range = range,
wantSc = yes(args.sc),
show = args.show == 'hide' and 'hide' or spec.show,
abbr = spec.abbr,
disp = spec.disp,
extra = makeExtra(args, getopt.usesCurrent and format ~= 'format_raw'),
format = format or spec.format,
round = yes(args.round),
sep = spec.sep,
sortable = translateParameters.sortable[args.sortable or spec.sortable],
spell = spell,
}
if (spec.negative or frame.args.negative) == 'error' and parms.diff.isnegative then
return message('mt-date-wrong-order')
end
return from_en(dateDifference(parms))
end
local function bda(frame)
-- Implement [[Template:Birth date and age]].
local args = frame:getParent().args
local options = {
missing1 = 'mt-need-valid-bd',
noMissing = true,
single = true,
}
local date = getDates(frame, options)
if type(date) == 'string' then
return date -- error text
end
local Date = getExports(frame)
local diff = Date('currentdate') - date
if diff.isnegative or diff.years > 150 then
return message('mt-invalid-bd-age')
end
local disp = mtext['txt-bda-disp']
local show = 'y'
if diff.years < 2 then
disp = 'disp_age'
if diff.years == 0 and diff.months == 0 then
show = 'd'
else
show = 'm'
end
end
local result = substituteParameters(
mtext['txt-bda'],
date:text('%-Y-%m-%d'),
from_en(date:text(dateFormat(args))),
from_en(dateDifference({
diff = diff,
show = show,
abbr = 'abbr_off',
disp = disp,
sep = 'sep_space',
}))
)
local warnings = tonumber(frame.args.warnings)
if warnings and warnings > 0 then
local good = {
df = true,
mf = true,
day = true,
day1 = true,
month = true,
month1 = true,
year = true,
year1 = true,
}
local invalid
local imax = options.textdates and 1 or 3
for k, _ in pairs(args) do
if type(k) == 'number' then
if k > imax then
invalid = tostring(k)
break
end
else
if not good[k] then
invalid = k
break
end
end
end
if invalid then
result = result .. message('mt-bad-param1', invalid)
end
end
return result
end
local function dda(frame)
-- Implement [[Template:Death date and age]].
local args = frame:getParent().args
local options = {
missing1 = 'mt-need-valid-dd',
missing2 = 'mt-need-valid-bd2',
noMissing = true,
partial = true,
}
local date1, date2 = getDates(frame, options)
if type(date1) == 'string' then
return date1
end
local diff = date1 - date2
if diff.isnegative then
return message('mt-dd-wrong-order')
end
local Date = getExports(frame)
local today = Date('currentdate') + 1 -- one day in future allows for timezones
if date1 > today then
return message('mt-dd-future')
end
local years
if diff.partial then
years = diff.partial.years
years = type(years) == 'table' and years[2] or years
else
years = diff.years
end
if years > 150 then
return message('mt-invalid-dates-age')
end
local fmt_date, fmt_ymd
if date1.day then -- y, m, d known
fmt_date = dateFormat(args)
fmt_ymd = '%-Y-%m-%d'
elseif date1.month then -- y, m known; d unknown
fmt_date = '%B %-Y'
fmt_ymd = '%-Y-%m-00'
else -- y known; m, d unknown
fmt_date = '%-Y'
fmt_ymd = '%-Y-00-00'
end
local sortKey
local sortable = translateParameters.sortable[args.sortable]
if sortable then
local value = (date1.partial and date1.partial.first or date1).jdz
sortKey = makeSort(value, sortable)
end
local result = (sortKey or '') .. substituteParameters(
mtext['txt-dda'],
date1:text(fmt_ymd),
from_en(date1:text(fmt_date)),
from_en(dateDifference({
diff = diff,
show = 'y',
abbr = 'abbr_off',
disp = mtext['txt-dda-disp'],
range = 'dash',
sep = 'sep_space',
}))
)
local warnings = tonumber(frame.args.warnings)
if warnings and warnings > 0 then
local good = {
df = true,
mf = true,
}
local invalid
local imax = options.textdates and 2 or 6
for k, _ in pairs(args) do
if type(k) == 'number' then
if k > imax then
invalid = tostring(k)
break
end
else
if not good[k] then
invalid = k
break
end
end
end
if invalid then
result = result .. message('mt-bad-param1', invalid)
end
end
return result
end
local function dateToGsd(frame)
-- Implement [[Template:Gregorian serial date]].
-- Return Gregorian serial date of the given date, or the current date.
-- The returned value is negative for dates before 1 January 1 AD
-- despite the fact that GSD is not defined for such dates.
local date = getDates(frame, { wantMixture=true, single=true })
if type(date) == 'string' then
return date
end
return tostring(date.gsd)
end
local function jdToDate(frame)
-- Return formatted date from a Julian date.
-- The result includes a time if the input includes a fraction.
-- The word 'Julian' is accepted for the Julian calendar.
local Date = getExports(frame)
local args = frame:getParent().args
local date = Date('juliandate', args[1], args[2])
if date then
return from_en(date:text())
end
return message('mt-need-jdn')
end
local function dateToJd(frame)
-- Return Julian date (a number) from a date which may include a time,
-- or the current date ('currentdate') or current date and time ('currentdatetime').
-- The word 'Julian' is accepted for the Julian calendar.
local Date = getExports(frame)
local args = frame:getParent().args
local date = Date(args[1], args[2], args[3], args[4], args[5], args[6], args[7])
if date then
return tostring(date.jd)
end
return message('mt-need-valid-ymd-current')
end
local function timeInterval(frame)
-- Implement [[Template:Time interval]].
-- There are two positional arguments: date1, date2.
-- The default for each is the current date and time.
-- Result is date2 - date1 formatted.
local Date = getExports(frame)
local args = frame:getParent().args
local parms = {
extra = makeExtra(args),
wantDuration = yes(args.duration),
range = yes(args.range) or (args.range == 'dash' and 'dash' or nil),
wantSc = yes(args.sc),
}
local fix = yes(args.fix) and 'fix' or ''
local date1 = Date(fix, 'partial', stripToNil(args[1]) or 'currentdatetime')
if not date1 then
return message('mt-invalid-start')
end
local date2 = Date(fix, 'partial', stripToNil(args[2]) or 'currentdatetime')
if not date2 then
return message('mt-invalid-end')
end
parms.diff = date2 - date1
for argname, translate in pairs(translateParameters) do
local parm = stripToNil(args[argname])
if parm then
parm = translate[parm]
if parm == nil then -- test for nil because false is a valid setting
return message('mt-bad-param2', argname, args[argname])
end
parms[argname] = parm
end
end
if parms.round then
local round = parms.round
local show = parms.show
if round ~= 'on' then
if show then
if show.id ~= round then
return message('mt-conflicting-show', args.show, args.round)
end
else
parms.show = translateParameters.show[round]
end
end
parms.round = true
end
return from_en(dateDifference(parms))
end
return {
age_generic = ageGeneric, -- can emulate several age templates
birth_date_and_age = bda, -- Template:Birth_date_and_age
death_date_and_age = dda, -- Template:Death_date_and_age
gsd = dateToGsd, -- Template:Gregorian_serial_date
extract = dateExtract, -- Template:Extract
jd_to_date = jdToDate, -- Template:?
JULIANDAY = dateToJd, -- Template:JULIANDAY
time_interval = timeInterval, -- Template:Time_interval
}
094ef43a81ac2366c838b6ad889ed0ffe5a1eec4
Template:Infobox Twitch streamer
10
158
324
2023-06-14T05:03:02Z
wikipedia>Prefall
0
Reverted [[WP:AGF|good faith]] edits by [[Special:Contributions/Hgraesdgaeg21|Hgraesdgaeg21]] ([[User talk:Hgraesdgaeg21|talk]]): Undiscussed changes. Platform name consistent with similar templates, like [[Template:Infobox YouTube personality]]. If you want a more generalized streamer infobox (or one for another platform), a new template may be necessary.
wikitext
text/x-wiki
{{Infobox
| child = {{Yesno|{{{subbox|{{{embed|}}}}}}}}
| templatestyles = Template:Infobox Twitch streamer/styles.css
| bodyclass = ib-twitch biography vcard
| title = {{#if:{{Yesno|{{{subbox|{{{embed|}}}}}}}}|<div {{#if:{{Yesno|{{{subbox|}}}}}|class="ib-twitch-title"}}>'''Twitch information'''</div>}}
| aboveclass = ib-twitch-above
| above = {{#if:{{Yesno|{{{subbox|{{{embed|}}}}}}}}||{{br separated entries
|1={{#if:{{{honorific prefix|{{{honorific_prefix|}}}}}}|<span class="honorific-prefix">{{{honorific prefix|{{{honorific_prefix|}}}}}}</span>}}
|2=<span class="fn">{{{name|{{PAGENAMEBASE}}}}}</span>
|3={{#if:{{{honorific suffix|{{{honorific_suffix|}}}}}}|<span class="honorific-suffix">{{{honorific suffix|{{{honorific_suffix|}}}}}}</span>}}
}}
}}
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{logo|}}}|size={{{logo_size|}}}|sizedefault=250px|alt={{{logo_alt|}}}}}
| caption = {{{logo caption|{{{logo_caption|}}}}}}
| image2 = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image size|{{{image_size|{{{imagesize|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|{{{upright|1}}}}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
| caption2 = {{{image caption|{{{caption|{{{image_caption|}}}}}}}}}
| headerclass = ib-twitch-header
| header1 = {{#if:{{{birth_name|}}}{{{birth_date|}}}{{{birth_place|}}}{{{death_date|}}}{{{death_place|}}}{{{nationality|}}}{{{occupation|{{{occupations|}}}}}}|Personal information}}
| label2 = Born
| data2 = {{br separated entries|1={{#if:{{{birth_name|}}}|<div class="nickname">{{{birth_name}}}</div>}}|2={{{birth_date|}}}|3={{#if:{{{birth_place|}}}|<div class="birthplace">{{{birth_place}}}</div>}}}}
| label3 = Died
| data3 = {{br separated entries|1={{{death_date|}}}|2={{#if:{{{death_place|}}}|<div class="deathplace">{{{death_place}}}</div>}}}}
| label4 = Origin
| data4 = {{{origin|}}}
| label5 = Nationality
| data5 = {{{nationality|}}}
| class5 = category
| label6 = Other names
| data6 = {{{other_names|}}}
| class6 = nickname
| label7 = Education
| data7 = {{{education|}}}
| label8 = Occupation{{#if:{{{occupations|}}}|s|{{Pluralize from text|{{{occupation|}}}|likely=(s)|plural=s}}}}
| data8 = {{{occupation|{{{occupations|}}}}}}
| class8 = role
| label9 = Spouse{{#if:{{{spouses|}}}|s|{{Pluralize from text|{{{spouse|}}}|likely=(s)|plural=s}}}}
| data9 = {{{spouse|{{{spouses|}}}}}}
| label10 = Partner{{#if:{{{partners|}}}|s|{{Pluralize from text|{{{partner|}}}|likely=(s)|plural=s}}}}
| data10 = {{{partner|{{{partners|}}}}}}
| label11 = Children
| data11 = {{{children|}}}
| label12 = Parent{{if either|{{{parents|}}}|{{if both|{{{mother|}}}|{{{father|}}}|true}}|s|{{Pluralize from text|{{{parent|}}}|likely=(s)|plural=s}}}}
| data12 = {{#if:{{{parent|{{{parents|}}}}}}|{{{parent|{{{parents}}}}}}|{{Unbulleted list|{{#if:{{{father|}}}|{{{father}}} (father)}}|{{#if:{{{mother|}}}|{{{mother}}} (mother)}}}}}}
| label13 = Relatives
| data13 = {{{relatives|}}}
| label14 = Organi{{#if:{{{organisation|{{{organisations|}}}}}}|s|z}}ation{{#if:{{{organizations|{{{organisations|}}}}}}|s|{{pluralize from text|{{{organization|{{{organisation|{{{teams|}}}}}}}}}|likely=(s)|plural=s}}}}
| data14 = {{{organization|{{{organisation|{{{organizations|{{{organisations|{{{teams|}}}}}}}}}}}}}}}
| class14 = org
| label15 = Signature
| data15 = {{#if:{{{signature|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{signature|}}}|size={{{signature_size|}}}|sizedefault=150px|alt={{{signature alt|{{{signature_alt|}}}}}}}} }}
| label16 = Website
| data16 = {{{website|{{{homepage|{{{URL|}}}}}}}}}
| data17 = {{{module_personal|}}}
| header20 = {{#if:{{Yesno|{{{subbox|{{{embed|}}}}}}}}||{{#if:{{{pseudonym|}}}{{{channel_name|{{{channel_url|}}}}}}{{{channels|}}}{{{years active|{{{years_active|{{{yearsactive|}}}}}}}}}{{{genre|{{{genres|}}}}}}{{{game|{{{games|}}}}}}{{{followers|}}}|Twitch information}}}}
| label21 = {{Nowrap|Also known as}}
| data21 = {{{pseudonym|}}}
| class21 = nickname
| label22 = Channel{{#if:{{{channels|}}}{{{channel_name2|{{{channel_url2|}}}}}}|s}}
| data22 = {{#if:{{{channel_name|{{{channel_url|}}}}}}|{{flatlist|
* [https://www.twitch.tv/{{{channel_name|{{{channel_url|}}}}}} {{if empty|{{{channel_display_name|}}}|{{{channel_name|{{{channel_url}}}}}}}}]{{#if:{{{channel_name2|{{{channel_url2|}}}}}}|
* [https://www.twitch.tv/{{{channel_name2|{{{channel_url2}}}}}} {{if empty|{{{channel_display_name2|}}}|{{{channel_name2|{{{channel_url2}}}}}}}}]{{#if:{{{channel_name3|{{{channel_url3|}}}}}}|
* [https://www.twitch.tv/{{{channel_name3|{{{channel_url3}}}}}} {{if empty|{{{channel_display_name3|}}}|{{{channel_name3|{{{channel_url3}}}}}}}}]}} }} }}|{{{channels|}}} }}
| label23 = Created by
| data23 = {{{creator|{{{creators|{{{created_by|}}}}}}}}}
| label24 = Presented by
| data24 = {{{presenter|{{{presenters|{{{presented_by|}}}}}}}}}
| label25 = Location
| data25 = {{{location|}}}
| label26 = Years active
| data26 = {{{years active|{{{years_active|{{{yearsactive|}}}}}}}}}
| label27 = Genre{{#if:{{{genres|}}}|s|{{Pluralize from text|{{{genre|}}}|likely=(s)|plural=s}}}}
| data27 = {{{genre|{{{genres|}}}}}}
| label28 = Game{{#if:{{{games|}}}|s|{{Pluralize from text|{{{game|}}}|likely=(s)|plural=s}}}}
| data28 = {{{game|{{{games|}}}}}}
| label29 = Followers
| data29 = {{br separated entries|1={{{followers|}}}|2={{#if:{{{follower_date|}}}|({{{follower_date}}})}}}}
| label30 = Contents are in
| data30 = {{{language|}}}
| label31 = Associated acts
| data31 = {{{associated_acts|}}}
| label32 = Website
| data32 = {{{channel_website|}}}
| data50 = {{{module|{{{module1|}}}}}}
| data51 = {{{module2|}}}
| belowclass = ib-twitch-below
| below = {{#if:{{{stats_update|}}}|<hr>''Last updated:'' {{{stats_update}}}}}{{#if:{{{extra_information|}}}|{{hr}}{{{extra_information}}}}}
}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox Twitch streamer with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox Twitch streamer]] with unknown parameter "_VALUE_"|ignoreblank=y| alt | associated_acts | birth_date | birth_name | birth_place | caption | channel_name | channel_name2 | channel_name3 | channel_url | channel_url2 | channel_url3 | channel_display_name | channel_display_name2 | channel_display_name3 | channel_website | channels | children | created_by | creator | creators | death_date | death_place | education | embed | extra_information | father | follower_date | followers | game | games | genre | genres | homepage | honorific prefix | honorific suffix | honorific_prefix | honorific_suffix | image | image caption | image size | image_caption | image_size | image_upright | imagesize | language | location | logo | logo caption | logo_caption | logo_alt | logo_size | module | module_personal | module1 | module2 | mother | name | nationality | occupation | occupations | organisation | organisations | organization | organizations | origin | other_names | parent | parents | partner | partners | presented_by | presenter | presenters | pseudonym | subbox | signature | signature alt | signature_alt | signature_size | spouse | spouses | relatives | stats_update | teams | upright | URL | website | years active | years_active | yearsactive }}<noinclude>{{documentation}}</noinclude>
e269d60e41be2b6e1abd76da00d3b204c4645eba
Template:Tick
10
97
197
2023-06-27T05:39:15Z
wikipedia>Jonesey95
0
Fix [[Special:LintErrors|Linter]] errors. (bogus image options). strip trailing "px" off size parameter if present
wikitext
text/x-wiki
[[{{ safesubst:<noinclude/>#switch:{{ safesubst:<noinclude/>lc:{{{color|{{{colour|}}}}}} }}
|green |grn |gn =File:Yes check.svg
|lightgreen |lgreen |lgrn |lgn =File:Light green check.svg
|red |rd |r =File:Red check.svg
|darkred |dkred |drd |dr =File:Check-188-25-49-red.svg
|pink |pnk |pk =File:Pink check.svg
|orange |or |o =File:Check.svg
|yellow |yel |y =File:Yellow check.svg
|black |blk |k =File:Black check.svg
|blue |blu |u =File:Check-blue.svg
|lightblue |lblue |lblu |lb =File:Cornflower blue check.svg
|cyan |cy |c =File:B-check.svg
|purple |pur |pu =File:Purple check.svg
|grey |gray |gry |gy =File:SemiTransBlack v.svg
|brown |brn |bn =File:Brown check.svg
<!--default--> |File:Yes check.svg
}}|{{ safesubst:<noinclude/>#if:{{{1|}}}|{{Str number/trim|{{{1}}}}}|20}}px|link=|alt={{#if:{{{alt|}}}|{{{alt}}}|check}}]]<span style="display:none">Y</span><!--template:tick--><noinclude>
{{documentation}}
</noinclude>
2a5da56c38689fc7e1a8ccfd7a51892df49d6253
Module:Check for unknown parameters/doc
828
180
377
2023-07-09T21:17:30Z
wikipedia>Grufo
0
wikitext
text/x-wiki
{{Used in system|in [[MediaWiki:Abusefilter-warning-DS]]}}
{{Module rating|p}}
{{Lua|Module:If preview|noprotcat=yes}}
This module may be appended to a template to check for uses of unknown parameters. Unlike many other modules, this module is ''not'' implemented by a template.
== Usage ==
=== Basic usage ===
<syntaxhighlight lang="wikitext">
{{#invoke:Check for unknown parameters|check
|unknown=[[Category:Some tracking category]]
|arg1|arg2|arg3|argN}}
</syntaxhighlight>
or to sort the entries in the tracking category by parameter with a preview error message
<syntaxhighlight lang="wikitext">
{{#invoke:Check for unknown parameters|check
|unknown=[[Category:Some tracking category|_VALUE_]]
|preview=unknown parameter "_VALUE_"
|arg1|arg2|...|argN}}
</syntaxhighlight>
or for an explicit red error message
<syntaxhighlight lang="wikitext">
{{#invoke:Check for unknown parameters|check
|unknown=<span class="error">Sorry, I don't recognize _VALUE_</span>
|arg1|arg2|...|argN}}
</syntaxhighlight>
Here, <code>arg1</code>, <code>arg2</code>, ..., <code>argN</code>, are the known parameters. Unnamed (positional) parameters can be added too: <code><nowiki>|1|2|argname1|argname2|...</nowiki></code>. Any parameter which is used, but not on this list, will cause the module to return whatever is passed with the <code>unknown</code> parameter. The <code>_VALUE_</code> keyword, if used, will be changed to the name of the parameter. This is useful for either sorting the entries in a tracking category, or for provide more explicit information.
By default, the module makes no distinction between a defined-but-blank parameter and a non-blank parameter. That is, both unlisted {{Para|foo|x}} and {{Para|foo}} are reported. To only track non-blank parameters use {{Para|ignoreblank|1}}.
By default, the module ignores blank positional parameters. That is, an unlisted {{Para|2}} is ignored. To ''include'' blank positional parameters in the tracking use {{Para|showblankpositional|1}}.
=== Lua patterns ===
This module supports [[:mw:Extension:Scribunto/Lua reference manual#Patterns|Lua patterns]] (similar to [[regular expression]]s), which are useful when there are many known parameters which use a systematic pattern. For example, <code>[[Module:Infobox3cols|Infobox3cols]]</code> uses
<syntaxhighlight lang="lua">
regexp1 = "header[%d]+",
regexp2 = "label[%d]+",
regexp3 = "data[%d]+[abc]?",
regexp4 = "class[%d]+[abc]?",
regexp5 = "rowclass[%d]+",
regexp6 = "rowstyle[%d]+",
regexp7 = "rowcellstyle[%d]+",
</syntaxhighlight>
to match all parameters of the form <code>headerNUM</code>, <code>labelNUM</code>, <code>dataNUM</code>, <code>dataNUMa</code>, <code>dataNUMb</code>, <code>dataNUMc</code>, ..., <code>rowcellstyleNUM</code>, where NUM is a string of digits.
== Example ==
<syntaxhighlight lang="wikitext">
{{Infobox
| above = {{{name|}}}
| label1 = Height
| data1 = {{{height|}}}
| label2 = Weight
| data2 = {{{weight|}}}
| label3 = Website
| data3 = {{{website|}}}
}}<!--
end infobox, start tracking
-->{{#invoke:Check for unknown parameters|check
| unknown = {{Main other|[[Category:Some tracking category|_VALUE_]]}}
| preview = unknown parameter "_VALUE_"
| name
| height | weight
| website
}}
</syntaxhighlight>
==Call from within Lua code==
See the end of [[Module:Rugby box]] for a simple example or [[Module:Infobox3cols]] or [[Module:Flag]] for more complicated examples.
==See also==
* {{Clc|Unknown parameters}} (category page can have header {{tl|Unknown parameters category}})
* [[Module:Params]] – for complex operations involving parameters
* [[Template:Checks for unknown parameters]] – adds documentation to templates using this module
* [[Module:Check for deprecated parameters]] – similar module that checks for deprecated parameters
* [[Module:Check for clobbered parameters]] – module that checks for conflicting parameters
* [[Module:TemplatePar]] – similar function (originally from dewiki)
* [[Template:Parameters]] and [[Module:Parameters]] – generates a list of parameter names for a given template
* [[Project:TemplateData]] based template parameter validation
* [[Module:Parameter validation]] checks a lot more
* [[User:Bamyers99/TemplateParametersTool]] - A tool for checking usage of template parameters
<includeonly>{{Sandbox other||
<!-- Categories go here and interwikis go in Wikidata. -->
[[Category:Modules that add a tracking category]]
}}</includeonly>
31dc4e2854c7bd27db7480bd6e8c65ae8e364ac2
Module:Parameter names example
828
152
312
2023-07-10T09:41:44Z
wikipedia>Gonnym
0
if these are wanted, they should be handled differently (by passing a parameter to this module) as these cause pages to appear as unknown parameters for templates that don't use them
Scribunto
text/plain
-- This module implements {{parameter names example}}.
local p = {}
local function makeParam(s)
local lb = '{'
local rb = '}'
return lb:rep(3) .. s .. rb:rep(3)
end
local function italicize(s)
return "''" .. s .. "''"
end
local function plain(s)
return s
end
function p._main(args, frame)
-- Find how we want to format the arguments to the template.
local formatFunc
if args._display == 'italics' or args._display == 'italic' then
formatFunc = italicize
elseif args._display == 'plain' then
formatFunc = plain
else
formatFunc = makeParam
end
-- Build the table of template arguments.
local targs = {}
for k, v in pairs(args) do
if type(k) == 'number' then
targs[v] = formatFunc(v)
elseif not k:find('^_') then
targs[k] = v
end
end
--targs['nocat'] = 'yes';
--targs['categories'] = 'no';
--targs['demo'] = 'yes';
-- Find the template name.
local template
if args._template then
template = args._template
else
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.prefixedText:find('/sandbox$') then
template = currentTitle.prefixedText
else
template = currentTitle.basePageTitle.prefixedText
end
end
-- Call the template with the arguments.
frame = frame or mw.getCurrentFrame()
local success, result = pcall(
frame.expandTemplate,
frame,
{title = template, args = targs}
)
if success then
return result
else
return ''
end
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Parameter names example'
})
return p._main(args, frame)
end
return p
fdf94fb7a5dc1fabf118d60488a02f1e65b0df24
Module:Wd
828
31
64
2023-07-10T18:06:15Z
wikipedia>Pppery
0
Per edit request
Scribunto
text/plain
-- Original module located at [[:en:Module:Wd]] and [[:en:Module:Wd/i18n]].
require("strict")
local p = {}
local arg = ...
local i18n
local function loadI18n(aliasesP, frame)
local title
if frame then
-- current module invoked by page/template, get its title from frame
title = frame:getTitle()
else
-- current module included by other module, get its title from ...
title = arg
end
if not i18n then
i18n = require(title .. "/i18n").init(aliasesP)
end
end
p.claimCommands = {
property = "property",
properties = "properties",
qualifier = "qualifier",
qualifiers = "qualifiers",
reference = "reference",
references = "references"
}
p.generalCommands = {
label = "label",
title = "title",
description = "description",
alias = "alias",
aliases = "aliases",
badge = "badge",
badges = "badges"
}
p.flags = {
linked = "linked",
short = "short",
raw = "raw",
multilanguage = "multilanguage",
unit = "unit",
-------------
preferred = "preferred",
normal = "normal",
deprecated = "deprecated",
best = "best",
future = "future",
current = "current",
former = "former",
edit = "edit",
editAtEnd = "edit@end",
mdy = "mdy",
single = "single",
sourced = "sourced"
}
p.args = {
eid = "eid",
page = "page",
date = "date"
}
local aliasesP = {
coord = "P625",
-----------------------
image = "P18",
author = "P50",
authorNameString = "P2093",
publisher = "P123",
importedFrom = "P143",
wikimediaImportURL = "P4656",
statedIn = "P248",
pages = "P304",
language = "P407",
hasPart = "P527",
publicationDate = "P577",
startTime = "P580",
endTime = "P582",
chapter = "P792",
retrieved = "P813",
referenceURL = "P854",
sectionVerseOrParagraph = "P958",
archiveURL = "P1065",
title = "P1476",
formatterURL = "P1630",
quote = "P1683",
shortName = "P1813",
definingFormula = "P2534",
archiveDate = "P2960",
inferredFrom = "P3452",
typeOfReference = "P3865",
column = "P3903",
subjectNamedAs = "P1810",
wikidataProperty = "P1687",
publishedIn = "P1433"
}
local aliasesQ = {
percentage = "Q11229",
prolepticJulianCalendar = "Q1985786",
citeWeb = "Q5637226",
citeQ = "Q22321052"
}
local parameters = {
property = "%p",
qualifier = "%q",
reference = "%r",
alias = "%a",
badge = "%b",
separator = "%s",
general = "%x"
}
local formats = {
property = "%p[%s][%r]",
qualifier = "%q[%s][%r]",
reference = "%r",
propertyWithQualifier = "%p[ <span style=\"font-size:85\\%\">(%q)</span>][%s][%r]",
alias = "%a[%s]",
badge = "%b[%s]"
}
local hookNames = { -- {level_1, level_2}
[parameters.property] = {"getProperty"},
[parameters.reference] = {"getReferences", "getReference"},
[parameters.qualifier] = {"getAllQualifiers"},
[parameters.qualifier.."\\d"] = {"getQualifiers", "getQualifier"},
[parameters.alias] = {"getAlias"},
[parameters.badge] = {"getBadge"}
}
-- default value objects, should NOT be mutated but instead copied
local defaultSeparators = {
["sep"] = {" "},
["sep%s"] = {","},
["sep%q"] = {"; "},
["sep%q\\d"] = {", "},
["sep%r"] = nil, -- none
["punc"] = nil -- none
}
local rankTable = {
["preferred"] = 1,
["normal"] = 2,
["deprecated"] = 3
}
local function replaceAlias(id)
if aliasesP[id] then
id = aliasesP[id]
end
return id
end
local function errorText(code, param)
local text = i18n["errors"][code]
if param then text = mw.ustring.gsub(text, "$1", param) end
return text
end
local function throwError(errorMessage, param)
error(errorText(errorMessage, param))
end
local function replaceDecimalMark(num)
return mw.ustring.gsub(num, "[.]", i18n['numeric']['decimal-mark'], 1)
end
local function padZeros(num, numDigits)
local numZeros
local negative = false
if num < 0 then
negative = true
num = num * -1
end
num = tostring(num)
numZeros = numDigits - num:len()
for _ = 1, numZeros do
num = "0"..num
end
if negative then
num = "-"..num
end
return num
end
local function replaceSpecialChar(chr)
if chr == '_' then
-- replace underscores with spaces
return ' '
else
return chr
end
end
local function replaceSpecialChars(str)
local chr
local esc = false
local strOut = ""
for i = 1, #str do
chr = str:sub(i,i)
if not esc then
if chr == '\\' then
esc = true
else
strOut = strOut .. replaceSpecialChar(chr)
end
else
strOut = strOut .. chr
esc = false
end
end
return strOut
end
local function buildWikilink(target, label)
if not label or target == label then
return "[[" .. target .. "]]"
else
return "[[" .. target .. "|" .. label .. "]]"
end
end
-- used to make frame.args mutable, to replace #frame.args (which is always 0)
-- with the actual amount and to simply copy tables
local function copyTable(tIn)
if not tIn then
return nil
end
local tOut = {}
for i, v in pairs(tIn) do
tOut[i] = v
end
return tOut
end
-- used to merge output arrays together;
-- note that it currently mutates the first input array
local function mergeArrays(a1, a2)
for i = 1, #a2 do
a1[#a1 + 1] = a2[i]
end
return a1
end
local function split(str, del)
local out = {}
local i, j = str:find(del)
if i and j then
out[1] = str:sub(1, i - 1)
out[2] = str:sub(j + 1)
else
out[1] = str
end
return out
end
local function parseWikidataURL(url)
local id
if url:match('^http[s]?://') then
id = split(url, "Q")
if id[2] then
return "Q" .. id[2]
end
end
return nil
end
local function parseDate(dateStr, precision)
precision = precision or "d"
local i, j, index, ptr
local parts = {nil, nil, nil}
if dateStr == nil then
return parts[1], parts[2], parts[3] -- year, month, day
end
-- 'T' for snak values, '/' for outputs with '/Julian' attached
i, j = dateStr:find("[T/]")
if i then
dateStr = dateStr:sub(1, i-1)
end
local from = 1
if dateStr:sub(1,1) == "-" then
-- this is a negative number, look further ahead
from = 2
end
index = 1
ptr = 1
i, j = dateStr:find("-", from)
if i then
-- year
parts[index] = tonumber(dateStr:sub(ptr, i-1), 10) -- explicitly give base 10 to prevent error
if parts[index] == -0 then
parts[index] = tonumber("0") -- for some reason, 'parts[index] = 0' may actually store '-0', so parse from string instead
end
if precision == "y" then
-- we're done
return parts[1], parts[2], parts[3] -- year, month, day
end
index = index + 1
ptr = i + 1
i, j = dateStr:find("-", ptr)
if i then
-- month
parts[index] = tonumber(dateStr:sub(ptr, i-1), 10)
if precision == "m" then
-- we're done
return parts[1], parts[2], parts[3] -- year, month, day
end
index = index + 1
ptr = i + 1
end
end
if dateStr:sub(ptr) ~= "" then
-- day if we have month, month if we have year, or year
parts[index] = tonumber(dateStr:sub(ptr), 10)
end
return parts[1], parts[2], parts[3] -- year, month, day
end
local function datePrecedesDate(aY, aM, aD, bY, bM, bD)
if aY == nil or bY == nil then
return nil
end
aM = aM or 1
aD = aD or 1
bM = bM or 1
bD = bD or 1
if aY < bY then
return true
end
if aY > bY then
return false
end
if aM < bM then
return true
end
if aM > bM then
return false
end
if aD < bD then
return true
end
return false
end
local function getHookName(param, index)
if hookNames[param] then
return hookNames[param][index]
elseif param:len() > 2 then
return hookNames[param:sub(1, 2).."\\d"][index]
else
return nil
end
end
local function alwaysTrue()
return true
end
-- The following function parses a format string.
--
-- The example below shows how a parsed string is structured in memory.
-- Variables other than 'str' and 'child' are left out for clarity's sake.
--
-- Example:
-- "A %p B [%s[%q1]] C [%r] D"
--
-- Structure:
-- [
-- {
-- str = "A "
-- },
-- {
-- str = "%p"
-- },
-- {
-- str = " B ",
-- child =
-- [
-- {
-- str = "%s",
-- child =
-- [
-- {
-- str = "%q1"
-- }
-- ]
-- }
-- ]
-- },
-- {
-- str = " C ",
-- child =
-- [
-- {
-- str = "%r"
-- }
-- ]
-- },
-- {
-- str = " D"
-- }
-- ]
--
local function parseFormat(str)
local chr, esc, param, root, cur, prev, new
local params = {}
local function newObject(array)
local obj = {} -- new object
obj.str = ""
array[#array + 1] = obj -- array{object}
obj.parent = array
return obj
end
local function endParam()
if param > 0 then
if cur.str ~= "" then
cur.str = "%"..cur.str
cur.param = true
params[cur.str] = true
cur.parent.req[cur.str] = true
prev = cur
cur = newObject(cur.parent)
end
param = 0
end
end
root = {} -- array
root.req = {}
cur = newObject(root)
prev = nil
esc = false
param = 0
for i = 1, #str do
chr = str:sub(i,i)
if not esc then
if chr == '\\' then
endParam()
esc = true
elseif chr == '%' then
endParam()
if cur.str ~= "" then
cur = newObject(cur.parent)
end
param = 2
elseif chr == '[' then
endParam()
if prev and cur.str == "" then
table.remove(cur.parent)
cur = prev
end
cur.child = {} -- new array
cur.child.req = {}
cur.child.parent = cur
cur = newObject(cur.child)
elseif chr == ']' then
endParam()
if cur.parent.parent then
new = newObject(cur.parent.parent.parent)
if cur.str == "" then
table.remove(cur.parent)
end
cur = new
end
else
if param > 1 then
param = param - 1
elseif param == 1 then
if not chr:match('%d') then
endParam()
end
end
cur.str = cur.str .. replaceSpecialChar(chr)
end
else
cur.str = cur.str .. chr
esc = false
end
prev = nil
end
endParam()
-- make sure that at least one required parameter has been defined
if not next(root.req) then
throwError("missing-required-parameter")
end
-- make sure that the separator parameter "%s" is not amongst the required parameters
if root.req[parameters.separator] then
throwError("extra-required-parameter", parameters.separator)
end
return root, params
end
local function sortOnRank(claims)
local rankPos
local ranks = {{}, {}, {}, {}} -- preferred, normal, deprecated, (default)
local sorted = {}
for _, v in ipairs(claims) do
rankPos = rankTable[v.rank] or 4
ranks[rankPos][#ranks[rankPos] + 1] = v
end
sorted = ranks[1]
sorted = mergeArrays(sorted, ranks[2])
sorted = mergeArrays(sorted, ranks[3])
return sorted
end
local Config = {}
-- allows for recursive calls
function Config:new()
local cfg = {}
setmetatable(cfg, self)
self.__index = self
cfg.separators = {
-- single value objects wrapped in arrays so that we can pass by reference
["sep"] = {copyTable(defaultSeparators["sep"])},
["sep%s"] = {copyTable(defaultSeparators["sep%s"])},
["sep%q"] = {copyTable(defaultSeparators["sep%q"])},
["sep%r"] = {copyTable(defaultSeparators["sep%r"])},
["punc"] = {copyTable(defaultSeparators["punc"])}
}
cfg.entity = nil
cfg.entityID = nil
cfg.propertyID = nil
cfg.propertyValue = nil
cfg.qualifierIDs = {}
cfg.qualifierIDsAndValues = {}
cfg.bestRank = true
cfg.ranks = {true, true, false} -- preferred = true, normal = true, deprecated = false
cfg.foundRank = #cfg.ranks
cfg.flagBest = false
cfg.flagRank = false
cfg.periods = {true, true, true} -- future = true, current = true, former = true
cfg.flagPeriod = false
cfg.atDate = {parseDate(os.date('!%Y-%m-%d'))} -- today as {year, month, day}
cfg.mdyDate = false
cfg.singleClaim = false
cfg.sourcedOnly = false
cfg.editable = false
cfg.editAtEnd = false
cfg.inSitelinks = false
cfg.langCode = mw.language.getContentLanguage().code
cfg.langName = mw.language.fetchLanguageName(cfg.langCode, cfg.langCode)
cfg.langObj = mw.language.new(cfg.langCode)
cfg.siteID = mw.wikibase.getGlobalSiteId()
cfg.states = {}
cfg.states.qualifiersCount = 0
cfg.curState = nil
cfg.prefetchedRefs = nil
return cfg
end
local State = {}
function State:new(cfg, type)
local stt = {}
setmetatable(stt, self)
self.__index = self
stt.conf = cfg
stt.type = type
stt.results = {}
stt.parsedFormat = {}
stt.separator = {}
stt.movSeparator = {}
stt.puncMark = {}
stt.linked = false
stt.rawValue = false
stt.shortName = false
stt.anyLanguage = false
stt.unitOnly = false
stt.singleValue = false
return stt
end
-- if id == nil then item connected to current page is used
function Config:getLabel(id, raw, link, short)
local label = nil
local prefix, title= "", nil
if not id then
id = mw.wikibase.getEntityIdForCurrentPage()
if not id then
return ""
end
end
id = id:upper() -- just to be sure
if raw then
-- check if given id actually exists
if mw.wikibase.isValidEntityId(id) and mw.wikibase.entityExists(id) then
label = id
end
prefix, title = "d:Special:EntityPage/", label -- may be nil
else
-- try short name first if requested
if short then
label = p._property{aliasesP.shortName, [p.args.eid] = id} -- get short name
if label == "" then
label = nil
end
end
-- get label
if not label then
label = mw.wikibase.getLabelByLang(id, self.langCode) -- XXX: should use fallback labels?
end
end
if not label then
label = ""
elseif link then
-- build a link if requested
if not title then
if id:sub(1,1) == "Q" then
title = mw.wikibase.getSitelink(id)
elseif id:sub(1,1) == "P" then
-- properties have no sitelink, link to Wikidata instead
prefix, title = "d:Special:EntityPage/", id
end
end
label = mw.text.nowiki(label) -- escape raw label text so it cannot be wikitext markup
if title then
label = buildWikilink(prefix .. title, label)
end
end
return label
end
function Config:getEditIcon()
local value = ""
local prefix = ""
local front = " "
local back = ""
if self.entityID:sub(1,1) == "P" then
prefix = "Property:"
end
if self.editAtEnd then
front = '<span style="float:'
if self.langObj:isRTL() then
front = front .. 'left'
else
front = front .. 'right'
end
front = front .. '">'
back = '</span>'
end
value = "[[File:OOjs UI icon edit-ltr-progressive.svg|frameless|text-top|10px|alt=" .. i18n['info']['edit-on-wikidata'] .. "|link=https://www.wikidata.org/wiki/" .. prefix .. self.entityID .. "?uselang=" .. self.langCode
if self.propertyID then
value = value .. "#" .. self.propertyID
elseif self.inSitelinks then
value = value .. "#sitelinks-wikipedia"
end
value = value .. "|" .. i18n['info']['edit-on-wikidata'] .. "]]"
return front .. value .. back
end
-- used to create the final output string when it's all done, so that for references the
-- function extensionTag("ref", ...) is only called when they really ended up in the final output
function Config:concatValues(valuesArray)
local outString = ""
local j, skip
for i = 1, #valuesArray do
-- check if this is a reference
if valuesArray[i].refHash then
j = i - 1
skip = false
-- skip this reference if it is part of a continuous row of references that already contains the exact same reference
while valuesArray[j] and valuesArray[j].refHash do
if valuesArray[i].refHash == valuesArray[j].refHash then
skip = true
break
end
j = j - 1
end
if not skip then
-- add <ref> tag with the reference's hash as its name (to deduplicate references)
outString = outString .. mw.getCurrentFrame():extensionTag("ref", valuesArray[i][1], {name = valuesArray[i].refHash})
end
else
outString = outString .. valuesArray[i][1]
end
end
return outString
end
function Config:convertUnit(unit, raw, link, short, unitOnly)
local space = " "
local label = ""
local itemID
if unit == "" or unit == "1" then
return nil
end
if unitOnly then
space = ""
end
itemID = parseWikidataURL(unit)
if itemID then
if itemID == aliasesQ.percentage then
return "%"
else
label = self:getLabel(itemID, raw, link, short)
if label ~= "" then
return space .. label
end
end
end
return ""
end
function State:getValue(snak)
return self.conf:getValue(snak, self.rawValue, self.linked, self.shortName, self.anyLanguage, self.unitOnly, false, self.type:sub(1,2))
end
function Config:getValue(snak, raw, link, short, anyLang, unitOnly, noSpecial, type)
if snak.snaktype == 'value' then
local datatype = snak.datavalue.type
local subtype = snak.datatype
local datavalue = snak.datavalue.value
if datatype == 'string' then
if subtype == 'url' and link then
-- create link explicitly
if raw then
-- will render as a linked number like [1]
return "[" .. datavalue .. "]"
else
return "[" .. datavalue .. " " .. datavalue .. "]"
end
elseif subtype == 'commonsMedia' then
if link then
return buildWikilink("c:File:" .. datavalue, datavalue)
elseif not raw then
return "[[File:" .. datavalue .. "]]"
else
return datavalue
end
elseif subtype == 'geo-shape' and link then
return buildWikilink("c:" .. datavalue, datavalue)
elseif subtype == 'math' and not raw then
local attribute = nil
if (type == parameters.property or (type == parameters.qualifier and self.propertyID == aliasesP.hasPart)) and snak.property == aliasesP.definingFormula then
attribute = {qid = self.entityID}
end
return mw.getCurrentFrame():extensionTag("math", datavalue, attribute)
elseif subtype == 'external-id' and link then
local url = p._property{aliasesP.formatterURL, [p.args.eid] = snak.property} -- get formatter URL
if url ~= "" then
url = mw.ustring.gsub(url, "$1", datavalue)
return "[" .. url .. " " .. datavalue .. "]"
else
return datavalue
end
else
return datavalue
end
elseif datatype == 'monolingualtext' then
if anyLang or datavalue['language'] == self.langCode then
return datavalue['text']
else
return nil
end
elseif datatype == 'quantity' then
local value = ""
local unit
if not unitOnly then
-- get value and strip + signs from front
value = mw.ustring.gsub(datavalue['amount'], "^%+(.+)$", "%1")
if raw then
return value
end
-- replace decimal mark based on locale
value = replaceDecimalMark(value)
-- add delimiters for readability
value = i18n.addDelimiters(value)
end
unit = self:convertUnit(datavalue['unit'], raw, link, short, unitOnly)
if unit then
value = value .. unit
end
return value
elseif datatype == 'time' then
local y, m, d, p, yDiv, yRound, yFull, value, calendarID, dateStr
local yFactor = 1
local sign = 1
local prefix = ""
local suffix = ""
local mayAddCalendar = false
local calendar = ""
local precision = datavalue['precision']
if precision == 11 then
p = "d"
elseif precision == 10 then
p = "m"
else
p = "y"
yFactor = 10^(9-precision)
end
y, m, d = parseDate(datavalue['time'], p)
if y < 0 then
sign = -1
y = y * sign
end
-- if precision is tens/hundreds/thousands/millions/billions of years
if precision <= 8 then
yDiv = y / yFactor
-- if precision is tens/hundreds/thousands of years
if precision >= 6 then
mayAddCalendar = true
if precision <= 7 then
-- round centuries/millenniums up (e.g. 20th century or 3rd millennium)
yRound = math.ceil(yDiv)
if not raw then
if precision == 6 then
suffix = i18n['datetime']['suffixes']['millennium']
else
suffix = i18n['datetime']['suffixes']['century']
end
suffix = i18n.getOrdinalSuffix(yRound) .. suffix
else
-- if not verbose, take the first year of the century/millennium
-- (e.g. 1901 for 20th century or 2001 for 3rd millennium)
yRound = (yRound - 1) * yFactor + 1
end
else
-- precision == 8
-- round decades down (e.g. 2010s)
yRound = math.floor(yDiv) * yFactor
if not raw then
prefix = i18n['datetime']['prefixes']['decade-period']
suffix = i18n['datetime']['suffixes']['decade-period']
end
end
if raw and sign < 0 then
-- if BCE then compensate for "counting backwards"
-- (e.g. -2019 for 2010s BCE, -2000 for 20th century BCE or -3000 for 3rd millennium BCE)
yRound = yRound + yFactor - 1
end
else
local yReFactor, yReDiv, yReRound
-- round to nearest for tens of thousands of years or more
yRound = math.floor(yDiv + 0.5)
if yRound == 0 then
if precision <= 2 and y ~= 0 then
yReFactor = 1e6
yReDiv = y / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to millions of years only if we have a whole number of them
precision = 3
yFactor = yReFactor
yRound = yReRound
end
end
if yRound == 0 then
-- otherwise, take the unrounded (original) number of years
precision = 5
yFactor = 1
yRound = y
mayAddCalendar = true
end
end
if precision >= 1 and y ~= 0 then
yFull = yRound * yFactor
yReFactor = 1e9
yReDiv = yFull / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to billions of years if we're in that range
precision = 0
yFactor = yReFactor
yRound = yReRound
else
yReFactor = 1e6
yReDiv = yFull / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to millions of years if we're in that range
precision = 3
yFactor = yReFactor
yRound = yReRound
end
end
end
if not raw then
if precision == 3 then
suffix = i18n['datetime']['suffixes']['million-years']
elseif precision == 0 then
suffix = i18n['datetime']['suffixes']['billion-years']
else
yRound = yRound * yFactor
if yRound == 1 then
suffix = i18n['datetime']['suffixes']['year']
else
suffix = i18n['datetime']['suffixes']['years']
end
end
else
yRound = yRound * yFactor
end
end
else
yRound = y
mayAddCalendar = true
end
if mayAddCalendar then
calendarID = parseWikidataURL(datavalue['calendarmodel'])
if calendarID and calendarID == aliasesQ.prolepticJulianCalendar then
if not raw then
if link then
calendar = " ("..buildWikilink(i18n['datetime']['julian-calendar'], i18n['datetime']['julian'])..")"
else
calendar = " ("..i18n['datetime']['julian']..")"
end
else
calendar = "/"..i18n['datetime']['julian']
end
end
end
if not raw then
local ce = nil
if sign < 0 then
ce = i18n['datetime']['BCE']
elseif precision <= 5 then
ce = i18n['datetime']['CE']
end
if ce then
if link then
ce = buildWikilink(i18n['datetime']['common-era'], ce)
end
suffix = suffix .. " " .. ce
end
value = tostring(yRound)
if m then
dateStr = self.langObj:formatDate("F", "1-"..m.."-1")
if d then
if self.mdyDate then
dateStr = dateStr .. " " .. d .. ","
else
dateStr = d .. " " .. dateStr
end
end
value = dateStr .. " " .. value
end
value = prefix .. value .. suffix .. calendar
else
value = padZeros(yRound * sign, 4)
if m then
value = value .. "-" .. padZeros(m, 2)
if d then
value = value .. "-" .. padZeros(d, 2)
end
end
value = value .. calendar
end
return value
elseif datatype == 'globecoordinate' then
-- logic from https://github.com/DataValues/Geo (v4.0.1)
local precision, unitsPerDegree, numDigits, strFormat, value, globe
local latitude, latConv, latValue, latLink
local longitude, lonConv, lonValue, lonLink
local latDirection, latDirectionN, latDirectionS, latDirectionEN
local lonDirection, lonDirectionE, lonDirectionW, lonDirectionEN
local degSymbol, minSymbol, secSymbol, separator
local latDegrees = nil
local latMinutes = nil
local latSeconds = nil
local lonDegrees = nil
local lonMinutes = nil
local lonSeconds = nil
local latDegSym = ""
local latMinSym = ""
local latSecSym = ""
local lonDegSym = ""
local lonMinSym = ""
local lonSecSym = ""
local latDirectionEN_N = "N"
local latDirectionEN_S = "S"
local lonDirectionEN_E = "E"
local lonDirectionEN_W = "W"
if not raw then
latDirectionN = i18n['coord']['latitude-north']
latDirectionS = i18n['coord']['latitude-south']
lonDirectionE = i18n['coord']['longitude-east']
lonDirectionW = i18n['coord']['longitude-west']
degSymbol = i18n['coord']['degrees']
minSymbol = i18n['coord']['minutes']
secSymbol = i18n['coord']['seconds']
separator = i18n['coord']['separator']
else
latDirectionN = latDirectionEN_N
latDirectionS = latDirectionEN_S
lonDirectionE = lonDirectionEN_E
lonDirectionW = lonDirectionEN_W
degSymbol = "/"
minSymbol = "/"
secSymbol = "/"
separator = "/"
end
latitude = datavalue['latitude']
longitude = datavalue['longitude']
if latitude < 0 then
latDirection = latDirectionS
latDirectionEN = latDirectionEN_S
latitude = math.abs(latitude)
else
latDirection = latDirectionN
latDirectionEN = latDirectionEN_N
end
if longitude < 0 then
lonDirection = lonDirectionW
lonDirectionEN = lonDirectionEN_W
longitude = math.abs(longitude)
else
lonDirection = lonDirectionE
lonDirectionEN = lonDirectionEN_E
end
precision = datavalue['precision']
if not precision or precision <= 0 then
precision = 1 / 3600 -- precision not set (correctly), set to arcsecond
end
-- remove insignificant detail
latitude = math.floor(latitude / precision + 0.5) * precision
longitude = math.floor(longitude / precision + 0.5) * precision
if precision >= 1 - (1 / 60) and precision < 1 then
precision = 1
elseif precision >= (1 / 60) - (1 / 3600) and precision < (1 / 60) then
precision = 1 / 60
end
if precision >= 1 then
unitsPerDegree = 1
elseif precision >= (1 / 60) then
unitsPerDegree = 60
else
unitsPerDegree = 3600
end
numDigits = math.ceil(-math.log10(unitsPerDegree * precision))
if numDigits <= 0 then
numDigits = tonumber("0") -- for some reason, 'numDigits = 0' may actually store '-0', so parse from string instead
end
strFormat = "%." .. numDigits .. "f"
if precision >= 1 then
latDegrees = strFormat:format(latitude)
lonDegrees = strFormat:format(longitude)
if not raw then
latDegSym = replaceDecimalMark(latDegrees) .. degSymbol
lonDegSym = replaceDecimalMark(lonDegrees) .. degSymbol
else
latDegSym = latDegrees .. degSymbol
lonDegSym = lonDegrees .. degSymbol
end
else
latConv = math.floor(latitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits
lonConv = math.floor(longitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits
if precision >= (1 / 60) then
latMinutes = latConv
lonMinutes = lonConv
else
latSeconds = latConv
lonSeconds = lonConv
latMinutes = math.floor(latSeconds / 60)
lonMinutes = math.floor(lonSeconds / 60)
latSeconds = strFormat:format(latSeconds - (latMinutes * 60))
lonSeconds = strFormat:format(lonSeconds - (lonMinutes * 60))
if not raw then
latSecSym = replaceDecimalMark(latSeconds) .. secSymbol
lonSecSym = replaceDecimalMark(lonSeconds) .. secSymbol
else
latSecSym = latSeconds .. secSymbol
lonSecSym = lonSeconds .. secSymbol
end
end
latDegrees = math.floor(latMinutes / 60)
lonDegrees = math.floor(lonMinutes / 60)
latDegSym = latDegrees .. degSymbol
lonDegSym = lonDegrees .. degSymbol
latMinutes = latMinutes - (latDegrees * 60)
lonMinutes = lonMinutes - (lonDegrees * 60)
if precision >= (1 / 60) then
latMinutes = strFormat:format(latMinutes)
lonMinutes = strFormat:format(lonMinutes)
if not raw then
latMinSym = replaceDecimalMark(latMinutes) .. minSymbol
lonMinSym = replaceDecimalMark(lonMinutes) .. minSymbol
else
latMinSym = latMinutes .. minSymbol
lonMinSym = lonMinutes .. minSymbol
end
else
latMinSym = latMinutes .. minSymbol
lonMinSym = lonMinutes .. minSymbol
end
end
latValue = latDegSym .. latMinSym .. latSecSym .. latDirection
lonValue = lonDegSym .. lonMinSym .. lonSecSym .. lonDirection
value = latValue .. separator .. lonValue
if link then
globe = parseWikidataURL(datavalue['globe'])
if globe then
globe = mw.wikibase.getLabelByLang(globe, "en"):lower()
else
globe = "earth"
end
latLink = table.concat({latDegrees, latMinutes, latSeconds}, "_")
lonLink = table.concat({lonDegrees, lonMinutes, lonSeconds}, "_")
value = "[https://geohack.toolforge.org/geohack.php?language="..self.langCode.."¶ms="..latLink.."_"..latDirectionEN.."_"..lonLink.."_"..lonDirectionEN.."_globe:"..globe.." "..value.."]"
end
return value
elseif datatype == 'wikibase-entityid' then
local label
local itemID = datavalue['numeric-id']
if subtype == 'wikibase-item' then
itemID = "Q" .. itemID
elseif subtype == 'wikibase-property' then
itemID = "P" .. itemID
else
return '<strong class="error">' .. errorText('unknown-data-type', subtype) .. '</strong>'
end
label = self:getLabel(itemID, raw, link, short)
if label == "" then
label = nil
end
return label
else
return '<strong class="error">' .. errorText('unknown-data-type', datatype) .. '</strong>'
end
elseif snak.snaktype == 'somevalue' and not noSpecial then
if raw then
return " " -- single space represents 'somevalue'
else
return i18n['values']['unknown']
end
elseif snak.snaktype == 'novalue' and not noSpecial then
if raw then
return "" -- empty string represents 'novalue'
else
return i18n['values']['none']
end
else
return nil
end
end
function Config:getSingleRawQualifier(claim, qualifierID)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[qualifierID] end
if qualifiers and qualifiers[1] then
return self:getValue(qualifiers[1], true) -- raw = true
else
return nil
end
end
function Config:snakEqualsValue(snak, value)
local snakValue = self:getValue(snak, true) -- raw = true
if snakValue and snak.snaktype == 'value' and snak.datavalue.type == 'wikibase-entityid' then value = value:upper() end
return snakValue == value
end
function Config:setRank(rank)
local rankPos
if rank == p.flags.best then
self.bestRank = true
self.flagBest = true -- mark that 'best' flag was given
return
end
if rank:sub(1,9) == p.flags.preferred then
rankPos = 1
elseif rank:sub(1,6) == p.flags.normal then
rankPos = 2
elseif rank:sub(1,10) == p.flags.deprecated then
rankPos = 3
else
return
end
-- one of the rank flags was given, check if another one was given before
if not self.flagRank then
self.ranks = {false, false, false} -- no other rank flag given before, so unset ranks
self.bestRank = self.flagBest -- unsets bestRank only if 'best' flag was not given before
self.flagRank = true -- mark that a rank flag was given
end
if rank:sub(-1) == "+" then
for i = rankPos, 1, -1 do
self.ranks[i] = true
end
elseif rank:sub(-1) == "-" then
for i = rankPos, #self.ranks do
self.ranks[i] = true
end
else
self.ranks[rankPos] = true
end
end
function Config:setPeriod(period)
local periodPos
if period == p.flags.future then
periodPos = 1
elseif period == p.flags.current then
periodPos = 2
elseif period == p.flags.former then
periodPos = 3
else
return
end
-- one of the period flags was given, check if another one was given before
if not self.flagPeriod then
self.periods = {false, false, false} -- no other period flag given before, so unset periods
self.flagPeriod = true -- mark that a period flag was given
end
self.periods[periodPos] = true
end
function Config:qualifierMatches(claim, id, value)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[id] end
if qualifiers then
for _, v in pairs(qualifiers) do
if self:snakEqualsValue(v, value) then
return true
end
end
elseif value == "" then
-- if the qualifier is not present then treat it the same as the special value 'novalue'
return true
end
return false
end
function Config:rankMatches(rankPos)
if self.bestRank then
return (self.ranks[rankPos] and self.foundRank >= rankPos)
else
return self.ranks[rankPos]
end
end
function Config:timeMatches(claim)
local startTime = nil
local startTimeY = nil
local startTimeM = nil
local startTimeD = nil
local endTime = nil
local endTimeY = nil
local endTimeM = nil
local endTimeD = nil
if self.periods[1] and self.periods[2] and self.periods[3] then
-- any time
return true
end
startTime = self:getSingleRawQualifier(claim, aliasesP.startTime)
if startTime and startTime ~= "" and startTime ~= " " then
startTimeY, startTimeM, startTimeD = parseDate(startTime)
end
endTime = self:getSingleRawQualifier(claim, aliasesP.endTime)
if endTime and endTime ~= "" and endTime ~= " " then
endTimeY, endTimeM, endTimeD = parseDate(endTime)
end
if startTimeY ~= nil and endTimeY ~= nil and datePrecedesDate(endTimeY, endTimeM, endTimeD, startTimeY, startTimeM, startTimeD) then
-- invalidate end time if it precedes start time
endTimeY = nil
endTimeM = nil
endTimeD = nil
end
if self.periods[1] then
-- future
if startTimeY and datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD) then
return true
end
end
if self.periods[2] then
-- current
if (startTimeY == nil or not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD)) and
(endTimeY == nil or datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD)) then
return true
end
end
if self.periods[3] then
-- former
if endTimeY and not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD) then
return true
end
end
return false
end
function Config:processFlag(flag)
if not flag then
return false
end
if flag == p.flags.linked then
self.curState.linked = true
return true
elseif flag == p.flags.raw then
self.curState.rawValue = true
if self.curState == self.states[parameters.reference] then
-- raw reference values end with periods and require a separator (other than none)
self.separators["sep%r"][1] = {" "}
end
return true
elseif flag == p.flags.short then
self.curState.shortName = true
return true
elseif flag == p.flags.multilanguage then
self.curState.anyLanguage = true
return true
elseif flag == p.flags.unit then
self.curState.unitOnly = true
return true
elseif flag == p.flags.mdy then
self.mdyDate = true
return true
elseif flag == p.flags.single then
self.singleClaim = true
return true
elseif flag == p.flags.sourced then
self.sourcedOnly = true
return true
elseif flag == p.flags.edit then
self.editable = true
return true
elseif flag == p.flags.editAtEnd then
self.editable = true
self.editAtEnd = true
return true
elseif flag == p.flags.best or flag:match('^'..p.flags.preferred..'[+-]?$') or flag:match('^'..p.flags.normal..'[+-]?$') or flag:match('^'..p.flags.deprecated..'[+-]?$') then
self:setRank(flag)
return true
elseif flag == p.flags.future or flag == p.flags.current or flag == p.flags.former then
self:setPeriod(flag)
return true
elseif flag == "" then
-- ignore empty flags and carry on
return true
else
return false
end
end
function Config:processFlagOrCommand(flag)
local param = ""
if not flag then
return false
end
if flag == p.claimCommands.property or flag == p.claimCommands.properties then
param = parameters.property
elseif flag == p.claimCommands.qualifier or flag == p.claimCommands.qualifiers then
self.states.qualifiersCount = self.states.qualifiersCount + 1
param = parameters.qualifier .. self.states.qualifiersCount
self.separators["sep"..param] = {copyTable(defaultSeparators["sep%q\\d"])}
elseif flag == p.claimCommands.reference or flag == p.claimCommands.references then
param = parameters.reference
else
return self:processFlag(flag)
end
if self.states[param] then
return false
end
-- create a new state for each command
self.states[param] = State:new(self, param)
-- use "%x" as the general parameter name
self.states[param].parsedFormat = parseFormat(parameters.general) -- will be overwritten for param=="%p"
-- set the separator
self.states[param].separator = self.separators["sep"..param] -- will be nil for param=="%p", which will be set separately
if flag == p.claimCommands.property or flag == p.claimCommands.qualifier or flag == p.claimCommands.reference then
self.states[param].singleValue = true
end
self.curState = self.states[param]
return true
end
function Config:processSeparators(args)
local sep
for i, v in pairs(self.separators) do
if args[i] then
sep = replaceSpecialChars(args[i])
if sep ~= "" then
self.separators[i][1] = {sep}
else
self.separators[i][1] = nil
end
end
end
end
function Config:setFormatAndSeparators(state, parsedFormat)
state.parsedFormat = parsedFormat
state.separator = self.separators["sep"]
state.movSeparator = self.separators["sep"..parameters.separator]
state.puncMark = self.separators["punc"]
end
-- determines if a claim has references by prefetching them from the claim using getReferences,
-- which applies some filtering that determines if a reference is actually returned,
-- and caches the references for later use
function State:isSourced(claim)
self.conf.prefetchedRefs = self:getReferences(claim)
return (#self.conf.prefetchedRefs > 0)
end
function State:resetCaches()
-- any prefetched references of the previous claim must not be used
self.conf.prefetchedRefs = nil
end
function State:claimMatches(claim)
local matches, rankPos
-- first of all, reset any cached values used for the previous claim
self:resetCaches()
-- if a property value was given, check if it matches the claim's property value
if self.conf.propertyValue then
matches = self.conf:snakEqualsValue(claim.mainsnak, self.conf.propertyValue)
else
matches = true
end
-- if any qualifier values were given, check if each matches one of the claim's qualifier values
for i, v in pairs(self.conf.qualifierIDsAndValues) do
matches = (matches and self.conf:qualifierMatches(claim, i, v))
end
-- check if the claim's rank and time period match
rankPos = rankTable[claim.rank] or 4
matches = (matches and self.conf:rankMatches(rankPos) and self.conf:timeMatches(claim))
-- if only claims with references must be returned, check if this one has any
if self.conf.sourcedOnly then
matches = (matches and self:isSourced(claim)) -- prefetches and caches references
end
return matches, rankPos
end
function State:out()
local result -- collection of arrays with value objects
local valuesArray -- array with value objects
local sep = nil -- value object
local out = {} -- array with value objects
local function walk(formatTable, result)
local valuesArray = {} -- array with value objects
for i, v in pairs(formatTable.req) do
if not result[i] or not result[i][1] then
-- we've got no result for a parameter that is required on this level,
-- so skip this level (and its children) by returning an empty result
return {}
end
end
for _, v in ipairs(formatTable) do
if v.param then
valuesArray = mergeArrays(valuesArray, result[v.str])
elseif v.str ~= "" then
valuesArray[#valuesArray + 1] = {v.str}
end
if v.child then
valuesArray = mergeArrays(valuesArray, walk(v.child, result))
end
end
return valuesArray
end
-- iterate through the results from back to front, so that we know when to add separators
for i = #self.results, 1, -1 do
result = self.results[i]
-- if there is already some output, then add the separators
if #out > 0 then
sep = self.separator[1] -- fixed separator
result[parameters.separator] = {self.movSeparator[1]} -- movable separator
else
sep = nil
result[parameters.separator] = {self.puncMark[1]} -- optional punctuation mark
end
valuesArray = walk(self.parsedFormat, result)
if #valuesArray > 0 then
if sep then
valuesArray[#valuesArray + 1] = sep
end
out = mergeArrays(valuesArray, out)
end
end
-- reset state before next iteration
self.results = {}
return out
end
-- level 1 hook
function State:getProperty(claim)
local value = {self:getValue(claim.mainsnak)} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getQualifiers(claim, param)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[self.conf.qualifierIDs[param]] end
if qualifiers then
-- iterate through claim's qualifier statements to collect their values;
-- return array with multiple value objects
return self.conf.states[param]:iterate(qualifiers, {[parameters.general] = hookNames[parameters.qualifier.."\\d"][2], count = 1}) -- pass qualifier state with level 2 hook
else
return {} -- return empty array
end
end
-- level 2 hook
function State:getQualifier(snak)
local value = {self:getValue(snak)} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getAllQualifiers(claim, param, result, hooks)
local out = {} -- array with value objects
local sep = self.conf.separators["sep"..parameters.qualifier][1] -- value object
-- iterate through the output of the separate "qualifier(s)" commands
for i = 1, self.conf.states.qualifiersCount do
-- if a hook has not been called yet, call it now
if not result[parameters.qualifier..i] then
self:callHook(parameters.qualifier..i, hooks, claim, result)
end
-- if there is output for this particular "qualifier(s)" command, then add it
if result[parameters.qualifier..i] and result[parameters.qualifier..i][1] then
-- if there is already some output, then add the separator
if #out > 0 and sep then
out[#out + 1] = sep
end
out = mergeArrays(out, result[parameters.qualifier..i])
end
end
return out
end
-- level 1 hook
function State:getReferences(claim)
if self.conf.prefetchedRefs then
-- return references that have been prefetched by isSourced
return self.conf.prefetchedRefs
end
if claim.references then
-- iterate through claim's reference statements to collect their values;
-- return array with multiple value objects
return self.conf.states[parameters.reference]:iterate(claim.references, {[parameters.general] = hookNames[parameters.reference][2], count = 1}) -- pass reference state with level 2 hook
else
return {} -- return empty array
end
end
-- level 2 hook
function State:getReference(statement)
local key, citeWeb, citeQ, label
local params = {}
local citeParams = {['web'] = {}, ['q'] = {}}
local citeMismatch = {}
local useCite = nil
local useParams = nil
local value = ""
local ref = {}
local referenceEmpty = true -- will be set to false if at least one parameter is left unremoved
local numAuthorParameters = 0
local numAuthorNameStringParameters = 0
local tempLink
local additionalRefProperties = {} -- will hold properties of the reference which are not in statement.snaks, namely backup title from "subject named as" and URL from an external ID
local wikidataPropertiesOfSource -- will contain "Wikidata property" properties of the item in stated in, if any
local version = 4 -- increment this each time the below logic is changed to avoid conflict errors
if statement.snaks then
-- don't include "imported from", which is added by a bot
if statement.snaks[aliasesP.importedFrom] then
statement.snaks[aliasesP.importedFrom] = nil
end
-- don't include "Wikimedia import URL"
if statement.snaks[aliasesP.wikimediaImportURL] then
statement.snaks[aliasesP.wikimediaImportURL] = nil
-- don't include "retrieved" if no "referenceURL" is present,
-- as "retrieved" probably belongs to "Wikimedia import URL"
if statement.snaks[aliasesP.retrieved] and not statement.snaks[aliasesP.referenceURL] then
statement.snaks[aliasesP.retrieved] = nil
end
end
-- don't include "inferred from", which is added by a bot
if statement.snaks[aliasesP.inferredFrom] then
statement.snaks[aliasesP.inferredFrom] = nil
end
-- don't include "type of reference"
if statement.snaks[aliasesP.typeOfReference] then
statement.snaks[aliasesP.typeOfReference] = nil
end
-- don't include "image" to prevent littering
if statement.snaks[aliasesP.image] then
statement.snaks[aliasesP.image] = nil
end
-- don't include "language" if it is equal to the local one
if self:getReferenceDetail(statement.snaks, aliasesP.language) == self.conf.langName then
statement.snaks[aliasesP.language] = nil
end
if statement.snaks[aliasesP.statedIn] and not statement.snaks[aliasesP.referenceURL] then
-- "stated in" was given but "reference URL" was not.
-- get "Wikidata property" properties from the item in "stated in"
-- if any of the returned properties of the external-id datatype is in statement.snaks, generate a URL from it and use the URL in the reference
-- find the "Wikidata property" properties in the item from "stated in"
wikidataPropertiesOfSource = mw.text.split(p._properties{p.flags.raw, aliasesP.wikidataProperty, [p.args.eid] = self.conf:getValue(statement.snaks[aliasesP.statedIn][1], true, false)}, ", ", true)
for i, wikidataPropertyOfSource in pairs(wikidataPropertiesOfSource) do
if statement.snaks[wikidataPropertyOfSource] and statement.snaks[wikidataPropertyOfSource][1].datatype == "external-id" then
tempLink = self.conf:getValue(statement.snaks[wikidataPropertyOfSource][1], false, true) -- not raw, linked
if mw.ustring.match(tempLink, "^%[%Z- %Z+%]$") then -- getValue returned a URL.
additionalRefProperties[aliasesP.referenceURL] = mw.ustring.gsub(tempLink, "^%[(%Z-) %Z+%]$", "%1") -- the URL is in wiki markup, so strip the square brackets and the display text
statement.snaks[wikidataPropertyOfSource] = nil
break
end
end
end
end
-- don't include "subject named as", but use it as the title when "title" is not present but a URL is
if statement.snaks[aliasesP.subjectNamedAs] then
if not statement.snaks[aliasesP.title] and (statement.snaks[aliasesP.referenceURL] or additionalRefProperties[aliasesP.referenceURL]) then
additionalRefProperties[aliasesP.title] = statement.snaks[aliasesP.subjectNamedAs][1].datavalue.value
end
statement.snaks[aliasesP.subjectNamedAs] = nil
end
-- retrieve all the parameters
for i in pairs(statement.snaks) do
label = ""
-- multiple authors may be given
if i == aliasesP.author or i == aliasesP.authorNameString then
params[i] = self:getReferenceDetails(statement.snaks, i, false, self.linked, true) -- link = true/false, anyLang = true
else
params[i] = {self:getReferenceDetail(statement.snaks, i, false, (self.linked or (i == aliasesP.statedIn)) and (statement.snaks[i][1].datatype ~= 'url'), true)} -- link = true/false, anyLang = true
end
if #params[i] == 0 then
params[i] = nil
else
referenceEmpty = false
if statement.snaks[i][1].datatype == 'external-id' then
key = "external-id"
label = self.conf:getLabel(i)
if label ~= "" then
label = label .. " "
end
else
key = i
end
-- add the parameter to each matching type of citation
for j in pairs(citeParams) do
-- do so if there was no mismatch with a previous parameter
if not citeMismatch[j] then
-- check if this parameter is not mismatching itself
if i18n['cite'][j][key] then
-- continue if an option is available in the corresponding cite template
if i18n['cite'][j][key] ~= "" then
-- handle non-author properties (and author properties ("author" and "author name string"), if they don't use the same template parameter)
if (i ~= aliasesP.author and i ~= aliasesP.authorNameString) or (i18n['cite'][j][aliasesP.author] ~= i18n['cite'][j][aliasesP.authorNameString]) then
citeParams[j][i18n['cite'][j][key]] = label .. params[i][1]
-- to avoid problems with non-author multiple parameters (if existent), the following old code is retained
for k=2, #params[i] do
citeParams[j][i18n['cite'][j][key]..k] = label .. params[i][k]
end
-- handle "author" and "author name string" specially if they use the same template parameter
elseif i == aliasesP.author or i == aliasesP.authorNameString then
if params[aliasesP.author] ~= nil then
numAuthorParameters = #params[aliasesP.author]
else
numAuthorParameters = 0
end
if params[aliasesP.authorNameString] ~= nil then
numAuthorNameStringParameters = #params[aliasesP.authorNameString]
else
numAuthorNameStringParameters = 0
end
-- execute only if both "author" and "author name string" satisfy this condition: the property is both in params and in statement.snaks or it is neither in params nor in statement.snaks
-- reason: parameters are added to params each iteration of the loop, not before the loop
if ((statement.snaks[aliasesP.author] == nil) == (numAuthorParameters == 0)) and ((statement.snaks[aliasesP.authorNameString] == nil) == (numAuthorNameStringParameters == 0)) then
for k=1, numAuthorParameters + numAuthorNameStringParameters do
if k <= numAuthorParameters then -- now handling the authors from the "author" property
citeParams[j][i18n['cite'][j][aliasesP.author]..k] = label .. params[aliasesP.author][k]
else -- now handling the authors from "author name string"
citeParams[j][i18n['cite'][j][aliasesP.authorNameString]..k] = label .. params[aliasesP.authorNameString][k - numAuthorParameters]
end
end
end
end
end
else
citeMismatch[j] = true
end
end
end
end
end
-- use additional properties
for i in pairs(additionalRefProperties) do
for j in pairs(citeParams) do
if not citeMismatch[j] and i18n["cite"][j][i] then
citeParams[j][i18n["cite"][j][i]] = additionalRefProperties[i]
else
citeMismatch[j] = true
end
end
end
-- get title of general template for citing web references
citeWeb = split(mw.wikibase.getSitelink(aliasesQ.citeWeb) or "", ":")[2] -- split off namespace from front
-- get title of template that expands stated-in references into citations
citeQ = split(mw.wikibase.getSitelink(aliasesQ.citeQ) or "", ":")[2] -- split off namespace from front
-- (1) use the general template for citing web references if there is a match and if at least both "reference URL" and "title" are present
if citeWeb and not citeMismatch['web'] and citeParams['web'][i18n['cite']['web'][aliasesP.referenceURL]] and citeParams['web'][i18n['cite']['web'][aliasesP.title]] then
useCite = citeWeb
useParams = citeParams['web']
-- (2) use the template that expands stated-in references into citations if there is a match and if at least "stated in" is present
elseif citeQ and not citeMismatch['q'] and citeParams['q'][i18n['cite']['q'][aliasesP.statedIn]] then
-- we need the raw "stated in" Q-identifier for the this template
citeParams['q'][i18n['cite']['q'][aliasesP.statedIn]] = self:getReferenceDetail(statement.snaks, aliasesP.statedIn, true) -- raw = true
useCite = citeQ
useParams = citeParams['q']
end
if useCite and useParams then
-- if this module is being substituted then build a regular template call, otherwise expand the template
if mw.isSubsting() then
for i, v in pairs(useParams) do
value = value .. "|" .. i .. "=" .. v
end
value = "{{" .. useCite .. value .. "}}"
else
value = mw.getCurrentFrame():expandTemplate{title=useCite, args=useParams}
end
-- (3) if the citation couldn't be displayed using Cite web or Cite Q, but has properties other than the removed ones, throw an error
elseif not referenceEmpty then
value = "<span style=\"color: crimson\">" .. errorText("malformed-reference") .. "</span>"
end
if value ~= "" then
value = {value} -- create one value object
if not self.rawValue then
-- this should become a <ref> tag, so save the reference's hash for later
value.refHash = "wikidata-" .. statement.hash .. "-v" .. (tonumber(i18n['cite']['version']) + version)
end
ref = {value} -- wrap the value object in an array
end
end
return ref
end
-- gets a detail of one particular type for a reference
function State:getReferenceDetail(snaks, dType, raw, link, anyLang)
local switchLang = anyLang
local value = nil
if not snaks[dType] then
return nil
end
-- if anyLang, first try the local language and otherwise any language
repeat
for _, v in ipairs(snaks[dType]) do
value = self.conf:getValue(v, raw, link, false, anyLang and not switchLang, false, true) -- noSpecial = true
if value then
break
end
end
if value or not anyLang then
break
end
switchLang = not switchLang
until anyLang and switchLang
return value
end
-- gets the details of one particular type for a reference
function State:getReferenceDetails(snaks, dType, raw, link, anyLang)
local values = {}
if not snaks[dType] then
return {}
end
for _, v in ipairs(snaks[dType]) do
-- if nil is returned then it will not be added to the table
values[#values + 1] = self.conf:getValue(v, raw, link, false, anyLang, false, true) -- noSpecial = true
end
return values
end
-- level 1 hook
function State:getAlias(object)
local value = object.value
local title = nil
if value and self.linked then
if self.conf.entityID:sub(1,1) == "Q" then
title = mw.wikibase.getSitelink(self.conf.entityID)
elseif self.conf.entityID:sub(1,1) == "P" then
title = "d:Property:" .. self.conf.entityID
end
if title then
value = buildWikilink(title, value)
end
end
value = {value} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getBadge(value)
value = self.conf:getLabel(value, self.rawValue, self.linked, self.shortName)
if value == "" then
value = nil
end
value = {value} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
function State:callHook(param, hooks, statement, result)
local valuesArray, refHash
-- call a parameter's hook if it has been defined and if it has not been called before
if not result[param] and hooks[param] then
valuesArray = self[hooks[param]](self, statement, param, result, hooks) -- array with value objects
-- add to the result
if #valuesArray > 0 then
result[param] = valuesArray
result.count = result.count + 1
else
result[param] = {} -- an empty array to indicate that we've tried this hook already
return true -- miss == true
end
end
return false
end
-- iterate through claims, claim's qualifiers or claim's references to collect values
function State:iterate(statements, hooks, matchHook)
matchHook = matchHook or alwaysTrue
local matches = false
local rankPos = nil
local result, gotRequired
for _, v in ipairs(statements) do
-- rankPos will be nil for non-claim statements (e.g. qualifiers, references, etc.)
matches, rankPos = matchHook(self, v)
if matches then
result = {count = 0} -- collection of arrays with value objects
local function walk(formatTable)
local miss
for i2, v2 in pairs(formatTable.req) do
-- call a hook, adding its return value to the result
miss = self:callHook(i2, hooks, v, result)
if miss then
-- we miss a required value for this level, so return false
return false
end
if result.count == hooks.count then
-- we're done if all hooks have been called;
-- returning at this point breaks the loop
return true
end
end
for _, v2 in ipairs(formatTable) do
if result.count == hooks.count then
-- we're done if all hooks have been called;
-- returning at this point prevents further childs from being processed
return true
end
if v2.child then
walk(v2.child)
end
end
return true
end
gotRequired = walk(self.parsedFormat)
-- only append the result if we got values for all required parameters on the root level
if gotRequired then
-- if we have a rankPos (only with matchHook() for complete claims), then update the foundRank
if rankPos and self.conf.foundRank > rankPos then
self.conf.foundRank = rankPos
end
-- append the result
self.results[#self.results + 1] = result
-- break if we only need a single value
if self.singleValue then
break
end
end
end
end
return self:out()
end
local function getEntityId(arg, eid, page, allowOmitPropPrefix)
local id = nil
local prop = nil
if arg then
if arg:sub(1,1) == ":" then
page = arg
eid = nil
elseif arg:sub(1,1):upper() == "Q" or arg:sub(1,9):lower() == "property:" or allowOmitPropPrefix then
eid = arg
page = nil
else
prop = arg
end
end
if eid then
if eid:sub(1,9):lower() == "property:" then
id = replaceAlias(mw.text.trim(eid:sub(10)))
if id:sub(1,1):upper() ~= "P" then
id = ""
end
else
id = replaceAlias(eid)
end
elseif page then
if page:sub(1,1) == ":" then
page = mw.text.trim(page:sub(2))
end
id = mw.wikibase.getEntityIdForTitle(page) or ""
end
if not id then
id = mw.wikibase.getEntityIdForCurrentPage() or ""
end
id = id:upper()
if not mw.wikibase.isValidEntityId(id) then
id = ""
end
return id, prop
end
local function nextArg(args)
local arg = args[args.pointer]
if arg then
args.pointer = args.pointer + 1
return mw.text.trim(arg)
else
return nil
end
end
local function claimCommand(args, funcName)
local cfg = Config:new()
cfg:processFlagOrCommand(funcName) -- process first command (== function name)
local lastArg, parsedFormat, formatParams, claims, value
local hooks = {count = 0}
-- set the date if given;
-- must come BEFORE processing the flags
if args[p.args.date] then
cfg.atDate = {parseDate(args[p.args.date])}
cfg.periods = {false, true, false} -- change default time constraint to 'current'
end
-- process flags and commands
repeat
lastArg = nextArg(args)
until not cfg:processFlagOrCommand(lastArg)
-- get the entity ID from either the positional argument, the eid argument or the page argument
cfg.entityID, cfg.propertyID = getEntityId(lastArg, args[p.args.eid], args[p.args.page])
if cfg.entityID == "" then
return "" -- we cannot continue without a valid entity ID
end
cfg.entity = mw.wikibase.getEntity(cfg.entityID)
if not cfg.propertyID then
cfg.propertyID = nextArg(args)
end
cfg.propertyID = replaceAlias(cfg.propertyID)
if not cfg.entity or not cfg.propertyID then
return "" -- we cannot continue without an entity or a property ID
end
cfg.propertyID = cfg.propertyID:upper()
if not cfg.entity.claims or not cfg.entity.claims[cfg.propertyID] then
return "" -- there is no use to continue without any claims
end
claims = cfg.entity.claims[cfg.propertyID]
if cfg.states.qualifiersCount > 0 then
-- do further processing if "qualifier(s)" command was given
if #args - args.pointer + 1 > cfg.states.qualifiersCount then
-- claim ID or literal value has been given
cfg.propertyValue = nextArg(args)
end
for i = 1, cfg.states.qualifiersCount do
-- check if given qualifier ID is an alias and add it
cfg.qualifierIDs[parameters.qualifier..i] = replaceAlias(nextArg(args) or ""):upper()
end
elseif cfg.states[parameters.reference] then
-- do further processing if "reference(s)" command was given
cfg.propertyValue = nextArg(args)
end
-- check for special property value 'somevalue' or 'novalue'
if cfg.propertyValue then
cfg.propertyValue = replaceSpecialChars(cfg.propertyValue)
if cfg.propertyValue ~= "" and mw.text.trim(cfg.propertyValue) == "" then
cfg.propertyValue = " " -- single space represents 'somevalue', whereas empty string represents 'novalue'
else
cfg.propertyValue = mw.text.trim(cfg.propertyValue)
end
end
-- parse the desired format, or choose an appropriate format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
elseif cfg.states.qualifiersCount > 0 then -- "qualifier(s)" command given
if cfg.states[parameters.property] then -- "propert(y|ies)" command given
parsedFormat, formatParams = parseFormat(formats.propertyWithQualifier)
else
parsedFormat, formatParams = parseFormat(formats.qualifier)
end
elseif cfg.states[parameters.property] then -- "propert(y|ies)" command given
parsedFormat, formatParams = parseFormat(formats.property)
else -- "reference(s)" command given
parsedFormat, formatParams = parseFormat(formats.reference)
end
-- if a "qualifier(s)" command and no "propert(y|ies)" command has been given, make the movable separator a semicolon
if cfg.states.qualifiersCount > 0 and not cfg.states[parameters.property] then
cfg.separators["sep"..parameters.separator][1] = {";"}
end
-- if only "reference(s)" has been given, set the default separator to none (except when raw)
if cfg.states[parameters.reference] and not cfg.states[parameters.property] and cfg.states.qualifiersCount == 0
and not cfg.states[parameters.reference].rawValue then
cfg.separators["sep"][1] = nil
end
-- if exactly one "qualifier(s)" command has been given, make "sep%q" point to "sep%q1" to make them equivalent
if cfg.states.qualifiersCount == 1 then
cfg.separators["sep"..parameters.qualifier] = cfg.separators["sep"..parameters.qualifier.."1"]
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hooks that should be called (getProperty, getQualifiers, getReferences);
-- only define a hook if both its command ("propert(y|ies)", "reference(s)", "qualifier(s)") and its parameter ("%p", "%r", "%q1", "%q2", "%q3") have been given
for i, v in pairs(cfg.states) do
-- e.g. 'formatParams["%q1"] or formatParams["%q"]' to define hook even if "%q1" was not defined to be able to build a complete value for "%q"
if formatParams[i] or formatParams[i:sub(1, 2)] then
hooks[i] = getHookName(i, 1)
hooks.count = hooks.count + 1
end
end
-- the "%q" parameter is not attached to a state, but is a collection of the results of multiple states (attached to "%q1", "%q2", "%q3", ...);
-- so if this parameter is given then this hook must be defined separately, but only if at least one "qualifier(s)" command has been given
if formatParams[parameters.qualifier] and cfg.states.qualifiersCount > 0 then
hooks[parameters.qualifier] = getHookName(parameters.qualifier, 1)
hooks.count = hooks.count + 1
end
-- create a state for "properties" if it doesn't exist yet, which will be used as a base configuration for each claim iteration;
-- must come AFTER defining the hooks
if not cfg.states[parameters.property] then
cfg.states[parameters.property] = State:new(cfg, parameters.property)
-- if the "single" flag has been given then this state should be equivalent to "property" (singular)
if cfg.singleClaim then
cfg.states[parameters.property].singleValue = true
end
end
-- if the "sourced" flag has been given then create a state for "reference" if it doesn't exist yet, using default values,
-- which must exist in order to be able to determine if a claim has any references;
-- must come AFTER defining the hooks
if cfg.sourcedOnly and not cfg.states[parameters.reference] then
cfg:processFlagOrCommand(p.claimCommands.reference) -- use singular "reference" to minimize overhead
end
-- set the parsed format and the separators (and optional punctuation mark);
-- must come AFTER creating the additonal states
cfg:setFormatAndSeparators(cfg.states[parameters.property], parsedFormat)
-- process qualifier matching values, analogous to cfg.propertyValue
for i, v in pairs(args) do
i = tostring(i)
if i:match('^[Pp]%d+$') or aliasesP[i] then
v = replaceSpecialChars(v)
-- check for special qualifier value 'somevalue'
if v ~= "" and mw.text.trim(v) == "" then
v = " " -- single space represents 'somevalue'
end
cfg.qualifierIDsAndValues[replaceAlias(i):upper()] = v
end
end
-- first sort the claims on rank to pre-define the order of output (preferred first, then normal, then deprecated)
claims = sortOnRank(claims)
-- then iterate through the claims to collect values
value = cfg:concatValues(cfg.states[parameters.property]:iterate(claims, hooks, State.claimMatches)) -- pass property state with level 1 hooks and matchHook
-- if desired, add a clickable icon that may be used to edit the returned values on Wikidata
if cfg.editable and value ~= "" then
value = value .. cfg:getEditIcon()
end
return value
end
local function generalCommand(args, funcName)
local cfg = Config:new()
cfg.curState = State:new(cfg)
local lastArg
local value = nil
repeat
lastArg = nextArg(args)
until not cfg:processFlag(lastArg)
-- get the entity ID from either the positional argument, the eid argument or the page argument
cfg.entityID = getEntityId(lastArg, args[p.args.eid], args[p.args.page], true)
if cfg.entityID == "" or not mw.wikibase.entityExists(cfg.entityID) then
return "" -- we cannot continue without an entity
end
-- serve according to the given command
if funcName == p.generalCommands.label then
value = cfg:getLabel(cfg.entityID, cfg.curState.rawValue, cfg.curState.linked, cfg.curState.shortName)
elseif funcName == p.generalCommands.title then
cfg.inSitelinks = true
if cfg.entityID:sub(1,1) == "Q" then
value = mw.wikibase.getSitelink(cfg.entityID)
end
if cfg.curState.linked and value then
value = buildWikilink(value)
end
elseif funcName == p.generalCommands.description then
value = mw.wikibase.getDescription(cfg.entityID)
else
local parsedFormat, formatParams
local hooks = {count = 0}
cfg.entity = mw.wikibase.getEntity(cfg.entityID)
if funcName == p.generalCommands.alias or funcName == p.generalCommands.badge then
cfg.curState.singleValue = true
end
if funcName == p.generalCommands.alias or funcName == p.generalCommands.aliases then
if not cfg.entity.aliases or not cfg.entity.aliases[cfg.langCode] then
return "" -- there is no use to continue without any aliasses
end
local aliases = cfg.entity.aliases[cfg.langCode]
-- parse the desired format, or parse the default aliases format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
else
parsedFormat, formatParams = parseFormat(formats.alias)
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hook that should be called (getAlias);
-- only define the hook if the parameter ("%a") has been given
if formatParams[parameters.alias] then
hooks[parameters.alias] = getHookName(parameters.alias, 1)
hooks.count = hooks.count + 1
end
-- set the parsed format and the separators (and optional punctuation mark)
cfg:setFormatAndSeparators(cfg.curState, parsedFormat)
-- iterate to collect values
value = cfg:concatValues(cfg.curState:iterate(aliases, hooks))
elseif funcName == p.generalCommands.badge or funcName == p.generalCommands.badges then
if not cfg.entity.sitelinks or not cfg.entity.sitelinks[cfg.siteID] or not cfg.entity.sitelinks[cfg.siteID].badges then
return "" -- there is no use to continue without any badges
end
local badges = cfg.entity.sitelinks[cfg.siteID].badges
cfg.inSitelinks = true
-- parse the desired format, or parse the default aliases format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
else
parsedFormat, formatParams = parseFormat(formats.badge)
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hook that should be called (getBadge);
-- only define the hook if the parameter ("%b") has been given
if formatParams[parameters.badge] then
hooks[parameters.badge] = getHookName(parameters.badge, 1)
hooks.count = hooks.count + 1
end
-- set the parsed format and the separators (and optional punctuation mark)
cfg:setFormatAndSeparators(cfg.curState, parsedFormat)
-- iterate to collect values
value = cfg:concatValues(cfg.curState:iterate(badges, hooks))
end
end
value = value or ""
if cfg.editable and value ~= "" then
-- if desired, add a clickable icon that may be used to edit the returned value on Wikidata
value = value .. cfg:getEditIcon()
end
return value
end
-- modules that include this module should call the functions with an underscore prepended, e.g.: p._property(args)
local function establishCommands(commandList, commandFunc)
for _, commandName in pairs(commandList) do
local function wikitextWrapper(frame)
local args = copyTable(frame.args)
args.pointer = 1
loadI18n(aliasesP, frame)
return commandFunc(args, commandName)
end
p[commandName] = wikitextWrapper
local function luaWrapper(args)
args = copyTable(args)
args.pointer = 1
loadI18n(aliasesP)
return commandFunc(args, commandName)
end
p["_" .. commandName] = luaWrapper
end
end
establishCommands(p.claimCommands, claimCommand)
establishCommands(p.generalCommands, generalCommand)
-- main function that is supposed to be used by wrapper templates
function p.main(frame)
if not mw.wikibase then return nil end
local f, args
loadI18n(aliasesP, frame)
-- get the parent frame to take the arguments that were passed to the wrapper template
frame = frame:getParent() or frame
if not frame.args[1] then
throwError("no-function-specified")
end
f = mw.text.trim(frame.args[1])
if f == "main" then
throwError("main-called-twice")
end
assert(p["_"..f], errorText('no-such-function', f))
-- copy arguments from immutable to mutable table
args = copyTable(frame.args)
-- remove the function name from the list
table.remove(args, 1)
return p["_"..f](args)
end
return p
a84f46cf7d14594003fea6e756cf41b723dd67cd
Module:Wd/i18n
828
32
66
2023-07-10T18:07:36Z
wikipedia>Pppery
0
per edit request
Scribunto
text/plain
-- The values and functions in this submodule should be localized per wiki.
local p = {}
function p.init(aliasesP)
p = {
["errors"] = {
["unknown-data-type"] = "Unknown or unsupported datatype '$1'.",
["missing-required-parameter"] = "No required parameters defined, needing at least one",
["extra-required-parameter"] = "Parameter '$1' must be defined as optional",
["no-function-specified"] = "You must specify a function to call", -- equal to the standard module error message
["main-called-twice"] = 'The function "main" cannot be called twice',
["no-such-function"] = 'The function "$1" does not exist', -- equal to the standard module error message
["malformed-reference"] = "Error: Unable to display the reference properly. See [[Module:wd/doc#References|the documentation]] for details.[[Category:Module:Wd reference errors]]"
},
["info"] = {
["edit-on-wikidata"] = "Edit this on Wikidata"
},
["numeric"] = {
["decimal-mark"] = ".",
["delimiter"] = ","
},
["datetime"] = {
["prefixes"] = {
["decade-period"] = ""
},
["suffixes"] = {
["decade-period"] = "s",
["millennium"] = " millennium",
["century"] = " century",
["million-years"] = " million years",
["billion-years"] = " billion years",
["year"] = " year",
["years"] = " years"
},
["julian-calendar"] = "Julian calendar", -- linked page title
["julian"] = "Julian",
["BCE"] = "BCE",
["CE"] = "CE",
["common-era"] = "Common Era" -- linked page title
},
["coord"] = {
["latitude-north"] = "N",
["latitude-south"] = "S",
["longitude-east"] = "E",
["longitude-west"] = "W",
["degrees"] = "°",
["minutes"] = "'",
["seconds"] = '"',
["separator"] = ", "
},
["values"] = {
["unknown"] = "unknown",
["none"] = "none"
},
["cite"] = {
["version"] = "4", -- increment this each time the below parameters are changed to avoid conflict errors
["web"] = {
-- <= left side: all allowed reference properties for *web page sources* per https://www.wikidata.org/wiki/Help:Sources
-- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite web]] (if non-existent, keep empty i.e. "")
[aliasesP.statedIn] = "website",
[aliasesP.referenceURL] = "url",
[aliasesP.publicationDate] = "date",
[aliasesP.retrieved] = "access-date",
[aliasesP.title] = "title",
[aliasesP.archiveURL] = "archive-url",
[aliasesP.archiveDate] = "archive-date",
[aliasesP.language] = "language",
[aliasesP.author] = "author", -- existence of author1, author2, author3, etc. is assumed
[aliasesP.authorNameString] = "author",
[aliasesP.publisher] = "publisher",
[aliasesP.quote] = "quote",
[aliasesP.pages] = "pages", -- extra option
[aliasesP.publishedIn] = "website"
},
["q"] = {
-- <= left side: all allowed reference properties for *sources other than web pages* per https://www.wikidata.org/wiki/Help:Sources
-- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite Q]] (if non-existent, keep empty i.e. "")
[aliasesP.statedIn] = "1",
[aliasesP.pages] = "pages",
[aliasesP.column] = "at",
[aliasesP.chapter] = "chapter",
[aliasesP.sectionVerseOrParagraph] = "section",
["external-id"] = "id", -- used for any type of database property ID
[aliasesP.title] = "title",
[aliasesP.publicationDate] = "date",
[aliasesP.retrieved] = "access-date"
}
}
}
p.getOrdinalSuffix = function(num)
if tostring(num):sub(-2,-2) == '1' then
return "th" -- 10th, 11th, 12th, 13th, ... 19th
end
num = tostring(num):sub(-1)
if num == '1' then
return "st"
elseif num == '2' then
return "nd"
elseif num == '3' then
return "rd"
else
return "th"
end
end
p.addDelimiters = function(n)
local left, num, right = string.match(n, "^([^%d]*%d)(%d*)(.-)$")
if left and num and right then
return left .. (num:reverse():gsub("(%d%d%d)", "%1" .. p['numeric']['delimiter']):reverse()) .. right
else
return n
end
end
return p
end
return p
a860785cf3b9ad3ba0c8096d5627eae877d4e9ab
Module:WikidataIB
828
37
76
2023-07-10T18:09:04Z
wikipedia>Pppery
0
Per edit request
Scribunto
text/plain
-- Version: 2023-07-10
-- Module to implement use of a blacklist and whitelist for infobox fields
-- Can take a named parameter |qid which is the Wikidata ID for the article
-- if not supplied, it will use the Wikidata ID associated with the current page.
-- Fields in blacklist are never to be displayed, i.e. module must return nil in all circumstances
-- Fields in whitelist return local value if it exists or the Wikidata value otherwise
-- The name of the field that this function is called from is passed in named parameter |name
-- The name is compulsory when blacklist or whitelist is used,
-- so the module returns nil if it is not supplied.
-- blacklist is passed in named parameter |suppressfields (or |spf)
-- whitelist is passed in named parameter |fetchwikidata (or |fwd)
require("strict")
local p = {}
local cdate -- initialise as nil and only load _complex_date function if needed
-- Module:Complex date is loaded lazily and has the following dependencies:
-- Module:Calendar
-- Module:ISOdate
-- Module:DateI18n
-- Module:I18n/complex date
-- Module:Ordinal
-- Module:I18n/ordinal
-- Module:Yesno
-- Module:Formatnum
-- Module:Linguistic
--
-- The following, taken from https://www.mediawiki.org/wiki/Wikibase/DataModel#Dates_and_times,
-- is needed to use Module:Complex date which seemingly requires date precision as a string.
-- It would work better if only the authors of the mediawiki page could spell 'millennium'.
local dp = {
[6] = "millennium",
[7] = "century",
[8] = "decade",
[9] = "year",
[10] = "month",
[11] = "day",
}
local i18n =
{
["errors"] =
{
["property-not-found"] = "Property not found.",
["No property supplied"] = "No property supplied",
["entity-not-found"] = "Wikidata entity not found.",
["unknown-claim-type"] = "Unknown claim type.",
["unknown-entity-type"] = "Unknown entity type.",
["qualifier-not-found"] = "Qualifier not found.",
["site-not-found"] = "Wikimedia project not found.",
["labels-not-found"] = "No labels found.",
["descriptions-not-found"] = "No descriptions found.",
["aliases-not-found"] = "No aliases found.",
["unknown-datetime-format"] = "Unknown datetime format.",
["local-article-not-found"] = "Article is available on Wikidata, but not on Wikipedia",
["dab-page"] = " (dab)",
},
["months"] =
{
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
},
["century"] = "century",
["BC"] = "BC",
["BCE"] = "BCE",
["ordinal"] =
{
[1] = "st",
[2] = "nd",
[3] = "rd",
["default"] = "th"
},
["filespace"] = "File",
["Unknown"] = "Unknown",
["NaN"] = "Not a number",
-- set the following to the name of a tracking category,
-- e.g. "[[Category:Articles with missing Wikidata information]]", or "" to disable:
["missinginfocat"] = "[[Category:Articles with missing Wikidata information]]",
["editonwikidata"] = "Edit this on Wikidata",
["latestdatequalifier"] = function (date) return "before " .. date end,
-- some languages, e.g. Bosnian use a period as a suffix after each number in a date
["datenumbersuffix"] = "",
["list separator"] = ", ",
["multipliers"] = {
[0] = "",
[3] = " thousand",
[6] = " million",
[9] = " billion",
[12] = " trillion",
}
}
-- This allows an internationisation module to override the above table
if 'en' ~= mw.getContentLanguage():getCode() then
require("Module:i18n").loadI18n("Module:WikidataIB/i18n", i18n)
end
-- This piece of html implements a collapsible container. Check the classes exist on your wiki.
local collapsediv = '<div class="mw-collapsible mw-collapsed" style="width:100%; overflow:auto;" data-expandtext="{{int:show}}" data-collapsetext="{{int:hide}}">'
-- Some items should not be linked.
-- Each wiki can create a list of those in Module:WikidataIB/nolinks
-- It should return a table called itemsindex, containing true for each item not to be linked
local donotlink = {}
local nolinks_exists, nolinks = pcall(mw.loadData, "Module:WikidataIB/nolinks")
if nolinks_exists then
donotlink = nolinks.itemsindex
end
-- To satisfy Wikipedia:Manual of Style/Titles, certain types of items are italicised, and others are quoted.
-- The submodule [[Module:WikidataIB/titleformats]] lists the entity-ids used in 'instance of' (P31),
-- which allows this module to identify the values that should be formatted.
-- WikidataIB/titleformats exports a table p.formats, which is indexed by entity-id, and contains the value " or ''
local formats = {}
local titleformats_exists, titleformats = pcall(mw.loadData, "Module:WikidataIB/titleformats")
if titleformats_exists then
formats = titleformats.formats
end
-------------------------------------------------------------------------------
-- Private functions
-------------------------------------------------------------------------------
--
-------------------------------------------------------------------------------
-- makeOrdinal needs to be internationalised along with the above:
-- takes cardinal number as a numeric and returns the ordinal as a string
-- we need three exceptions in English for 1st, 2nd, 3rd, 21st, .. 31st, etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local makeOrdinal = function(cardinal)
local ordsuffix = i18n.ordinal.default
if cardinal % 10 == 1 then
ordsuffix = i18n.ordinal[1]
elseif cardinal % 10 == 2 then
ordsuffix = i18n.ordinal[2]
elseif cardinal % 10 == 3 then
ordsuffix = i18n.ordinal[3]
end
-- In English, 1, 21, 31, etc. use 'st', but 11, 111, etc. use 'th'
-- similarly for 12 and 13, etc.
if (cardinal % 100 == 11) or (cardinal % 100 == 12) or (cardinal % 100 == 13) then
ordsuffix = i18n.ordinal.default
end
return tostring(cardinal) .. ordsuffix
end
-------------------------------------------------------------------------------
-- findLang takes a "langcode" parameter if supplied and valid
-- otherwise it tries to create it from the user's set language ({{int:lang}})
-- failing that it uses the wiki's content language.
-- It returns a language object
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local findLang = function(langcode)
local langobj
langcode = mw.text.trim(langcode or "")
if mw.language.isKnownLanguageTag(langcode) then
langobj = mw.language.new( langcode )
else
langcode = mw.getCurrentFrame():callParserFunction('int', {'lang'})
if mw.language.isKnownLanguageTag(langcode) then
langobj = mw.language.new( langcode )
else
langobj = mw.language.getContentLanguage()
end
end
return langobj
end
-------------------------------------------------------------------------------
-- _getItemLangCode takes a qid parameter (using the current page's qid if blank)
-- If the item for that qid has property country (P17) it looks at the first preferred value
-- If the country has an official language (P37), it looks at the first preferred value
-- If that official language has a language code (P424), it returns the first preferred value
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local _getItemLangCode = function(qid)
qid = mw.text.trim(qid or ""):upper()
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return end
local prop17 = mw.wikibase.getBestStatements(qid, "P17")[1]
if not prop17 or prop17.mainsnak.snaktype ~= "value" then return end
local qid17 = prop17.mainsnak.datavalue.value.id
local prop37 = mw.wikibase.getBestStatements(qid17, "P37")[1]
if not prop37 or prop37.mainsnak.snaktype ~= "value" then return end
local qid37 = prop37.mainsnak.datavalue.value.id
local prop424 = mw.wikibase.getBestStatements(qid37, "P424")[1]
if not prop424 or prop424.mainsnak.snaktype ~= "value" then return end
return prop424.mainsnak.datavalue.value
end
-------------------------------------------------------------------------------
-- roundto takes a number (x)
-- and returns it rounded to (sf) significant figures
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local roundto = function(x, sf)
if x == 0 then return 0 end
local s = 1
if x < 0 then
x = -x
s = -1
end
if sf < 1 then sf = 1 end
local p = 10 ^ (math.floor(math.log10(x)) - sf + 1)
x = math.floor(x / p + 0.5) * p * s
-- if it's integral, cast to an integer:
if x == math.floor(x) then x = math.floor(x) end
return x
end
-------------------------------------------------------------------------------
-- decimalToDMS takes a decimal degrees (x) with precision (p)
-- and returns degrees/minutes/seconds according to the precision
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local decimalToDMS = function(x, p)
-- if p is not supplied, use a precision around 0.1 seconds
if not tonumber(p) then p = 1e-4 end
local d = math.floor(x)
local ms = (x - d) * 60
if p > 0.5 then -- precision is > 1/2 a degree
if ms > 30 then d = d + 1 end
ms = 0
end
local m = math.floor(ms)
local s = (ms - m) * 60
if p > 0.008 then -- precision is > 1/2 a minute
if s > 30 then m = m +1 end
s = 0
elseif p > 0.00014 then -- precision is > 1/2 a second
s = math.floor(s + 0.5)
elseif p > 0.000014 then -- precision is > 1/20 second
s = math.floor(10 * s + 0.5) / 10
elseif p > 0.0000014 then -- precision is > 1/200 second
s = math.floor(100 * s + 0.5) / 100
else -- cap it at 3 dec places for now
s = math.floor(1000 * s + 0.5) / 1000
end
return d, m, s
end
-------------------------------------------------------------------------------
-- decimalPrecision takes a decimal (x) with precision (p)
-- and returns x rounded approximately to the given precision
-- precision should be between 1 and 1e-6, preferably a power of 10.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local decimalPrecision = function(x, p)
local s = 1
if x < 0 then
x = -x
s = -1
end
-- if p is not supplied, pick an arbitrary precision
if not tonumber(p) then p = 1e-4
elseif p > 1 then p = 1
elseif p < 1e-6 then p = 1e-6
else p = 10 ^ math.floor(math.log10(p))
end
x = math.floor(x / p + 0.5) * p * s
-- if it's integral, cast to an integer:
if x == math.floor(x) then x = math.floor(x) end
-- if it's less than 1e-4, it will be in exponent form, so return a string with 6dp
-- 9e-5 becomes 0.000090
if math.abs(x) < 1e-4 then x = string.format("%f", x) end
return x
end
-------------------------------------------------------------------------------
-- formatDate takes a datetime of the usual format from mw.wikibase.entity:formatPropertyValues
-- like "1 August 30 BCE" as parameter 1
-- and formats it according to the df (date format) and bc parameters
-- df = ["dmy" / "mdy" / "y"] default will be "dmy"
-- bc = ["BC" / "BCE"] default will be "BCE"
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local format_Date = function(datetime, dateformat, bc)
local datetime = datetime or "1 August 30 BCE" -- in case of nil value
-- chop off multiple vales and/or any hours, mins, etc.
-- keep anything before punctuation - we just want a single date:
local dateval = string.match( datetime, "[%w ]+")
local dateformat = string.lower(dateformat or "dmy") -- default to dmy
local bc = string.upper(bc or "") -- can't use nil for bc
-- we only want to accept two possibilities: BC or default to BCE
if bc == "BC" then
bc = " " .. i18n["BC"] -- prepend a non-breaking space.
else
bc = " " .. i18n["BCE"]
end
local postchrist = true -- start by assuming no BCE
local dateparts = {}
for word in string.gmatch(dateval, "%w+") do
if word == "BCE" or word == "BC" then -- *** internationalise later ***
postchrist = false
else
-- we'll keep the parts that are not 'BCE' in a table
dateparts[#dateparts + 1] = word
end
end
if postchrist then bc = "" end -- set AD dates to no suffix *** internationalise later ***
local sep = " " -- separator is nbsp
local fdate = table.concat(dateparts, sep) -- set formatted date to same order as input
-- if we have day month year, check dateformat
if #dateparts == 3 then
if dateformat == "y" then
fdate = dateparts[3]
elseif dateformat == "mdy" then
fdate = dateparts[2] .. sep .. dateparts[1] .. "," .. sep .. dateparts[3]
end
elseif #dateparts == 2 and dateformat == "y" then
fdate = dateparts[2]
end
return fdate .. bc
end
-------------------------------------------------------------------------------
-- dateFormat is the handler for properties that are of type "time"
-- It takes timestamp, precision (6 to 11 per mediawiki), dateformat (y/dmy/mdy), BC format (BC/BCE),
-- a plaindate switch (yes/no/adj) to en/disable "sourcing circumstances"/use adjectival form,
-- any qualifiers for the property, the language, and any adjective to use like 'before'.
-- It passes the date through the "complex date" function
-- and returns a string with the internatonalised date formatted according to preferences.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); cdate(); dp[]
-------------------------------------------------------------------------------
local dateFormat = function(timestamp, dprec, df, bcf, pd, qualifiers, lang, adj, model)
-- output formatting according to preferences (y/dmy/mdy/ymd)
df = (df or ""):lower()
-- if ymd is required, return the part of the timestamp in YYYY-MM-DD form
-- but apply Year zero#Astronomers fix: 1 BC = 0000; 2 BC = -0001; etc.
if df == "ymd" then
if timestamp:sub(1,1) == "+" then
return timestamp:sub(2,11)
else
local yr = tonumber(timestamp:sub(2,5)) - 1
yr = ("000" .. yr):sub(-4)
if yr ~= "0000" then yr = "-" .. yr end
return yr .. timestamp:sub(6,11)
end
end
-- A year can be stored like this: "+1872-00-00T00:00:00Z",
-- which is processed here as if it were the day before "+1872-01-01T00:00:00Z",
-- and that's the last day of 1871, so the year is wrong.
-- So fix the month 0, day 0 timestamp to become 1 January instead:
timestamp = timestamp:gsub("%-00%-00T", "-01-01T")
-- just in case date precision is missing
dprec = dprec or 11
-- override more precise dates if required dateformat is year alone:
if df == "y" and dprec > 9 then dprec = 9 end
-- complex date only deals with precisions from 6 to 11, so clip range
dprec = dprec>11 and 11 or dprec
dprec = dprec<6 and 6 or dprec
-- BC format is "BC" or "BCE"
bcf = (bcf or ""):upper()
-- plaindate only needs the first letter (y/n/a)
pd = (pd or ""):sub(1,1):lower()
if pd == "" or pd == "n" or pd == "f" or pd == "0" then pd = false end
-- in case language isn't passed
lang = lang or findLang().code
-- set adj as empty if nil
adj = adj or ""
-- extract the day, month, year from the timestamp
local bc = timestamp:sub(1, 1)=="-" and "BC" or ""
local year, month, day = timestamp:match("[+-](%d*)-(%d*)-(%d*)T")
local iso = tonumber(year) -- if year is missing, let it throw an error
-- this will adjust the date format to be compatible with cdate
-- possible formats are Y, YY, YYY0, YYYY, YYYY-MM, YYYY-MM-DD
if dprec == 6 then iso = math.floor( (iso - 1) / 1000 ) + 1 end
if dprec == 7 then iso = math.floor( (iso - 1) / 100 ) + 1 end
if dprec == 8 then iso = math.floor( iso / 10 ) .. "0" end
if dprec == 10 then iso = year .. "-" .. month end
if dprec == 11 then iso = year .. "-" .. month .. "-" .. day end
-- add "circa" (Q5727902) from "sourcing circumstances" (P1480)
local sc = not pd and qualifiers and qualifiers.P1480
if sc then
for k1, v1 in pairs(sc) do
if v1.datavalue and v1.datavalue.value.id == "Q5727902" then
adj = "circa"
break
end
end
end
-- deal with Julian dates:
-- no point in saying that dates before 1582 are Julian - they are by default
-- doesn't make sense for dates less precise than year
-- we can suppress it by setting |plaindate, e.g. for use in constructing categories.
local calendarmodel = ""
if tonumber(year) > 1582
and dprec > 8
and not pd
and model == "http://www.wikidata.org/entity/Q1985786" then
calendarmodel = "julian"
end
if not cdate then
cdate = require("Module:Complex date")._complex_date
end
local fdate = cdate(calendarmodel, adj, tostring(iso), dp[dprec], bc, "", "", "", "", lang, 1)
-- this may have QuickStatements info appended to it in a div, so remove that
fdate = fdate:gsub(' <div style="display: none;">[^<]*</div>', '')
-- it may also be returned wrapped in a microformat, so remove that
fdate = fdate:gsub("<[^>]*>", "")
-- there may be leading zeros that we should remove
fdate = fdate:gsub("^0*", "")
-- if a plain date is required, then remove any links (like BC linked)
if pd then
fdate = fdate:gsub("%[%[.*|", ""):gsub("]]", "")
end
-- if 'circa', use the abbreviated form *** internationalise later ***
fdate = fdate:gsub('circa ', '<abbr title="circa">c.</abbr> ')
-- deal with BC/BCE
if bcf == "BCE" then
fdate = fdate:gsub('BC', 'BCE')
end
-- deal with mdy format
if df == "mdy" then
fdate = fdate:gsub("(%d+) (%w+) (%d+)", "%2 %1, %3")
end
-- deal with adjectival form *** internationalise later ***
if pd == "a" then
fdate = fdate:gsub(' century', '-century')
end
return fdate
end
-------------------------------------------------------------------------------
-- parseParam takes a (string) parameter, e.g. from the list of frame arguments,
-- and makes "false", "no", and "0" into the (boolean) false
-- it makes the empty string and nil into the (boolean) value passed as default
-- allowing the parameter to be true or false by default.
-- It returns a boolean.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local parseParam = function(param, default)
if type(param) == "boolean" then param = tostring(param) end
if param and param ~= "" then
param = param:lower()
if (param == "false") or (param:sub(1,1) == "n") or (param == "0") then
return false
else
return true
end
else
return default
end
end
-------------------------------------------------------------------------------
-- _getSitelink takes the qid of a Wikidata entity passed as |qid=
-- It takes an optional parameter |wiki= to determine which wiki is to be checked for a sitelink
-- If the parameter is blank, then it uses the local wiki.
-- If there is a sitelink to an article available, it returns the plain text link to the article
-- If there is no sitelink, it returns nil.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local _getSitelink = function(qid, wiki)
qid = (qid or ""):upper()
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
wiki = wiki or ""
local sitelink
if wiki == "" then
sitelink = mw.wikibase.getSitelink(qid)
else
sitelink = mw.wikibase.getSitelink(qid, wiki)
end
return sitelink
end
-------------------------------------------------------------------------------
-- _getCommonslink takes an optional qid of a Wikidata entity passed as |qid=
-- It returns one of the following in order of preference:
-- the Commons sitelink of the Wikidata entity - but not if onlycat=true and it's not a category;
-- the Commons sitelink of the topic's main category of the Wikidata entity;
-- the Commons category of the Wikidata entity - unless fallback=false.
-------------------------------------------------------------------------------
-- Dependencies: _getSitelink(); parseParam()
-------------------------------------------------------------------------------
local _getCommonslink = function(qid, onlycat, fallback)
qid = (qid or ""):upper()
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
onlycat = parseParam(onlycat, false)
if fallback == "" then fallback = nil end
local sitelink = _getSitelink(qid, "commonswiki")
if onlycat and sitelink and sitelink:sub(1,9) ~= "Category:" then sitelink = nil end
if not sitelink then
-- check for topic's main category
local prop910 = mw.wikibase.getBestStatements(qid, "P910")[1]
if prop910 then
local tmcid = prop910.mainsnak.datavalue and prop910.mainsnak.datavalue.value.id
sitelink = _getSitelink(tmcid, "commonswiki")
end
if not sitelink then
-- check for list's main category
local prop1754 = mw.wikibase.getBestStatements(qid, "P1754")[1]
if prop1754 then
local tmcid = prop1754.mainsnak.datavalue and prop1754.mainsnak.datavalue.value.id
sitelink = _getSitelink(tmcid, "commonswiki")
end
end
end
if not sitelink and fallback then
-- check for Commons category (string value)
local prop373 = mw.wikibase.getBestStatements(qid, "P373")[1]
if prop373 then
sitelink = prop373.mainsnak.datavalue and prop373.mainsnak.datavalue.value
if sitelink then sitelink = "Category:" .. sitelink end
end
end
return sitelink
end
-------------------------------------------------------------------------------
-- The label in a Wikidata item is subject to vulnerabilities
-- that an attacker might try to exploit.
-- It needs to be 'sanitised' by removing any wikitext before use.
-- If it doesn't exist, return the id for the item
-- a second (boolean) value is also returned, value is true when the label exists
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local labelOrId = function(id, lang)
if lang == "default" then lang = findLang().code end
local label
if lang then
label = mw.wikibase.getLabelByLang(id, lang)
else
label = mw.wikibase.getLabel(id)
end
if label then
return mw.text.nowiki(label), true
else
return id, false
end
end
-------------------------------------------------------------------------------
-- linkedItem takes an entity-id and returns a string, linked if possible.
-- This is the handler for "wikibase-item". Preferences:
-- 1. Display linked disambiguated sitelink if it exists
-- 2. Display linked label if it is a redirect
-- 3. TBA: Display an inter-language link for the label if it exists other than in default language
-- 4. Display unlinked label if it exists
-- 5. Display entity-id for now to indicate a label could be provided
-- dtxt is text to be used instead of label, or nil.
-- shortname is boolean switch to use P1813 (short name) instead of label if true.
-- lang is the current language code.
-- uselbl is boolean switch to force display of the label instead of the sitelink (default: false)
-- linkredir is boolean switch to allow linking to a redirect (default: false)
-- formatvalue is boolean switch to allow formatting as italics or quoted (default: false)
-------------------------------------------------------------------------------
-- Dependencies: labelOrId(); donotlink[]
-------------------------------------------------------------------------------
local linkedItem = function(id, args)
local lprefix = (args.lp or args.lprefix or args.linkprefix or ""):gsub('"', '') -- toughen against nil values passed
local lpostfix = (args.lpostfix or ""):gsub('"', '')
local prefix = (args.prefix or ""):gsub('"', '')
local postfix = (args.postfix or ""):gsub('"', '')
local dtxt = args.dtxt
local shortname = args.shortname or args.sn
local lang = args.lang or "en" -- fallback to default if missing
local uselbl = args.uselabel or args.uselbl
uselbl = parseParam(uselbl, false)
local linkredir = args.linkredir
linkredir = parseParam(linkredir, false)
local formatvalue = args.formatvalue or args.fv
formatvalue = parseParam(formatvalue, false)
-- see if item might need italics or quotes
local fmt = ""
if next(formats) and formatvalue then
for k, v in ipairs( mw.wikibase.getBestStatements(id, "P31") ) do
if v.mainsnak.datavalue and formats[v.mainsnak.datavalue.value.id] then
fmt = formats[v.mainsnak.datavalue.value.id]
break -- pick the first match
end
end
end
local disp
local sitelink = mw.wikibase.getSitelink(id)
local label, islabel
if dtxt then
label, islabel = dtxt, true
elseif shortname then
-- see if there is a shortname in our language, and set label to it
for k, v in ipairs( mw.wikibase.getBestStatements(id, "P1813") ) do
if v.mainsnak.datavalue.value.language == lang then
label, islabel = v.mainsnak.datavalue.value.text, true
break
end -- test for language match
end -- loop through values of short name
-- if we have no label set, then there was no shortname available
if not islabel then
label, islabel = labelOrId(id)
shortname = false
end
else
label, islabel = labelOrId(id)
end
if mw.site.siteName ~= "Wikimedia Commons" then
if sitelink then
if not (dtxt or shortname) then
-- if sitelink and label are the same except for case, no need to process further
if sitelink:lower() ~= label:lower() then
-- strip any namespace or dab from the sitelink
local pos = sitelink:find(":") or 0
local slink = sitelink
if pos > 0 then
local pfx = sitelink:sub(1,pos-1)
if mw.site.namespaces[pfx] then -- that prefix is a valid namespace, so remove it
slink = sitelink:sub(pos+1)
end
end
-- remove stuff after commas or inside parentheses - ie. dabs
slink = slink:gsub("%s%(.+%)$", ""):gsub(",.+$", "")
-- if uselbl is false, use sitelink instead of label
if not uselbl then
-- use slink as display, preserving label case - find("^%u") is true for 1st char uppercase
if label:find("^%u") then
label = slink:gsub("^(%l)", string.upper)
else
label = slink:gsub("^(%u)", string.lower)
end
end
end
end
if donotlink[label] then
disp = prefix .. fmt .. label .. fmt .. postfix
else
disp = "[[" .. lprefix .. sitelink .. lpostfix .. "|" .. prefix .. fmt .. label .. fmt .. postfix .. "]]"
end
elseif islabel then
-- no sitelink, label exists, so check if a redirect with that title exists, if linkredir is true
-- display plain label by default
disp = prefix .. fmt .. label .. fmt .. postfix
if linkredir then
local artitle = mw.title.new(label, 0) -- only nil if label has invalid chars
if not donotlink[label] and artitle and artitle.redirectTarget then
-- there's a redirect with the same title as the label, so let's link to that
disp = "[[".. lprefix .. label .. lpostfix .. "|" .. prefix .. fmt .. label .. fmt .. postfix .. "]]"
end
end -- test if article title exists as redirect on current Wiki
else
-- no sitelink and no label, so return whatever was returned from labelOrId for now
-- add tracking category [[Category:Articles with missing Wikidata information]]
-- for enwiki, just return the tracking category
if mw.wikibase.getGlobalSiteId() == "enwiki" then
disp = i18n.missinginfocat
else
disp = prefix .. label .. postfix .. i18n.missinginfocat
end
end
else
local ccat = mw.wikibase.getBestStatements(id, "P373")[1]
if ccat and ccat.mainsnak.datavalue then
ccat = ccat.mainsnak.datavalue.value
disp = "[[" .. lprefix .. "Category:" .. ccat .. lpostfix .. "|" .. prefix .. label .. postfix .. "]]"
elseif sitelink then
-- this asumes that if a sitelink exists, then a label also exists
disp = "[[" .. lprefix .. sitelink .. lpostfix .. "|" .. prefix .. label .. postfix .. "]]"
else
-- no sitelink and no Commons cat, so return label from labelOrId for now
disp = prefix .. label .. postfix
end
end
return disp
end
-------------------------------------------------------------------------------
-- sourced takes a table representing a statement that may or may not have references
-- it looks for a reference sourced to something not containing the word "wikipedia"
-- it returns a boolean = true if it finds a sourced reference.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local sourced = function(claim)
if claim.references then
for kr, vr in pairs(claim.references) do
local ref = mw.wikibase.renderSnaks(vr.snaks)
if not ref:find("Wiki") then
return true
end
end
end
end
-------------------------------------------------------------------------------
-- setRanks takes a flag (parameter passed) that requests the values to return
-- "b[est]" returns preferred if available, otherwise normal
-- "p[referred]" returns preferred
-- "n[ormal]" returns normal
-- "d[eprecated]" returns deprecated
-- multiple values are allowed, e.g. "preferred normal" (which is the default)
-- "best" will override the other flags, and set p and n
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local setRanks = function(rank)
rank = (rank or ""):lower()
-- if nothing passed, return preferred and normal
-- if rank == "" then rank = "p n" end
local ranks = {}
for w in string.gmatch(rank, "%a+") do
w = w:sub(1,1)
if w == "b" or w == "p" or w == "n" or w == "d" then
ranks[w] = true
end
end
-- check if "best" is requested or no ranks requested; and if so, set preferred and normal
if ranks.b or not next(ranks) then
ranks.p = true
ranks.n = true
end
return ranks
end
-------------------------------------------------------------------------------
-- parseInput processes the Q-id , the blacklist and the whitelist
-- if an input parameter is supplied, it returns that and ends the call.
-- it returns (1) either the qid or nil indicating whether or not the call should continue
-- and (2) a table containing all of the statements for the propertyID and relevant Qid
-- if "best" ranks are requested, it returns those instead of all non-deprecated ranks
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local parseInput = function(frame, input_parm, property_id)
-- There may be a local parameter supplied, if it's blank, set it to nil
input_parm = mw.text.trim(input_parm or "")
if input_parm == "" then input_parm = nil end
-- return nil if Wikidata is not available
if not mw.wikibase then return false, input_parm end
local args = frame.args
-- can take a named parameter |qid which is the Wikidata ID for the article.
-- if it's not supplied, use the id for the current page
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
-- if there's no Wikidata item for the current page return nil
if not qid then return false, input_parm end
-- The blacklist is passed in named parameter |suppressfields
local blacklist = args.suppressfields or args.spf or ""
-- The whitelist is passed in named parameter |fetchwikidata
local whitelist = args.fetchwikidata or args.fwd or ""
if whitelist == "" then whitelist = "NONE" end
-- The name of the field that this function is called from is passed in named parameter |name
local fieldname = args.name or ""
if blacklist ~= "" then
-- The name is compulsory when blacklist is used, so return nil if it is not supplied
if fieldname == "" then return false, nil end
-- If this field is on the blacklist, then return nil
if blacklist:find(fieldname) then return false, nil end
end
-- If we got this far then we're not on the blacklist
-- The blacklist overrides any locally supplied parameter as well
-- If a non-blank input parameter was supplied return it
if input_parm then return false, input_parm end
-- We can filter out non-valid properties
if property_id:sub(1,1):upper() ~="P" or property_id == "P0" then return false, nil end
-- Otherwise see if this field is on the whitelist:
-- needs a bit more logic because find will return its second value = 0 if fieldname is ""
-- but nil if fieldname not found on whitelist
local _, found = whitelist:find(fieldname)
found = ((found or 0) > 0)
if whitelist ~= 'ALL' and (whitelist:upper() == "NONE" or not found) then
return false, nil
end
-- See what's on Wikidata (the call always returns a table, but it may be empty):
local props = {}
if args.reqranks.b then
props = mw.wikibase.getBestStatements(qid, property_id)
else
props = mw.wikibase.getAllStatements(qid, property_id)
end
if props[1] then
return qid, props
end
-- no property on Wikidata
return false, nil
end
-------------------------------------------------------------------------------
-- createicon assembles the "Edit at Wikidata" pen icon.
-- It returns a wikitext string inside a span class="penicon"
-- if entityID is nil or empty, the ID associated with current page is used
-- langcode and propertyID may be nil or empty
-------------------------------------------------------------------------------
-- Dependencies: i18n[];
-------------------------------------------------------------------------------
local createicon = function(langcode, entityID, propertyID)
langcode = langcode or ""
if not entityID or entityID == "" then entityID= mw.wikibase.getEntityIdForCurrentPage() end
propertyID = propertyID or ""
local icon = " <span class='penicon autoconfirmed-show'>[["
-- " <span data-bridge-edit-flow='overwrite' class='penicon'>[[" -> enable Wikidata Bridge
.. i18n["filespace"]
.. ":OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt="
.. i18n["editonwikidata"]
.. "|link=https://www.wikidata.org/wiki/" .. entityID
if langcode ~= "" then icon = icon .. "?uselang=" .. langcode end
if propertyID ~= "" then icon = icon .. "#" .. propertyID end
icon = icon .. "|" .. i18n["editonwikidata"] .. "]]</span>"
return icon
end
-------------------------------------------------------------------------------
-- assembleoutput takes the sequence table containing the property values
-- and formats it according to switches given. It returns a string or nil.
-- It uses the entityID (and optionally propertyID) to create a link in the pen icon.
-------------------------------------------------------------------------------
-- Dependencies: parseParam();
-------------------------------------------------------------------------------
local assembleoutput = function(out, args, entityID, propertyID)
-- sorted is a boolean passed to enable sorting of the values returned
-- if nothing or an empty string is passed set it false
-- if "false" or "no" or "0" is passed set it false
local sorted = parseParam(args.sorted, false)
-- noicon is a boolean passed to suppress the trailing "edit at Wikidata" icon
-- for use when the value is processed further by the infobox
-- if nothing or an empty string is passed set it false
-- if "false" or "no" or "0" is passed set it false
local noic = parseParam(args.noicon, false)
-- list is the name of a template that a list of multiple values is passed through
-- examples include "hlist" and "ubl"
-- setting it to "prose" produces something like "1, 2, 3, and 4"
local list = args.list or ""
-- sep is a string that is used to separate multiple returned values
-- if nothing or an empty string is passed set it to the default
-- any double-quotes " are stripped out, so that spaces may be passed
-- e.g. |sep=" - "
local sepdefault = i18n["list separator"]
local separator = args.sep or ""
separator = string.gsub(separator, '"', '')
if separator == "" then
separator = sepdefault
end
-- collapse is a number that determines the maximum number of returned values
-- before the output is collapsed.
-- Zero or not a number result in no collapsing (default becomes 0).
local collapse = tonumber(args.collapse) or 0
-- replacetext (rt) is a string that is returned instead of any non-empty Wikidata value
-- this is useful for tracking and debugging
local replacetext = mw.text.trim(args.rt or args.replacetext or "")
-- if there's anything to return, then return a list
-- comma-separated by default, but may be specified by the sep parameter
-- optionally specify a hlist or ubl or a prose list, etc.
local strout
if #out > 0 then
if sorted then table.sort(out) end
-- if there's something to display and a pen icon is wanted, add it the end of the last value
local hasdisplay = false
for i, v in ipairs(out) do
if v ~= i18n.missinginfocat then
hasdisplay = true
break
end
end
if not noic and hasdisplay then
out[#out] = out[#out] .. createicon(args.langobj.code, entityID, propertyID)
end
if list == "" then
strout = table.concat(out, separator)
elseif list:lower() == "prose" then
strout = mw.text.listToText( out )
else
strout = mw.getCurrentFrame():expandTemplate{title = list, args = out}
end
if collapse >0 and #out > collapse then
strout = collapsediv .. strout .. "</div>"
end
else
strout = nil -- no items had valid reference
end
if replacetext ~= "" and strout then strout = replacetext end
return strout
end
-------------------------------------------------------------------------------
-- rendersnak takes a table (propval) containing the information stored on one property value
-- and returns the value as a string and its language if monolingual text.
-- It handles data of type:
-- wikibase-item
-- time
-- string, url, commonsMedia, external-id
-- quantity
-- globe-coordinate
-- monolingualtext
-- It also requires linked, the link/pre/postfixes, uabbr, and the arguments passed from frame.
-- The optional filter parameter allows quantities to be be filtered by unit Qid.
-------------------------------------------------------------------------------
-- Dependencies: parseParam(); labelOrId(); i18n[]; dateFormat();
-- roundto(); decimalPrecision(); decimalToDMS(); linkedItem();
-------------------------------------------------------------------------------
local rendersnak = function(propval, args, linked, lpre, lpost, pre, post, uabbr, filter)
lpre = lpre or ""
lpost = lpost or ""
pre = pre or ""
post = post or ""
args.lang = args.lang or findLang().code
-- allow values to display a fixed text instead of label
local dtxt = args.displaytext or args.dt
if dtxt == "" then dtxt = nil end
-- switch to use display of short name (P1813) instead of label
local shortname = args.shortname or args.sn
shortname = parseParam(shortname, false)
local snak = propval.mainsnak or propval
local dtype = snak.datatype
local dv = snak.datavalue
dv = dv and dv.value
-- value and monolingual text language code returned
local val, mlt
if propval.rank and not args.reqranks[propval.rank:sub(1, 1)] then
-- val is nil: value has a rank that isn't requested
------------------------------------
elseif snak.snaktype == "somevalue" then -- value is unknown
val = i18n["Unknown"]
------------------------------------
elseif snak.snaktype == "novalue" then -- value is none
-- val = "No value" -- don't return anything
------------------------------------
elseif dtype == "wikibase-item" then -- data type is a wikibase item:
-- it's wiki-linked value, so output as link if enabled and possible
local qnumber = dv.id
if linked then
val = linkedItem(qnumber, args)
else -- no link wanted so check for display-text, otherwise test for lang code
local label, islabel
if dtxt then
label = dtxt
else
label, islabel = labelOrId(qnumber)
local langlabel = mw.wikibase.getLabelByLang(qnumber, args.lang)
if langlabel then
label = mw.text.nowiki( langlabel )
end
end
val = pre .. label .. post
end -- test for link required
------------------------------------
elseif dtype == "time" then -- data type is time:
-- time is in timestamp format
-- date precision is integer per mediawiki
-- output formatting according to preferences (y/dmy/mdy)
-- BC format as BC or BCE
-- plaindate is passed to disable looking for "sourcing cirumstances"
-- or to set the adjectival form
-- qualifiers (if any) is a nested table or nil
-- lang is given, or user language, or site language
--
-- Here we can check whether args.df has a value
-- If not, use code from Module:Sandbox/RexxS/Getdateformat to set it from templates like {{Use mdy dates}}
val = dateFormat(dv.time, dv.precision, args.df, args.bc, args.pd, propval.qualifiers, args.lang, "", dv.calendarmodel)
------------------------------------
-- data types which are strings:
elseif dtype == "commonsMedia" or dtype == "external-id" or dtype == "string" or dtype == "url" then
-- commonsMedia or external-id or string or url
-- all have mainsnak.datavalue.value as string
if (lpre == "" or lpre == ":") and lpost == "" then
-- don't link if no linkpre/postfix or linkprefix is just ":"
val = pre .. dv .. post
elseif dtype == "external-id" then
val = "[" .. lpre .. dv .. lpost .. " " .. pre .. dv .. post .. "]"
else
val = "[[" .. lpre .. dv .. lpost .. "|" .. pre .. dv .. post .. "]]"
end -- check for link requested (i.e. either linkprefix or linkpostfix exists)
------------------------------------
-- data types which are quantities:
elseif dtype == "quantity" then
-- quantities have mainsnak.datavalue.value.amount and mainsnak.datavalue.value.unit
-- the unit is of the form http://www.wikidata.org/entity/Q829073
--
-- implement a switch to turn on/off numerical formatting later
local fnum = true
--
-- a switch to turn on/off conversions - only for en-wiki
local conv = parseParam(args.conv or args.convert, false)
-- if we have conversions, we won't have formatted numbers or scales
if conv then
uabbr = true
fnum = false
args.scale = "0"
end
--
-- a switch to turn on/off showing units, default is true
local showunits = parseParam(args.su or args.showunits, true)
--
-- convert amount to a number
local amount = tonumber(dv.amount) or i18n["NaN"]
--
-- scale factor for millions, billions, etc.
local sc = tostring(args.scale or ""):sub(1,1):lower()
local scale
if sc == "a" then
-- automatic scaling
if amount > 1e15 then
scale = 12
elseif amount > 1e12 then
scale = 9
elseif amount > 1e9 then
scale = 6
elseif amount > 1e6 then
scale = 3
else
scale = 0
end
else
scale = tonumber(args.scale) or 0
if scale < 0 or scale > 12 then scale = 0 end
scale = math.floor(scale/3) * 3
end
local factor = 10^scale
amount = amount / factor
-- ranges:
local range = ""
-- check if upper and/or lower bounds are given and significant
local upb = tonumber(dv.upperBound)
local lowb = tonumber(dv.lowerBound)
if upb and lowb then
-- differences rounded to 2 sig fig:
local posdif = roundto(upb - amount, 2) / factor
local negdif = roundto(amount - lowb, 2) / factor
upb, lowb = amount + posdif, amount - negdif
-- round scaled numbers to integers or 4 sig fig
if (scale > 0 or sc == "a") then
if amount < 1e4 then
amount = roundto(amount, 4)
else
amount = math.floor(amount + 0.5)
end
end
if fnum then amount = args.langobj:formatNum( amount ) end
if posdif ~= negdif then
-- non-symmetrical
range = " +" .. posdif .. " -" .. negdif
elseif posdif ~= 0 then
-- symmetrical and non-zero
range = " ±" .. posdif
else
-- otherwise range is zero, so leave it as ""
end
else
-- round scaled numbers to integers or 4 sig fig
if (scale > 0 or sc == "a") then
if amount < 1e4 then
amount = roundto(amount, 4)
else
amount = math.floor(amount + 0.5)
end
end
if fnum then amount = args.langobj:formatNum( amount ) end
end
-- unit names and symbols:
-- extract the qid in the form 'Qnnn' from the value.unit url
-- and then fetch the label from that - or symbol if unitabbr is true
local unit = ""
local usep = ""
local usym = ""
local unitqid = string.match( dv.unit, "(Q%d+)" )
if filter and unitqid ~= filter then return nil end
if unitqid and showunits then
local uname = mw.wikibase.getLabelByLang(unitqid, args.lang) or ""
if uname ~= "" then usep, unit = " ", uname end
if uabbr then
-- see if there's a unit symbol (P5061)
local unitsymbols = mw.wikibase.getBestStatements(unitqid, "P5061")
-- construct fallback table, add local lang and multiple languages
local fbtbl = mw.language.getFallbacksFor( args.lang )
table.insert( fbtbl, 1, args.lang )
table.insert( fbtbl, 1, "mul" )
local found = false
for idx1, us in ipairs(unitsymbols) do
for idx2, fblang in ipairs(fbtbl) do
if us.mainsnak.datavalue.value.language == fblang then
usym = us.mainsnak.datavalue.value.text
found = true
break
end
if found then break end
end -- loop through fallback table
end -- loop through values of P5061
if found then usep, unit = " ", usym end
end
end
-- format display:
if conv then
if range == "" then
val = mw.getCurrentFrame():expandTemplate{title = "cvt", args = {amount, unit}}
else
val = mw.getCurrentFrame():expandTemplate{title = "cvt", args = {lowb, "to", upb, unit}}
end
elseif unit == "$" or unit == "£" then
val = unit .. amount .. range .. i18n.multipliers[scale]
else
val = amount .. range .. i18n.multipliers[scale] .. usep .. unit
end
------------------------------------
-- datatypes which are global coordinates:
elseif dtype == "globe-coordinate" then
-- 'display' parameter defaults to "inline, title" *** unused for now ***
-- local disp = args.display or ""
-- if disp == "" then disp = "inline, title" end
--
-- format parameter switches from deg/min/sec to decimal degrees
-- default is deg/min/sec -- decimal degrees needs |format = dec
local form = (args.format or ""):lower():sub(1,3)
if form ~= "dec" then form = "dms" end -- not needed for now
--
-- show parameter allows just the latitude, or just the longitude, or both
-- to be returned as a signed decimal, ignoring the format parameter.
local show = (args.show or ""):lower()
if show ~= "longlat" then show = show:sub(1,3) end
--
local lat, long, prec = dv.latitude, dv.longitude, dv.precision
if show == "lat" then
val = decimalPrecision(lat, prec)
elseif show == "lon" then
val = decimalPrecision(long, prec)
elseif show == "longlat" then
val = decimalPrecision(long, prec) .. ", " .. decimalPrecision(lat, prec)
else
local ns = "N"
local ew = "E"
if lat < 0 then
ns = "S"
lat = - lat
end
if long < 0 then
ew = "W"
long = - long
end
if form == "dec" then
lat = decimalPrecision(lat, prec)
long = decimalPrecision(long, prec)
val = lat .. "°" .. ns .. " " .. long .. "°" .. ew
else
local latdeg, latmin, latsec = decimalToDMS(lat, prec)
local longdeg, longmin, longsec = decimalToDMS(long, prec)
if latsec == 0 and longsec == 0 then
if latmin == 0 and longmin == 0 then
val = latdeg .. "°" .. ns .. " " .. longdeg .. "°" .. ew
else
val = latdeg .. "°" .. latmin .. "′" .. ns .. " "
val = val .. longdeg .. "°".. longmin .. "′" .. ew
end
else
val = latdeg .. "°" .. latmin .. "′" .. latsec .. "″" .. ns .. " "
val = val .. longdeg .. "°" .. longmin .. "′" .. longsec .. "″" .. ew
end
end
end
------------------------------------
elseif dtype == "monolingualtext" then -- data type is Monolingual text:
-- has mainsnak.datavalue.value as a table containing language/text pairs
-- collect all the values in 'out' and languages in 'mlt' and process them later
val = pre .. dv.text .. post
mlt = dv.language
------------------------------------
else
-- some other data type so write a specific handler
val = "unknown data type: " .. dtype
end -- of datatype/unknown value/sourced check
return val, mlt
end
-------------------------------------------------------------------------------
-- propertyvalueandquals takes a property object, the arguments passed from frame,
-- and a qualifier propertyID.
-- It returns a sequence (table) of values representing the values of that property
-- and qualifiers that match the qualifierID if supplied.
-------------------------------------------------------------------------------
-- Dependencies: parseParam(); sourced(); labelOrId(); i18n.latestdatequalifier(); format_Date();
-- makeOrdinal(); roundto(); decimalPrecision(); decimalToDMS(); assembleoutput();
-------------------------------------------------------------------------------
local function propertyvalueandquals(objproperty, args, qualID)
-- needs this style of declaration because it's re-entrant
-- onlysourced is a boolean passed to return only values sourced to other than Wikipedia
-- if nothing or an empty string is passed set it true
local onlysrc = parseParam(args.onlysourced or args.osd, true)
-- linked is a a boolean that enables the link to a local page via sitelink
-- if nothing or an empty string is passed set it true
local linked = parseParam(args.linked, true)
-- prefix is a string that may be nil, empty (""), or a string of characters
-- this is prefixed to each value
-- useful when when multiple values are returned
-- any double-quotes " are stripped out, so that spaces may be passed
local prefix = (args.prefix or ""):gsub('"', '')
-- postfix is a string that may be nil, empty (""), or a string of characters
-- this is postfixed to each value
-- useful when when multiple values are returned
-- any double-quotes " are stripped out, so that spaces may be passed
local postfix = (args.postfix or ""):gsub('"', '')
-- linkprefix is a string that may be nil, empty (""), or a string of characters
-- this creates a link and is then prefixed to each value
-- useful when when multiple values are returned and indirect links are needed
-- any double-quotes " are stripped out, so that spaces may be passed
local lprefix = (args.linkprefix or args.lp or ""):gsub('"', '')
-- linkpostfix is a string that may be nil, empty (""), or a string of characters
-- this is postfixed to each value when linking is enabled with lprefix
-- useful when when multiple values are returned
-- any double-quotes " are stripped out, so that spaces may be passed
local lpostfix = (args.linkpostfix or ""):gsub('"', '')
-- wdlinks is a boolean passed to enable links to Wikidata when no article exists
-- if nothing or an empty string is passed set it false
local wdl = parseParam(args.wdlinks or args.wdl, false)
-- unitabbr is a boolean passed to enable unit abbreviations for common units
-- if nothing or an empty string is passed set it false
local uabbr = parseParam(args.unitabbr or args.uabbr, false)
-- qualsonly is a boolean passed to return just the qualifiers
-- if nothing or an empty string is passed set it false
local qualsonly = parseParam(args.qualsonly or args.qo, false)
-- maxvals is a string that may be nil, empty (""), or a number
-- this determines how many items may be returned when multiple values are available
-- setting it = 1 is useful where the returned string is used within another call, e.g. image
local maxvals = tonumber(args.maxvals) or 0
-- pd (plain date) is a string: yes/true/1 | no/false/0 | adj
-- to disable/enable "sourcing cirumstances" or use adjectival form for the plain date
local pd = args.plaindate or args.pd or "no"
args.pd = pd
-- allow qualifiers to have a different date format; default to year unless qualsonly is set
args.qdf = args.qdf or args.qualifierdateformat or args.df or (not qualsonly and "y")
local lang = args.lang or findLang().code
-- qualID is a string list of wanted qualifiers or "ALL"
qualID = qualID or ""
-- capitalise list of wanted qualifiers and substitute "DATES"
qualID = qualID:upper():gsub("DATES", "P580, P582")
local allflag = (qualID == "ALL")
-- create table of wanted qualifiers as key
local qwanted = {}
-- create sequence of wanted qualifiers
local qorder = {}
for q in mw.text.gsplit(qualID, "%p") do -- split at punctuation and iterate
local qtrim = mw.text.trim(q)
if qtrim ~= "" then
qwanted[mw.text.trim(q)] = true
qorder[#qorder+1] = qtrim
end
end
-- qsep is the output separator for rendering qualifier list
local qsep = (args.qsep or ""):gsub('"', '')
-- qargs are the arguments to supply to assembleoutput()
local qargs = {
["osd"] = "false",
["linked"] = tostring(linked),
["prefix"] = args.qprefix,
["postfix"] = args.qpostfix,
["linkprefix"] = args.qlinkprefix or args.qlp,
["linkpostfix"] = args.qlinkpostfix,
["wdl"] = "false",
["unitabbr"] = tostring(uabbr),
["maxvals"] = 0,
["sorted"] = tostring(args.qsorted),
["noicon"] = "true",
["list"] = args.qlist,
["sep"] = qsep,
["langobj"] = args.langobj,
["lang"] = args.langobj.code,
["df"] = args.qdf,
["sn"] = parseParam(args.qsn or args.qshortname, false),
}
-- all proper values of a Wikidata property will be the same type as the first
-- qualifiers don't have a mainsnak, properties do
local datatype = objproperty[1].datatype or objproperty[1].mainsnak.datatype
-- out[] holds the a list of returned values for this property
-- mlt[] holds the language code if the datatype is monolingual text
local out = {}
local mlt = {}
for k, v in ipairs(objproperty) do
local hasvalue = true
if (onlysrc and not sourced(v)) then
-- no value: it isn't sourced when onlysourced=true
hasvalue = false
else
local val, lcode = rendersnak(v, args, linked, lprefix, lpostfix, prefix, postfix, uabbr)
if not val then
hasvalue = false -- rank doesn't match
elseif qualsonly and qualID then
-- suppress value returned: only qualifiers are requested
else
out[#out+1], mlt[#out+1] = val, lcode
end
end
-- See if qualifiers are to be returned:
local snak = v.mainsnak or v
if hasvalue and v.qualifiers and qualID ~= "" and snak.snaktype~="novalue" then
-- collect all wanted qualifier values returned in qlist, indexed by propertyID
local qlist = {}
local timestart, timeend = "", ""
-- loop through qualifiers
for k1, v1 in pairs(v.qualifiers) do
if allflag or qwanted[k1] then
if k1 == "P1326" then
local ts = v1[1].datavalue.value.time
local dp = v1[1].datavalue.value.precision
qlist[k1] = dateFormat(ts, dp, args.qdf, args.bc, pd, "", lang, "before")
elseif k1 == "P1319" then
local ts = v1[1].datavalue.value.time
local dp = v1[1].datavalue.value.precision
qlist[k1] = dateFormat(ts, dp, args.qdf, args.bc, pd, "", lang, "after")
elseif k1 == "P580" then
timestart = propertyvalueandquals(v1, qargs)[1] or "" -- treat only one start time as valid
elseif k1 == "P582" then
timeend = propertyvalueandquals(v1, qargs)[1] or "" -- treat only one end time as valid
else
local q = assembleoutput(propertyvalueandquals(v1, qargs), qargs)
-- we already deal with circa via 'sourcing circumstances' if the datatype was time
-- circa may be either linked or unlinked *** internationalise later ***
if datatype ~= "time" or q ~= "circa" and not (type(q) == "string" and q:find("circa]]")) then
qlist[k1] = q
end
end
end -- of test for wanted
end -- of loop through qualifiers
-- set date separator
local t = timestart .. timeend
-- *** internationalise date separators later ***
local dsep = "–"
if t:find("%s") or t:find(" ") then dsep = " – " end
-- set the order for the list of qualifiers returned; start time and end time go last
if next(qlist) then
local qlistout = {}
if allflag then
for k2, v2 in pairs(qlist) do
qlistout[#qlistout+1] = v2
end
else
for i2, v2 in ipairs(qorder) do
qlistout[#qlistout+1] = qlist[v2]
end
end
if t ~= "" then
qlistout[#qlistout+1] = timestart .. dsep .. timeend
end
local qstr = assembleoutput(qlistout, qargs)
if qualsonly then
out[#out+1] = qstr
else
out[#out] = out[#out] .. " (" .. qstr .. ")"
end
elseif t ~= "" then
if qualsonly then
if timestart == "" then
out[#out+1] = timeend
elseif timeend == "" then
out[#out+1] = timestart
else
out[#out+1] = timestart .. dsep .. timeend
end
else
out[#out] = out[#out] .. " (" .. timestart .. dsep .. timeend .. ")"
end
end
end -- of test for qualifiers wanted
if maxvals > 0 and #out >= maxvals then break end
end -- of for each value loop
-- we need to pick one value to return if the datatype was "monolingualtext"
-- if there's only one value, use that
-- otherwise look through the fallback languages for a match
if datatype == "monolingualtext" and #out >1 then
lang = mw.text.split( lang, '-', true )[1]
local fbtbl = mw.language.getFallbacksFor( lang )
table.insert( fbtbl, 1, lang )
local bestval = ""
local found = false
for idx1, lang1 in ipairs(fbtbl) do
for idx2, lang2 in ipairs(mlt) do
if (lang1 == lang2) and not found then
bestval = out[idx2]
found = true
break
end
end -- loop through values of property
end -- loop through fallback languages
if found then
-- replace output table with a table containing the best value
out = { bestval }
else
-- more than one value and none of them on the list of fallback languages
-- sod it, just give them the first one
out = { out[1] }
end
end
return out
end
-------------------------------------------------------------------------------
-- Common code for p.getValueByQual and p.getValueByLang
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; assembleoutput;
-------------------------------------------------------------------------------
local _getvaluebyqual = function(frame, qualID, checkvalue)
-- The property ID that will have a qualifier is the first unnamed parameter
local propertyID = mw.text.trim(frame.args[1] or "")
if propertyID == "" then return "no property supplied" end
if qualID == "" then return "no qualifier supplied" end
-- onlysourced is a boolean passed to return property values
-- only when property values are sourced to something other than Wikipedia
-- if nothing or an empty string is passed set it true
-- if "false" or "no" or 0 is passed set it false
local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)
-- set the requested ranks flags
frame.args.reqranks = setRanks(frame.args.rank)
-- set a language object and code in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local args = frame.args
-- check for locally supplied parameter in second unnamed parameter
-- success means no local parameter and the property exists
local qid, props = parseInput(frame, args[2], propertyID)
local linked = parseParam(args.linked, true)
local lpre = (args.linkprefix or args.lp or ""):gsub('"', '')
local lpost = (args.linkpostfix or ""):gsub('"', '')
local pre = (args.prefix or ""):gsub('"', '')
local post = (args.postfix or ""):gsub('"', '')
local uabbr = parseParam(args.unitabbr or args.uabbr, false)
local filter = (args.unit or ""):upper()
local maxvals = tonumber(args.maxvals) or 0
if filter == "" then filter = nil end
if qid then
local out = {}
-- Scan through the values of the property
-- we want something like property is "pronunciation audio (P443)" in propertyID
-- with a qualifier like "language of work or name (P407)" in qualID
-- whose value has the required ID, like "British English (Q7979)", in qval
for k1, v1 in ipairs(props) do
if v1.mainsnak.snaktype == "value" then
-- check if it has the right qualifier
local v1q = v1.qualifiers
if v1q and v1q[qualID] then
if onlysrc == false or sourced(v1) then
-- if we've got this far, we have a (sourced) claim with qualifiers
-- so see if matches the required value
-- We'll only deal with wikibase-items and strings for now
if v1q[qualID][1].datatype == "wikibase-item" then
if checkvalue(v1q[qualID][1].datavalue.value.id) then
out[#out + 1] = rendersnak(v1, args, linked, lpre, lpost, pre, post, uabbr, filter)
end
elseif v1q[qualID][1].datatype == "string" then
if checkvalue(v1q[qualID][1].datavalue.value) then
out[#out + 1] = rendersnak(v1, args, linked, lpre, lpost, pre, post, uabbr, filter)
end
end
end -- of check for sourced
end -- of check for matching required value and has qualifiers
else
return nil
end -- of check for string
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through values of propertyID
return assembleoutput(out, frame.args, qid, propertyID)
else
return props -- either local parameter or nothing
end -- of test for success
return nil
end
-------------------------------------------------------------------------------
-- _location takes Q-id and follows P276 (location)
-- or P131 (located in the administrative territorial entity) or P706 (located on terrain feature)
-- from the initial item to higher level territories/locations until it reaches the highest.
-- An optional boolean, 'first', determines whether the first item is returned (default: false).
-- An optional boolean 'skip' toggles the display to skip to the last item (default: false).
-- It returns a table containing the locations - linked where possible, except for the highest.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); labelOrId(); linkedItem
-------------------------------------------------------------------------------
local _location = function(qid, first, skip)
first = parseParam(first, false)
skip = parseParam(skip, false)
local locs = {"P276", "P131", "P706"}
local out = {}
local langcode = findLang():getCode()
local finished = false
local count = 0
local prevqid = "Q0"
repeat
local prop
for i1, v1 in ipairs(locs) do
local proptbl = mw.wikibase.getBestStatements(qid, v1)
if #proptbl > 1 then
-- there is more than one higher location
local prevP131, prevP131id
if prevqid ~= "Q0" then
prevP131 = mw.wikibase.getBestStatements(prevqid, "P131")[1]
prevP131id = prevP131
and prevP131.mainsnak.datavalue
and prevP131.mainsnak.datavalue.value.id
end
for i2, v2 in ipairs(proptbl) do
local parttbl = v2.qualifiers and v2.qualifiers.P518
if parttbl then
-- this higher location has qualifier 'applies to part' (P518)
for i3, v3 in ipairs(parttbl) do
if v3.snaktype == "value" and v3.datavalue.value.id == prevqid then
-- it has a value equal to the previous location
prop = proptbl[i2]
break
end -- of test for matching last location
end -- of loop through values of 'applies to part'
else
-- there's no qualifier 'applies to part' (P518)
-- so check if the previous location had a P131 that matches this alternate
if qid == prevP131id then
prop = proptbl[i2]
break
end -- of test for matching previous P131
end
end -- of loop through parent locations
-- fallback to second value if match not found
prop = prop or proptbl[2]
elseif #proptbl > 0 then
prop = proptbl[1]
end
if prop then break end
end
-- check if it's an instance of (P31) a country (Q6256) or sovereign state (Q3624078)
-- and terminate the chain if it is
local inst = mw.wikibase.getAllStatements(qid, "P31")
if #inst > 0 then
for k, v in ipairs(inst) do
local instid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id
-- stop if it's a country (or a country within the United Kingdom if skip is true)
if instid == "Q6256" or instid == "Q3624078" or (skip and instid == "Q3336843") then
prop = nil -- this will ensure this is treated as top-level location
break
end
end
end
-- get the name of this location and update qid to point to the parent location
if prop and prop.mainsnak.datavalue then
if not skip or count == 0 then
local args = { lprefix = ":" }
out[#out+1] = linkedItem(qid, args) -- get a linked value if we can
end
qid, prevqid = prop.mainsnak.datavalue.value.id, qid
else
-- This is top-level location, so get short name except when this is the first item
-- Use full label if there's no short name or this is the first item
local prop1813 = mw.wikibase.getAllStatements(qid, "P1813")
-- if there's a short name and this isn't the only item
if prop1813[1] and (#out > 0)then
local shortname
-- short name is monolingual text, so look for match to the local language
-- choose the shortest 'short name' in that language
for k, v in pairs(prop1813) do
if v.mainsnak.datavalue.value.language == langcode then
local name = v.mainsnak.datavalue.value.text
if (not shortname) or (#name < #shortname) then
shortname = name
end
end
end
-- add the shortname if one is found, fallback to the label
-- but skip it if it's "USA"
if shortname ~= "USA" then
out[#out+1] = shortname or labelOrId(qid)
else
if skip then out[#out+1] = "US" end
end
else
-- no shortname, so just add the label
local loc = labelOrId(qid)
-- exceptions go here:
if loc == "United States of America" then
out[#out+1] = "United States"
else
out[#out+1] = loc
end
end
finished = true
end
count = count + 1
until finished or count >= 10 -- limit to 10 levels to avoid infinite loops
-- remove the first location if not required
if not first then table.remove(out, 1) end
-- we might have duplicate text for consecutive locations, so remove them
if #out > 2 then
local plain = {}
for i, v in ipairs(out) do
-- strip any links
plain[i] = v:gsub("^%[%[[^|]*|", ""):gsub("]]$", "")
end
local idx = 2
repeat
if plain[idx] == plain[idx-1] then
-- duplicate found
local removeidx = 0
if (plain[idx] ~= out[idx]) and (plain[idx-1] == out[idx-1]) then
-- only second one is linked, so drop the first
removeidx = idx - 1
elseif (plain[idx] == out[idx]) and (plain[idx-1] ~= out[idx-1]) then
-- only first one is linked, so drop the second
removeidx = idx
else
-- pick one
removeidx = idx - (os.time()%2)
end
table.remove(out, removeidx)
table.remove(plain, removeidx)
else
idx = idx +1
end
until idx >= #out
end
return out
end
-------------------------------------------------------------------------------
-- _getsumofparts scans the property 'has part' (P527) for values matching a list.
-- The list (args.vlist) consists of a string of Qids separated by spaces or any usual punctuation.
-- If the matched values have a qualifer 'quantity' (P1114), those quantites are summed.
-- The sum is returned as a number (i.e. 0 if none)
-- a table of arguments is supplied implementing the usual parameters.
-------------------------------------------------------------------------------
-- Dependencies: setRanks; parseParam; parseInput; sourced; assembleoutput;
-------------------------------------------------------------------------------
local _getsumofparts = function(args)
local vallist = (args.vlist or ""):upper()
if vallist == "" then return end
args.reqranks = setRanks(args.rank)
local f = {}
f.args = args
local qid, props = parseInput(f, "", "P527")
if not qid then return 0 end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local sum = 0
for k1, v1 in ipairs(props) do
if (onlysrc == false or sourced(v1))
and v1.mainsnak.snaktype == "value"
and v1.mainsnak.datavalue.type == "wikibase-entityid"
and vallist:match( v1.mainsnak.datavalue.value.id )
and v1.qualifiers
then
local quals = v1.qualifiers["P1114"]
if quals then
for k2, v2 in ipairs(quals) do
sum = sum + v2.datavalue.value.amount
end
end
end
end
return sum
end
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Public functions
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- _getValue makes the functionality of getValue available to other modules
-------------------------------------------------------------------------------
-- Dependencies: setRanks; parseInput; propertyvalueandquals; assembleoutput; parseParam; sourced;
-- labelOrId; i18n.latestdatequalifier; format_Date; makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p._getValue = function(args)
-- parameter sets for commonly used groups of parameters
local paraset = tonumber(args.ps or args.parameterset or 0)
if paraset == 1 then
-- a common setting
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
elseif paraset == 2 then
-- equivalent to raw
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
args.linked = "no"
args.pd = "true"
elseif paraset == 3 then
-- third set goes here
end
-- implement eid parameter
local eid = args.eid
if eid == "" then
return nil
elseif eid then
args.qid = eid
end
local propertyID = mw.text.trim(args[1] or "")
args.reqranks = setRanks(args.rank)
-- replacetext (rt) is a string that is returned instead of any non-empty Wikidata value
-- this is useful for tracking and debugging, so we set fetchwikidata=ALL to fill the whitelist
local replacetext = mw.text.trim(args.rt or args.replacetext or "")
if replacetext ~= "" then
args.fetchwikidata = "ALL"
end
local f = {}
f.args = args
local entityid, props = parseInput(f, f.args[2], propertyID)
if not entityid then
return props -- either the input parameter or nothing
end
-- qual is a string containing the property ID of the qualifier(s) to be returned
-- if qual == "ALL" then all qualifiers returned
-- if qual == "DATES" then qualifiers P580 (start time) and P582 (end time) returned
-- if nothing or an empty string is passed set it nil -> no qualifiers returned
local qualID = mw.text.trim(args.qual or ""):upper()
if qualID == "" then qualID = nil end
-- set a language object and code in the args table
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
-- table 'out' stores the return value(s):
local out = propertyvalueandquals(props, args, qualID)
-- format the table of values and return it as a string:
return assembleoutput(out, args, entityid, propertyID)
end
-------------------------------------------------------------------------------
-- getValue is used to get the value(s) of a property
-- The property ID is passed as the first unnamed parameter and is required.
-- A locally supplied parameter may optionaly be supplied as the second unnamed parameter.
-- The function will now also return qualifiers if parameter qual is supplied
-------------------------------------------------------------------------------
-- Dependencies: _getValue; setRanks; parseInput; propertyvalueandquals; assembleoutput; parseParam; sourced;
-- labelOrId; i18n.latestdatequalifier; format_Date; makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p.getValue = function(frame)
local args= frame.args
if not args[1] then
args = frame:getParent().args
if not args[1] then return i18n.errors["No property supplied"] end
end
return p._getValue(args)
end
-------------------------------------------------------------------------------
-- getPreferredValue is used to get a value,
-- (or a comma separated list of them if multiple values exist).
-- If preferred ranks are set, it will return those values, otherwise values with normal ranks
-- now redundant to getValue with |rank=best
-------------------------------------------------------------------------------
-- Dependencies: p.getValue; setRanks; parseInput; propertyvalueandquals; assembleoutput;
-- parseParam; sourced; labelOrId; i18n.latestdatequalifier; format_Date;
-- makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p.getPreferredValue = function(frame)
frame.args.rank = "best"
return p.getValue(frame)
end
-------------------------------------------------------------------------------
-- getCoords is used to get coordinates for display in an infobox
-- whitelist and blacklist are implemented
-- optional 'display' parameter is allowed, defaults to nil - was "inline, title"
-------------------------------------------------------------------------------
-- Dependencies: setRanks(); parseInput(); decimalPrecision();
-------------------------------------------------------------------------------
p.getCoords = function(frame)
local propertyID = "P625"
-- if there is a 'display' parameter supplied, use it
-- otherwise default to nothing
local disp = frame.args.display or ""
if disp == "" then
disp = nil -- default to not supplying display parameter, was "inline, title"
end
-- there may be a format parameter to switch from deg/min/sec to decimal degrees
-- default is deg/min/sec
-- decimal degrees needs |format = dec
local form = (frame.args.format or ""):lower():sub(1,3)
if form ~= "dec" then
form = "dms"
end
-- just deal with best values
frame.args.reqranks = setRanks("best")
local qid, props = parseInput(frame, frame.args[1], propertyID)
if not qid then
return props -- either local parameter or nothing
else
local dv = props[1].mainsnak.datavalue.value
local lat, long, prec = dv.latitude, dv.longitude, dv.precision
lat = decimalPrecision(lat, prec)
long = decimalPrecision(long, prec)
local lat_long = { lat, long }
lat_long["display"] = disp
lat_long["format"] = form
-- invoke template Coord with the values stored in the table
return frame:expandTemplate{title = 'coord', args = lat_long}
end
end
-------------------------------------------------------------------------------
-- getQualifierValue is used to get a formatted value of a qualifier
--
-- The call needs: a property (the unnamed parameter or 1=)
-- a target value for that property (pval=)
-- a qualifier for that target value (qual=)
-- The usual whitelisting and blacklisting of the property is implemented
-- The boolean onlysourced= parameter can be set to return nothing
-- when the property is unsourced (or only sourced to Wikipedia)
-------------------------------------------------------------------------------
-- Dependencies: parseParam(); setRanks(); parseInput(); sourced();
-- propertyvalueandquals(); assembleoutput();
-- labelOrId(); i18n.latestdatequalifier(); format_Date();
-- findLang(); makeOrdinal(); roundto(); decimalPrecision(); decimalToDMS();
-------------------------------------------------------------------------------
p.getQualifierValue = function(frame)
-- The property ID that will have a qualifier is the first unnamed parameter
local propertyID = mw.text.trim(frame.args[1] or "")
-- The value of the property we want to match whose qualifier value is to be returned
-- is passed in named parameter |pval=
local propvalue = frame.args.pval
-- The property ID of the qualifier
-- whose value is to be returned is passed in named parameter |qual=
local qualifierID = frame.args.qual
-- A filter can be set like this: filter=P642==Q22674854
local filter, fprop, fval
local ftable = mw.text.split(frame.args.filter or "", "==")
if ftable[2] then
fprop = mw.text.trim(ftable[1])
fval = mw.text.trim(ftable[2])
filter = true
end
-- onlysourced is a boolean passed to return qualifiers
-- only when property values are sourced to something other than Wikipedia
-- if nothing or an empty string is passed set it true
-- if "false" or "no" or 0 is passed set it false
local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)
-- set a language object and language code in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
-- set the requested ranks flags
frame.args.reqranks = setRanks(frame.args.rank)
-- check for locally supplied parameter in second unnamed parameter
-- success means no local parameter and the property exists
local qid, props = parseInput(frame, frame.args[2], propertyID)
if qid then
local out = {}
-- Scan through the values of the property
-- we want something like property is P793, significant event (in propertyID)
-- whose value is something like Q385378, construction (in propvalue)
-- then we can return the value(s) of a qualifier such as P580, start time (in qualifierID)
for k1, v1 in pairs(props) do
if v1.mainsnak.snaktype == "value" and v1.mainsnak.datavalue.type == "wikibase-entityid" then
-- It's a wiki-linked value, so check if it's the target (in propvalue) and if it has qualifiers
if v1.mainsnak.datavalue.value.id == propvalue and v1.qualifiers then
if onlysrc == false or sourced(v1) then
-- if we've got this far, we have a (sourced) claim with qualifiers
-- which matches the target, so apply the filter and find the value(s) of the qualifier we want
if not filter or (v1.qualifiers[fprop] and v1.qualifiers[fprop][1].datavalue.value.id == fval) then
local quals = v1.qualifiers[qualifierID]
if quals then
-- can't reference qualifer, so set onlysourced = "no" (args are strings, not boolean)
local qargs = frame.args
qargs.onlysourced = "no"
local vals = propertyvalueandquals(quals, qargs, qid)
for k, v in ipairs(vals) do
out[#out + 1] = v
end
end
end
end -- of check for sourced
end -- of check for matching required value and has qualifiers
end -- of check for wikibase entity
end -- of loop through values of propertyID
return assembleoutput(out, frame.args, qid, propertyID)
else
return props -- either local parameter or nothing
end -- of test for success
return nil
end
-------------------------------------------------------------------------------
-- getSumOfParts scans the property 'has part' (P527) for values matching a list.
-- The list is passed in parameter vlist.
-- It consists of a string of Qids separated by spaces or any usual punctuation.
-- If the matched values have a qualifier 'quantity' (P1114), those quantities are summed.
-- The sum is returned as a number or nothing if zero.
-------------------------------------------------------------------------------
-- Dependencies: _getsumofparts;
-------------------------------------------------------------------------------
p.getSumOfParts = function(frame)
local sum = _getsumofparts(frame.args)
if sum == 0 then return end
return sum
end
-------------------------------------------------------------------------------
-- getValueByQual gets the value of a property which has a qualifier with a given entity value
-- The call needs:
-- a property ID (the unnamed parameter or 1=Pxxx)
-- the ID of a qualifier for that property (qualID=Pyyy)
-- either the Wikibase-entity ID of a value for that qualifier (qvalue=Qzzz)
-- or a string value for that qualifier (qvalue=abc123)
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: _getvaluebyqual; parseParam; setRanks; parseInput; sourced;
-- assembleoutput;
-------------------------------------------------------------------------------
p.getValueByQual = function(frame)
local qualID = frame.args.qualID
-- The Q-id of the value for the qualifier we want to match is in named parameter |qvalue=
local qval = frame.args.qvalue or ""
if qval == "" then return "no qualifier value supplied" end
local function checkQID(id)
return id == qval
end
return _getvaluebyqual(frame, qualID, checkQID)
end
-------------------------------------------------------------------------------
-- getValueByLang gets the value of a property which has a qualifier P407
-- ("language of work or name") whose value has the given language code
-- The call needs:
-- a property ID (the unnamed parameter or 1=Pxxx)
-- the MediaWiki language code to match the language (lang=xx[-yy])
-- (if no code is supplied, it uses the default language)
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: _getvaluebyqual; parseParam; setRanks; parseInput; sourced; assembleoutput;
-------------------------------------------------------------------------------
p.getValueByLang = function(frame)
-- The language code for the qualifier we want to match is in named parameter |lang=
local langcode = findLang(frame.args.lang).code
local function checkLanguage(id)
-- id should represent a language like "British English (Q7979)"
-- it should have string property "Wikimedia language code (P424)"
-- qlcode will be a table:
local qlcode = mw.wikibase.getBestStatements(id, "P424")
if (#qlcode > 0) and (qlcode[1].mainsnak.datavalue.value == langcode) then
return true
end
end
return _getvaluebyqual(frame, "P407", checkLanguage)
end
-------------------------------------------------------------------------------
-- getValueByRefSource gets the value of a property which has a reference "stated in" (P248)
-- whose value has the given entity-ID.
-- The call needs:
-- a property ID (the unnamed parameter or 1=Pxxx)
-- the entity ID of a value to match where the reference is stated in (match=Qzzz)
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getValueByRefSource = function(frame)
-- The property ID that we want to check is the first unnamed parameter
local propertyID = mw.text.trim(frame.args[1] or ""):upper()
if propertyID == "" then return "no property supplied" end
-- The Q-id of the value we want to match is in named parameter |qvalue=
local qval = (frame.args.match or ""):upper()
if qval == "" then qval = "Q21540096" end
local unit = (frame.args.unit or ""):upper()
if unit == "" then unit = "Q4917" end
local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)
-- set the requested ranks flags
frame.args.reqranks = setRanks(frame.args.rank)
-- set a language object and code in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local linked = parseParam(frame.args.linked, true)
local uabbr = parseParam(frame.args.uabbr or frame.args.unitabbr, false)
-- qid not nil means no local parameter and the property exists
local qid, props = parseInput(frame, frame.args[2], propertyID)
if qid then
local out = {}
local mlt= {}
for k1, v1 in ipairs(props) do
if onlysrc == false or sourced(v1) then
if v1.references then
for k2, v2 in ipairs(v1.references) do
if v2.snaks.P248 then
for k3, v3 in ipairs(v2.snaks.P248) do
if v3.datavalue.value.id == qval then
out[#out+1], mlt[#out+1] = rendersnak(v1, frame.args, linked, "", "", "", "", uabbr, unit)
if not mlt[#out] then
-- we only need one match per property value
-- unless datatype was monolingual text
break
end
end -- of test for match
end -- of loop through values "stated in"
end -- of test that "stated in" exists
end -- of loop through references
end -- of test that references exist
end -- of test for sourced
end -- of loop through values of propertyID
if #mlt > 0 then
local langcode = frame.args.lang
langcode = mw.text.split( langcode, '-', true )[1]
local fbtbl = mw.language.getFallbacksFor( langcode )
table.insert( fbtbl, 1, langcode )
local bestval = ""
local found = false
for idx1, lang1 in ipairs(fbtbl) do
for idx2, lang2 in ipairs(mlt) do
if (lang1 == lang2) and not found then
bestval = out[idx2]
found = true
break
end
end -- loop through values of property
end -- loop through fallback languages
if found then
-- replace output table with a table containing the best value
out = { bestval }
else
-- more than one value and none of them on the list of fallback languages
-- sod it, just give them the first one
out = { out[1] }
end
end
return assembleoutput(out, frame.args, qid, propertyID)
else
return props -- no property or local parameter supplied
end -- of test for success
end
-------------------------------------------------------------------------------
-- getPropertyIDs takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented.
-- It returns the Entity-IDs (Qids) of the values of a property if it is a Wikibase-Entity.
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p._getPropertyIDs = function(args)
args.reqranks = setRanks(args.rank)
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
-- change default for noicon to true
args.noicon = tostring(parseParam(args.noicon or "", true))
local f = {}
f.args = args
local pid = mw.text.trim(args[1] or ""):upper()
-- get the qid and table of claims for the property, or nothing and the local value passed
local qid, props = parseInput(f, args[2], pid)
if not qid then return props end
if not props[1] then return nil end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local out = {}
for i, v in ipairs(props) do
local snak = v.mainsnak
if ( snak.datatype == "wikibase-item" )
and ( v.rank and args.reqranks[v.rank:sub(1, 1)] )
and ( snak.snaktype == "value" )
and ( sourced(v) or not onlysrc )
then
out[#out+1] = snak.datavalue.value.id
end
if maxvals > 0 and #out >= maxvals then break end
end
return assembleoutput(out, args, qid, pid)
end
p.getPropertyIDs = function(frame)
local args = frame.args
return p._getPropertyIDs(args)
end
-------------------------------------------------------------------------------
-- getQualifierIDs takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented.
-- It takes a property-id as the first unnamed parameter, and an optional parameter qlist
-- which is a list of qualifier property-ids to search for (default is "ALL")
-- It returns the Entity-IDs (Qids) of the values of a property if it is a Wikibase-Entity.
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getQualifierIDs = function(frame)
local args = frame.args
args.reqranks = setRanks(args.rank)
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
-- change default for noicon to true
args.noicon = tostring(parseParam(args.noicon or "", true))
local f = {}
f.args = args
local pid = mw.text.trim(args[1] or ""):upper()
-- get the qid and table of claims for the property, or nothing and the local value passed
local qid, props = parseInput(f, args[2], pid)
if not qid then return props end
if not props[1] then return nil end
-- get the other parameters
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local qlist = args.qlist or ""
if qlist == "" then qlist = "ALL" end
qlist = qlist:gsub("[%p%s]+", " ") .. " "
local out = {}
for i, v in ipairs(props) do
local snak = v.mainsnak
if ( v.rank and args.reqranks[v.rank:sub(1, 1)] )
and ( snak.snaktype == "value" )
and ( sourced(v) or not onlysrc )
then
if v.qualifiers then
for k1, v1 in pairs(v.qualifiers) do
if qlist == "ALL " or qlist:match(k1 .. " ") then
for i2, v2 in ipairs(v1) do
if v2.datatype == "wikibase-item" and v2.snaktype == "value" then
out[#out+1] = v2.datavalue.value.id
end -- of test that id exists
end -- of loop through qualifier values
end -- of test for kq in qlist
end -- of loop through qualifiers
end -- of test for qualifiers
end -- of test for rank value, sourced, and value exists
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through property values
return assembleoutput(out, args, qid, pid)
end
-------------------------------------------------------------------------------
-- getPropOfProp takes two propertyIDs: prop1 and prop2 (as well as the usual parameters)
-- If the value(s) of prop1 are of type "wikibase-item" then it returns the value(s) of prop2
-- of each of those wikibase-items.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p._getPropOfProp = function(args)
-- parameter sets for commonly used groups of parameters
local paraset = tonumber(args.ps or args.parameterset or 0)
if paraset == 1 then
-- a common setting
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
elseif paraset == 2 then
-- equivalent to raw
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
args.linked = "no"
args.pd = "true"
elseif paraset == 3 then
-- third set goes here
end
args.reqranks = setRanks(args.rank)
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
local pid1 = args.prop1 or args.pid1 or ""
local pid2 = args.prop2 or args.pid2 or ""
if pid1 == "" or pid2 == "" then return nil end
local f = {}
f.args = args
local qid1, statements1 = parseInput(f, args[1], pid1)
-- parseInput nulls empty args[1] and returns args[1] if nothing on Wikidata
if not qid1 then return statements1 end
-- otherwise it returns the qid and a table for the statement
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local qualID = mw.text.trim(args.qual or ""):upper()
if qualID == "" then qualID = nil end
local out = {}
for k, v in ipairs(statements1) do
if not onlysrc or sourced(v) then
local snak = v.mainsnak
if snak.datatype == "wikibase-item" and snak.snaktype == "value" then
local qid2 = snak.datavalue.value.id
local statements2 = {}
if args.reqranks.b then
statements2 = mw.wikibase.getBestStatements(qid2, pid2)
else
statements2 = mw.wikibase.getAllStatements(qid2, pid2)
end
if statements2[1] then
local out2 = propertyvalueandquals(statements2, args, qualID)
out[#out+1] = assembleoutput(out2, args, qid2, pid2)
end
end -- of test for valid property1 value
end -- of test for sourced
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through values of property1
return assembleoutput(out, args, qid1, pid1)
end
p.getPropOfProp = function(frame)
local args= frame.args
if not args.prop1 and not args.pid1 then
args = frame:getParent().args
if not args.prop1 and not args.pid1 then return i18n.errors["No property supplied"] end
end
return p._getPropOfProp(args)
end
-------------------------------------------------------------------------------
-- getAwardCat takes most of the usual parameters. If the item has values of P166 (award received),
-- then it examines each of those awards for P2517 (category for recipients of this award).
-- If it exists, it returns the corresponding category,
-- with the item's P734 (family name) as sort key, or no sort key if there is no family name.
-- The sort key may be overridden by the parameter |sortkey (alias |sk).
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getAwardCat = function(frame)
frame.args.reqranks = setRanks(frame.args.rank)
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local args = frame.args
args.sep = " "
local pid1 = args.prop1 or "P166"
local pid2 = args.prop2 or "P2517"
if pid1 == "" or pid2 == "" then return nil end
-- locally supplied value:
local localval = mw.text.trim(args[1] or "")
local qid1, statements1 = parseInput(frame, localval, pid1)
if not qid1 then return localval end
-- linkprefix (strip quotes)
local lp = (args.linkprefix or args.lp or ""):gsub('"', '')
-- sort key (strip quotes, hyphens and periods):
local sk = (args.sortkey or args.sk or ""):gsub('["-.]', '')
-- family name:
local famname = ""
if sk == "" then
local p734 = mw.wikibase.getBestStatements(qid1, "P734")[1]
local p734id = p734 and p734.mainsnak.snaktype == "value" and p734.mainsnak.datavalue.value.id or ""
famname = mw.wikibase.getSitelink(p734id) or ""
-- strip namespace and disambigation
local pos = famname:find(":") or 0
famname = famname:sub(pos+1):gsub("%s%(.+%)$", "")
if famname == "" then
local lbl = mw.wikibase.getLabel(p734id)
famname = lbl and mw.text.nowiki(lbl) or ""
end
end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local qualID = mw.text.trim(args.qual or ""):upper()
if qualID == "" then qualID = nil end
local out = {}
for k, v in ipairs(statements1) do
if not onlysrc or sourced(v) then
local snak = v.mainsnak
if snak.datatype == "wikibase-item" and snak.snaktype == "value" then
local qid2 = snak.datavalue.value.id
local statements2 = {}
if args.reqranks.b then
statements2 = mw.wikibase.getBestStatements(qid2, pid2)
else
statements2 = mw.wikibase.getAllStatements(qid2, pid2)
end
if statements2[1] and statements2[1].mainsnak.snaktype == "value" then
local qid3 = statements2[1].mainsnak.datavalue.value.id
local sitelink = mw.wikibase.getSitelink(qid3)
-- if there's no local sitelink, create the sitelink from English label
if not sitelink then
local lbl = mw.wikibase.getLabelByLang(qid3, "en")
if lbl then
if lbl:sub(1,9) == "Category:" then
sitelink = mw.text.nowiki(lbl)
else
sitelink = "Category:" .. mw.text.nowiki(lbl)
end
end
end
if sitelink then
if sk ~= "" then
out[#out+1] = "[[" .. lp .. sitelink .. "|" .. sk .. "]]"
elseif famname ~= "" then
out[#out+1] = "[[" .. lp .. sitelink .. "|" .. famname .. "]]"
else
out[#out+1] = "[[" .. lp .. sitelink .. "]]"
end -- of check for sort keys
end -- of test for sitelink
end -- of test for category
end -- of test for wikibase item has a value
end -- of test for sourced
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through values of property1
return assembleoutput(out, args, qid1, pid1)
end
-------------------------------------------------------------------------------
-- getIntersectCat takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-- It takes two properties, |prop1 and |prop2 (e.g. occupation and country of citizenship)
-- Each property's value is a wiki-base entity
-- For each value of the first parameter (ranks implemented) it fetches the value's main category
-- and then each value of the second parameter (possibly substituting a simpler description)
-- then it returns all of the categories representing the intersection of those properties,
-- (e.g. Category:Actors from Canada). A joining term may be supplied (e.g. |join=from).
-- The item's P734 (family name) is the sort key, or no sort key if there is no family name.
-- The sort key may be overridden by the parameter |sortkey (alias |sk).
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getIntersectCat = function(frame)
frame.args.reqranks = setRanks(frame.args.rank)
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local args = frame.args
args.sep = " "
args.linked = "no"
local pid1 = args.prop1 or "P106"
local pid2 = args.prop2 or "P27"
if pid1 == "" or pid2 == "" then return nil end
local qid, statements1 = parseInput(frame, "", pid1)
if not qid then return nil end
local qid, statements2 = parseInput(frame, "", pid2)
if not qid then return nil end
-- topics like countries may have different names in categories from their label in Wikidata
local subs_exists, subs = pcall(mw.loadData, "Module:WikidataIB/subs")
local join = args.join or ""
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
-- linkprefix (strip quotes)
local lp = (args.linkprefix or args.lp or ""):gsub('"', '')
-- sort key (strip quotes, hyphens and periods):
local sk = (args.sortkey or args.sk or ""):gsub('["-.]', '')
-- family name:
local famname = ""
if sk == "" then
local p734 = mw.wikibase.getBestStatements(qid, "P734")[1]
local p734id = p734 and p734.mainsnak.snaktype == "value" and p734.mainsnak.datavalue.value.id or ""
famname = mw.wikibase.getSitelink(p734id) or ""
-- strip namespace and disambigation
local pos = famname:find(":") or 0
famname = famname:sub(pos+1):gsub("%s%(.+%)$", "")
if famname == "" then
local lbl = mw.wikibase.getLabel(p734id)
famname = lbl and mw.text.nowiki(lbl) or ""
end
end
local cat1 = {}
for k, v in ipairs(statements1) do
if not onlysrc or sourced(v) then
-- get the ID representing the value of the property
local pvalID = (v.mainsnak.snaktype == "value") and v.mainsnak.datavalue.value.id
if pvalID then
-- get the topic's main category (P910) for that entity
local p910 = mw.wikibase.getBestStatements(pvalID, "P910")[1]
if p910 and p910.mainsnak.snaktype == "value" then
local tmcID = p910.mainsnak.datavalue.value.id
-- use sitelink or the English label for the cat
local cat = mw.wikibase.getSitelink(tmcID)
if not cat then
local lbl = mw.wikibase.getLabelByLang(tmcID, "en")
if lbl then
if lbl:sub(1,9) == "Category:" then
cat = mw.text.nowiki(lbl)
else
cat = "Category:" .. mw.text.nowiki(lbl)
end
end
end
cat1[#cat1+1] = cat
end -- of test for topic's main category exists
end -- of test for property has vaild value
end -- of test for sourced
if maxvals > 0 and #cat1 >= maxvals then break end
end
local cat2 = {}
for k, v in ipairs(statements2) do
if not onlysrc or sourced(v) then
local cat = rendersnak(v, args)
if subs[cat] then cat = subs[cat] end
cat2[#cat2+1] = cat
end
if maxvals > 0 and #cat2 >= maxvals then break end
end
local out = {}
for k1, v1 in ipairs(cat1) do
for k2, v2 in ipairs(cat2) do
if sk ~= "" then
out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "|" .. sk .. "]]"
elseif famname ~= "" then
out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "|" .. famname .. "]]"
else
out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "]]"
end -- of check for sort keys
end
end
args.noicon = "true"
return assembleoutput(out, args, qid, pid1)
end
-------------------------------------------------------------------------------
-- qualsToTable takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented.
-- A qid may be given, and the first unnamed parameter is the property ID, which is of type wikibase item.
-- It takes a list of qualifier property IDs as |quals=
-- For a given qid and property, it creates the rows of an html table,
-- each row being a value of the property (optionally only if the property matches the value in |pval= )
-- each cell being the first value of the qualifier corresponding to the list in |quals
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced;
-------------------------------------------------------------------------------
p.qualsToTable = function(frame)
local args = frame.args
local quals = args.quals or ""
if quals == "" then return "" end
args.reqranks = setRanks(args.rank)
local propertyID = mw.text.trim(args[1] or "")
local f = {}
f.args = args
local entityid, props = parseInput(f, "", propertyID)
if not entityid then return "" end
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
local pval = args.pval or ""
local qplist = mw.text.split(quals, "%p") -- split at punctuation and make a sequential table
for i, v in ipairs(qplist) do
qplist[i] = mw.text.trim(v):upper() -- remove whitespace and capitalise
end
local col1 = args.firstcol or ""
if col1 ~= "" then
col1 = col1 .. "</td><td>"
end
local emptycell = args.emptycell or " "
-- construct a 2-D array of qualifier values in qvals
local qvals = {}
for i, v in ipairs(props) do
local skip = false
if pval ~= "" then
local pid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id
if pid ~= pval then skip = true end
end
if not skip then
local qval = {}
local vqualifiers = v.qualifiers or {}
-- go through list of wanted qualifier properties
for i1, v1 in ipairs(qplist) do
-- check for that property ID in the statement's qualifiers
local qv, qtype
if vqualifiers[v1] then
qtype = vqualifiers[v1][1].datatype
if qtype == "time" then
if vqualifiers[v1][1].snaktype == "value" then
qv = mw.wikibase.renderSnak(vqualifiers[v1][1])
qv = frame:expandTemplate{title="dts", args={qv}}
else
qv = "?"
end
elseif qtype == "url" then
if vqualifiers[v1][1].snaktype == "value" then
qv = mw.wikibase.renderSnak(vqualifiers[v1][1])
local display = mw.ustring.match( mw.uri.decode(qv, "WIKI"), "([%w ]+)$" )
if display then
qv = "[" .. qv .. " " .. display .. "]"
end
end
else
qv = mw.wikibase.formatValue(vqualifiers[v1][1])
end
end
-- record either the value or a placeholder
qval[i1] = qv or emptycell
end -- of loop through list of qualifiers
-- add the list of qualifier values as a "row" in the main list
qvals[#qvals+1] = qval
end
end -- of for each value loop
local out = {}
for i, v in ipairs(qvals) do
out[i] = "<tr><td>" .. col1 .. table.concat(qvals[i], "</td><td>") .. "</td></tr>"
end
return table.concat(out, "\n")
end
-------------------------------------------------------------------------------
-- getGlobe takes an optional qid of a Wikidata entity passed as |qid=
-- otherwise it uses the linked item for the current page.
-- If returns the Qid of the globe used in P625 (coordinate location),
-- or nil if there isn't one.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getGlobe = function(frame)
local qid = frame.args.qid or frame.args[1] or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
local coords = mw.wikibase.getBestStatements(qid, "P625")[1]
local globeid
if coords and coords.mainsnak.snaktype == "value" then
globeid = coords.mainsnak.datavalue.value.globe:match("(Q%d+)")
end
return globeid
end
-------------------------------------------------------------------------------
-- getCommonsLink takes an optional qid of a Wikidata entity passed as |qid=
-- It returns one of the following in order of preference:
-- the Commons sitelink of the linked Wikidata item;
-- the Commons sitelink of the topic's main category of the linked Wikidata item;
-------------------------------------------------------------------------------
-- Dependencies: _getCommonslink(); _getSitelink(); parseParam()
-------------------------------------------------------------------------------
p.getCommonsLink = function(frame)
local oc = frame.args.onlycat or frame.args.onlycategories
local fb = parseParam(frame.args.fallback or frame.args.fb, true)
return _getCommonslink(frame.args.qid, oc, fb)
end
-------------------------------------------------------------------------------
-- getSitelink takes the qid of a Wikidata entity passed as |qid=
-- It takes an optional parameter |wiki= to determine which wiki is to be checked for a sitelink
-- If the parameter is blank, then it uses the local wiki.
-- If there is a sitelink to an article available, it returns the plain text link to the article
-- If there is no sitelink, it returns nil.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getSiteLink = function(frame)
return _getSitelink(frame.args.qid, frame.args.wiki or mw.text.trim(frame.args[1] or ""))
end
-------------------------------------------------------------------------------
-- getLink has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- If there is a sitelink to an article on the local Wiki, it returns a link to the article
-- with the Wikidata label as the displayed text.
-- If there is no sitelink, it returns the label as plain text.
-- If there is no label in the local language, it displays the qid instead.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getLink = function(frame)
local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "")
if itemID == "" then return end
local sitelink = mw.wikibase.getSitelink(itemID)
local label = labelOrId(itemID)
if sitelink then
return "[[:" .. sitelink .. "|" .. label .. "]]"
else
return label
end
end
-------------------------------------------------------------------------------
-- getLabel has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- It returns the Wikidata label for the local language as plain text.
-- If there is no label in the local language, it displays the qid instead.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getLabel = function(frame)
local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "")
if itemID == "" then return end
local lang = frame.args.lang or ""
if lang == "" then lang = nil end
local label = labelOrId(itemID, lang)
return label
end
-------------------------------------------------------------------------------
-- label has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- if no qid is supplied, it uses the qid associated with the current page.
-- It returns the Wikidata label for the local language as plain text.
-- If there is no label in the local language, it returns nil.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.label = function(frame)
local qid = mw.text.trim(frame.args[1] or frame.args.qid or "")
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return end
local lang = frame.args.lang or ""
if lang == "" then lang = nil end
local label, success = labelOrId(qid, lang)
if success then return label end
end
-------------------------------------------------------------------------------
-- getAT (Article Title)
-- has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- If there is a sitelink to an article on the local Wiki, it returns the sitelink as plain text.
-- If there is no sitelink or qid supplied, it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAT = function(frame)
local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "")
if itemID == "" then return end
return mw.wikibase.getSitelink(itemID)
end
-------------------------------------------------------------------------------
-- getDescription has the qid of a Wikidata entity passed as |qid=
-- (it defaults to the associated qid of the current article if omitted)
-- and a local parameter passed as the first unnamed parameter.
-- Any local parameter passed (other than "Wikidata" or "none") becomes the return value.
-- It returns the article description for the Wikidata entity if the local parameter is "Wikidata".
-- Nothing is returned if the description doesn't exist or "none" is passed as the local parameter.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getDescription = function(frame)
local desc = mw.text.trim(frame.args[1] or "")
local itemID = mw.text.trim(frame.args.qid or "")
if itemID == "" then itemID = nil end
if desc:lower() == 'wikidata' then
return mw.wikibase.getDescription(itemID)
elseif desc:lower() == 'none' then
return nil
else
return desc
end
end
-------------------------------------------------------------------------------
-- getAliases has the qid of a Wikidata entity passed as |qid=
-- (it defaults to the associated qid of the current article if omitted)
-- and a local parameter passed as the first unnamed parameter.
-- It implements blacklisting and whitelisting with a field name of "alias" by default.
-- Any local parameter passed becomes the return value.
-- Otherwise it returns the aliases for the Wikidata entity with the usual list options.
-- Nothing is returned if the aliases do not exist.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); assembleoutput()
-------------------------------------------------------------------------------
p.getAliases = function(frame)
local args = frame.args
local fieldname = args.name or ""
if fieldname == "" then fieldname = "alias" end
local blacklist = args.suppressfields or args.spf or ""
if blacklist:find(fieldname) then return nil end
local localval = mw.text.trim(args[1] or "")
if localval ~= "" then return localval end
local whitelist = args.fetchwikidata or args.fwd or ""
if whitelist == "" then whitelist = "NONE" end
if not (whitelist == 'ALL' or whitelist:find(fieldname)) then return nil end
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return nil end
local aliases = mw.wikibase.getEntity(qid).aliases
if not aliases then return nil end
args.langobj = findLang(args.lang)
local langcode = args.langobj.code
args.lang = langcode
local out = {}
for k1, v1 in pairs(aliases) do
if v1[1].language == langcode then
for k1, v2 in ipairs(v1) do
out[#out+1] = v2.value
end
break
end
end
return assembleoutput(out, args, qid)
end
-------------------------------------------------------------------------------
-- pageId returns the page id (entity ID, Qnnn) of the current page
-- returns nothing if the page is not connected to Wikidata
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.pageId = function(frame)
return mw.wikibase.getEntityIdForCurrentPage()
end
-------------------------------------------------------------------------------
-- formatDate is a wrapper to export the private function format_Date
-------------------------------------------------------------------------------
-- Dependencies: format_Date();
-------------------------------------------------------------------------------
p.formatDate = function(frame)
return format_Date(frame.args[1], frame.args.df, frame.args.bc)
end
-------------------------------------------------------------------------------
-- location is a wrapper to export the private function _location
-- it takes the entity-id as qid or the first unnamed parameter
-- optional boolean parameter first toggles the display of the first item
-- optional boolean parameter skip toggles the display to skip to the last item
-- parameter debug=<y/n> (default 'n') adds error msg if not a location
-------------------------------------------------------------------------------
-- Dependencies: _location();
-------------------------------------------------------------------------------
p.location = function(frame)
local debug = (frame.args.debug or ""):sub(1, 1):lower()
if debug == "" then debug = "n" end
local qid = mw.text.trim(frame.args.qid or frame.args[1] or ""):upper()
if qid == "" then qid=mw.wikibase.getEntityIdForCurrentPage() end
if not qid then
if debug ~= "n" then
return i18n.errors["entity-not-found"]
else
return nil
end
end
local first = mw.text.trim(frame.args.first or "")
local skip = mw.text.trim(frame.args.skip or "")
return table.concat( _location(qid, first, skip), ", " )
end
-------------------------------------------------------------------------------
-- checkBlacklist implements a test to check whether a named field is allowed
-- returns true if the field is not blacklisted (i.e. allowed)
-- returns false if the field is blacklisted (i.e. disallowed)
-- {{#if:{{#invoke:WikidataIB |checkBlacklist |name=Joe |suppressfields=Dave; Joe; Fred}} | not blacklisted | blacklisted}}
-- displays "blacklisted"
-- {{#if:{{#invoke:WikidataIB |checkBlacklist |name=Jim |suppressfields=Dave; Joe; Fred}} | not blacklisted | blacklisted}}
-- displays "not blacklisted"
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.checkBlacklist = function(frame)
local blacklist = frame.args.suppressfields or frame.args.spf or ""
local fieldname = frame.args.name or ""
if blacklist ~= "" and fieldname ~= "" then
if blacklist:find(fieldname) then
return false
else
return true
end
else
-- one of the fields is missing: let's call that "not on the list"
return true
end
end
-------------------------------------------------------------------------------
-- emptyor returns nil if its first unnamed argument is just punctuation, whitespace or html tags
-- otherwise it returns the argument unchanged (including leading/trailing space).
-- If the argument may contain "=", then it must be called explicitly:
-- |1=arg
-- (In that case, leading and trailing spaces are trimmed)
-- It finds use in infoboxes where it can replace tests like:
-- {{#if: {{#invoke:WikidatIB |getvalue |P99 |fwd=ALL}} | <span class="xxx">{{#invoke:WikidatIB |getvalue |P99 |fwd=ALL}}</span> | }}
-- with a form that uses just a single call to Wikidata:
-- {{#invoke |WikidataIB |emptyor |1= <span class="xxx">{{#invoke:WikidataIB |getvalue |P99 |fwd=ALL}}</span> }}
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.emptyor = function(frame)
local s = frame.args[1] or ""
if s == "" then return nil end
local sx = s:gsub("%s", ""):gsub("<[^>]*>", ""):gsub("%p", "")
if sx == "" then
return nil
else
return s
end
end
-------------------------------------------------------------------------------
-- labelorid is a public function to expose the output of labelOrId()
-- Pass the Q-number as |qid= or as an unnamed parameter.
-- It returns the Wikidata label for that entity or the qid if no label exists.
-------------------------------------------------------------------------------
-- Dependencies: labelOrId
-------------------------------------------------------------------------------
p.labelorid = function(frame)
return (labelOrId(frame.args.qid or frame.args[1]))
end
-------------------------------------------------------------------------------
-- getLang returns the MediaWiki language code of the current content.
-- If optional parameter |style=full, it returns the language name.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getLang = function(frame)
local style = (frame.args.style or ""):lower()
local langcode = mw.language.getContentLanguage().code
if style == "full" then
return mw.language.fetchLanguageName( langcode )
end
return langcode
end
-------------------------------------------------------------------------------
-- getItemLangCode takes a qid parameter (using the current page's qid if blank)
-- If the item for that qid has property country (P17) it looks at the first preferred value
-- If the country has an official language (P37), it looks at the first preferred value
-- If that official language has a language code (P424), it returns the first preferred value
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: _getItemLangCode()
-------------------------------------------------------------------------------
p.getItemLangCode = function(frame)
return _getItemLangCode(frame.args.qid or frame.args[1])
end
-------------------------------------------------------------------------------
-- findLanguage exports the local findLang() function
-- It takes an optional language code and returns, in order of preference:
-- the code if a known language;
-- the user's language, if set;
-- the server's content language.
-------------------------------------------------------------------------------
-- Dependencies: findLang
-------------------------------------------------------------------------------
p.findLanguage = function(frame)
return findLang(frame.args.lang or frame.args[1]).code
end
-------------------------------------------------------------------------------
-- getQid returns the qid, if supplied
-- failing that, the Wikidata entity ID of the "category's main topic (P301)", if it exists
-- failing that, the Wikidata entity ID associated with the current page, if it exists
-- otherwise, nothing
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getQid = function(frame)
local qid = (frame.args.qid or ""):upper()
-- check if a qid was passed; if so, return it:
if qid ~= "" then return qid end
-- check if there's a "category's main topic (P301)":
qid = mw.wikibase.getEntityIdForCurrentPage()
if qid then
local prop301 = mw.wikibase.getBestStatements(qid, "P301")
if prop301[1] then
local mctid = prop301[1].mainsnak.datavalue.value.id
if mctid then return mctid end
end
end
-- otherwise return the page qid (if any)
return qid
end
-------------------------------------------------------------------------------
-- followQid takes four optional parameters: qid, props, list and all.
-- If qid is not given, it uses the qid for the connected page
-- or returns nil if there isn't one.
-- props is a list of properties, separated by punctuation.
-- If props is given, the Wikidata item for the qid is examined for each property in turn.
-- If that property contains a value that is another Wikibase-item, that item's qid is returned,
-- and the search terminates, unless |all=y when all of the qids are returned, separated by spaces.
-- If |list= is set to a template, the qids are passed as arguments to the template.
-- If props is not given, the qid is returned.
-------------------------------------------------------------------------------
-- Dependencies: parseParam()
-------------------------------------------------------------------------------
p._followQid = function(args)
local qid = (args.qid or ""):upper()
local all = parseParam(args.all, false)
local list = args.list or ""
if list == "" then list = nil end
if qid == "" then
qid = mw.wikibase.getEntityIdForCurrentPage()
end
if not qid then return nil end
local out = {}
local props = (args.props or ""):upper()
if props ~= "" then
for p in mw.text.gsplit(props, "%p") do -- split at punctuation and iterate
p = mw.text.trim(p)
for i, v in ipairs( mw.wikibase.getBestStatements(qid, p) ) do
local linkedid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id
if linkedid then
if all then
out[#out+1] = linkedid
else
return linkedid
end -- test for all or just the first one found
end -- test for value exists for that property
end -- loop through values of property to follow
end -- loop through list of properties to follow
end
if #out > 0 then
local ret = ""
if list then
ret = mw.getCurrentFrame():expandTemplate{title = list, args = out}
else
ret = table.concat(out, " ")
end
return ret
else
return qid
end
end
p.followQid = function(frame)
return p._followQid(frame.args)
end
-------------------------------------------------------------------------------
-- globalSiteID returns the globalSiteID for the current wiki
-- e.g. returns "enwiki" for the English Wikipedia, "enwikisource" for English Wikisource, etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.globalSiteID = function(frame)
return mw.wikibase.getGlobalSiteId()
end
-------------------------------------------------------------------------------
-- siteID returns the root of the globalSiteID
-- e.g. "en" for "enwiki", "enwikisource", etc.
-- treats "en-gb" as "en", etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.siteID = function(frame)
local txtlang = frame:callParserFunction('int', {'lang'}) or ""
-- This deals with specific exceptions: be-tarask -> be-x-old
if txtlang == "be-tarask" then
return "be_x_old"
end
local pos = txtlang:find("-")
local ret = ""
if pos then
ret = txtlang:sub(1, pos-1)
else
ret = txtlang
end
return ret
end
-------------------------------------------------------------------------------
-- projID returns the code used to link to the reader's language's project
-- e.g "en" for [[:en:WikidataIB]]
-- treats "en-gb" as "en", etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.projID = function(frame)
local txtlang = frame:callParserFunction('int', {'lang'}) or ""
-- This deals with specific exceptions: be-tarask -> be-x-old
if txtlang == "be-tarask" then
return "be-x-old"
end
local pos = txtlang:find("-")
local ret = ""
if pos then
ret = txtlang:sub(1, pos-1)
else
ret = txtlang
end
return ret
end
-------------------------------------------------------------------------------
-- formatNumber formats a number according to the the supplied language code ("|lang=")
-- or the default language if not supplied.
-- The number is the first unnamed parameter or "|num="
-------------------------------------------------------------------------------
-- Dependencies: findLang()
-------------------------------------------------------------------------------
p.formatNumber = function(frame)
local lang
local num = tonumber(frame.args[1] or frame.args.num) or 0
lang = findLang(frame.args.lang)
return lang:formatNum( num )
end
-------------------------------------------------------------------------------
-- examine dumps the property (the unnamed parameter or pid)
-- from the item given by the parameter 'qid' (or the other unnamed parameter)
-- or from the item corresponding to the current page if qid is not supplied.
-- e.g. {{#invoke:WikidataIB |examine |pid=P26 |qid=Q42}}
-- or {{#invoke:WikidataIB |examine |P26 |Q42}} or any combination of these
-- or {{#invoke:WikidataIB |examine |P26}} for the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.examine = function( frame )
local args
if frame.args[1] or frame.args.pid or frame.args.qid then
args = frame.args
else
args = frame:getParent().args
end
local par = {}
local pid = (args.pid or ""):upper()
local qid = (args.qid or ""):upper()
par[1] = mw.text.trim( args[1] or "" ):upper()
par[2] = mw.text.trim( args[2] or "" ):upper()
table.sort(par)
if par[2]:sub(1,1) == "P" then par[1], par[2] = par[2], par[1] end
if pid == "" then pid = par[1] end
if qid == "" then qid = par[2] end
local q1 = qid:sub(1,1)
if pid:sub(1,1) ~= "P" then return "No property supplied" end
if q1 ~= "Q" and q1 ~= "M" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return "No item for this page" end
return "<pre>" .. mw.dumpObject( mw.wikibase.getAllStatements( qid, pid ) ) .. "</pre>"
end
-------------------------------------------------------------------------------
-- checkvalue looks for 'val' as a wikibase-item value of a property (the unnamed parameter or pid)
-- from the item given by the parameter 'qid'
-- or from the Wikidata item associated with the current page if qid is not supplied.
-- It only checks ranks that are requested (preferred and normal by default)
-- If property is not supplied, then P31 (instance of) is assumed.
-- It returns val if found or nothing if not found.
-- e.g. {{#invoke:WikidataIB |checkvalue |val=Q5 |pid=P31 |qid=Q42}}
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |P31 |qid=Q42}}
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |qid=Q42}}
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |P31}} for the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.checkvalue = function( frame )
local args
if frame.args.val then
args = frame.args
else
args = frame:getParent().args
end
local val = args.val
if not val then return nil end
local pid = mw.text.trim(args.pid or args[1] or "P31"):upper()
local qid = (args.qid or ""):upper()
if pid:sub(1,1) ~= "P" then return nil end
if qid:sub(1,1) ~= "Q" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
local ranks = setRanks(args.rank)
local stats = {}
if ranks.b then
stats = mw.wikibase.getBestStatements(qid, pid)
else
stats = mw.wikibase.getAllStatements( qid, pid )
end
if not stats[1] then return nil end
if stats[1].mainsnak.datatype == "wikibase-item" then
for k, v in pairs( stats ) do
local ms = v.mainsnak
if ranks[v.rank:sub(1,1)] and ms.snaktype == "value" and ms.datavalue.value.id == val then
return val
end
end
end
return nil
end
-------------------------------------------------------------------------------
-- url2 takes a parameter url= that is a proper url and formats it for use in an infobox.
-- If no parameter is supplied, it returns nothing.
-- This is the equivalent of Template:URL
-- but it keeps the "edit at Wikidata" pen icon out of the microformat.
-- Usually it will take its url parameter directly from a Wikidata call:
-- e.g. {{#invoke:WikidataIB |url2 |url={{wdib |P856 |qid=Q23317 |fwd=ALL |osd=no}} }}
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.url2 = function(frame)
local txt = frame.args.url or ""
if txt == "" then return nil end
-- extract any icon
local url, icon = txt:match("(.+) (.+)")
-- make sure there's at least a space at the end
url = (url or txt) .. " "
icon = icon or ""
-- extract any protocol like https://
local prot = url:match("(https*://).+[ \"\']")
-- extract address
local addr = ""
if prot then
addr = url:match("https*://(.+)[ \"\']") or " "
else
prot = "//"
addr = url:match("[^%p%s]+%.(.+)[ \"\']") or " "
end
-- strip trailing / from end of domain-only url and add <wbr/> before . and /
local disp, n = addr:gsub( "^([^/]+)/$", "%1" ):gsub("%/", "<wbr/>/"):gsub("%.", "<wbr/>.")
return '<span class="url">[' .. prot .. addr .. " " .. disp .. "]</span> " .. icon
end
-------------------------------------------------------------------------------
-- getWebsite fetches the Official website (P856) and formats it for use in an infobox.
-- This is similar to Template:Official website but with a url displayed,
-- and it adds the "edit at Wikidata" pen icon beyond the microformat if enabled.
-- A local value will override the Wikidata value. "NONE" returns nothing.
-- e.g. {{#invoke:WikidataIB |getWebsite |qid= |noicon= |lang= |url= }}
-------------------------------------------------------------------------------
-- Dependencies: findLang(); parseParam();
-------------------------------------------------------------------------------
p.getWebsite = function(frame)
local url = frame.args.url or ""
if url:upper() == "NONE" then return nil end
local urls = {}
local quals = {}
local qid = frame.args.qid or ""
if url and url ~= "" then
urls[1] = url
else
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
local prop856 = mw.wikibase.getBestStatements(qid, "P856")
for k, v in pairs(prop856) do
if v.mainsnak.snaktype == "value" then
urls[#urls+1] = v.mainsnak.datavalue.value
if v.qualifiers and v.qualifiers["P1065"] then
-- just take the first archive url (P1065)
local au = v.qualifiers["P1065"][1]
if au.snaktype == "value" then
quals[#urls] = au.datavalue.value
end -- test for archive url having a value
end -- test for qualifers
end -- test for website having a value
end -- loop through website(s)
end
if #urls == 0 then return nil end
local out = {}
for i, u in ipairs(urls) do
local link = quals[i] or u
local prot, addr = u:match("(http[s]*://)(.+)")
addr = addr or u
local disp, n = addr:gsub("%.", "<wbr/>%.")
out[#out+1] = '<span class="url">[' .. link .. " " .. disp .. "]</span>"
end
local langcode = findLang(frame.args.lang).code
local noicon = parseParam(frame.args.noicon, false)
if url == "" and not noicon then
out[#out] = out[#out] .. createicon(langcode, qid, "P856")
end
local ret = ""
if #out > 1 then
ret = mw.getCurrentFrame():expandTemplate{title = "ubl", args = out}
else
ret = out[1]
end
return ret
end
-------------------------------------------------------------------------------
-- getAllLabels fetches the set of labels and formats it for display as wikitext.
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAllLabels = function(frame)
local args = frame.args or frame:getParent().args or {}
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end
local labels = mw.wikibase.getEntity(qid).labels
if not labels then return i18n["labels-not-found"] end
local out = {}
for k, v in pairs(labels) do
out[#out+1] = v.value .. " (" .. v.language .. ")"
end
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- getAllDescriptions fetches the set of descriptions and formats it for display as wikitext.
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAllDescriptions = function(frame)
local args = frame.args or frame:getParent().args or {}
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end
local descriptions = mw.wikibase.getEntity(qid).descriptions
if not descriptions then return i18n["descriptions-not-found"] end
local out = {}
for k, v in pairs(descriptions) do
out[#out+1] = v.value .. " (" .. v.language .. ")"
end
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- getAllAliases fetches the set of aliases and formats it for display as wikitext.
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAllAliases = function(frame)
local args = frame.args or frame:getParent().args or {}
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end
local aliases = mw.wikibase.getEntity(qid).aliases
if not aliases then return i18n["aliases-not-found"] end
local out = {}
for k1, v1 in pairs(aliases) do
local lang = v1[1].language
local val = {}
for k1, v2 in ipairs(v1) do
val[#val+1] = v2.value
end
out[#out+1] = table.concat(val, ", ") .. " (" .. lang .. ")"
end
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- showNoLinks displays the article titles that should not be linked.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.showNoLinks = function(frame)
local out = {}
for k, v in pairs(donotlink) do
out[#out+1] = k
end
table.sort( out )
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- checkValidity checks whether the first unnamed parameter represents a valid entity-id,
-- that is, something like Q1235 or P123.
-- It returns the strings "true" or "false".
-- Change false to nil to return "true" or "" (easier to test with #if:).
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
function p.checkValidity(frame)
local id = mw.text.trim(frame.args[1] or "")
if mw.wikibase.isValidEntityId(id) then
return true
else
return false
end
end
-------------------------------------------------------------------------------
-- getEntityFromTitle returns the Entity-ID (Q-number) for a given title.
-- Modification of Module:ResolveEntityId
-- The title is the first unnamed parameter.
-- The site parameter determines the site/language for the title. Defaults to current wiki.
-- The showdab parameter determines whether dab pages should return the Q-number or nil. Defaults to true.
-- Returns the Q-number or nil if it does not exist.
-------------------------------------------------------------------------------
-- Dependencies: parseParam
-------------------------------------------------------------------------------
function p.getEntityFromTitle(frame)
local args=frame.args
if not args[1] then args=frame:getParent().args end
if not args[1] then return nil end
local title = mw.text.trim(args[1])
local site = args.site or ""
local showdab = parseParam(args.showdab, true)
local qid = mw.wikibase.getEntityIdForTitle(title, site)
if qid then
local prop31 = mw.wikibase.getBestStatements(qid, "P31")[1]
if not showdab and prop31 and prop31.mainsnak.datavalue.value.id == "Q4167410" then
return nil
else
return qid
end
end
end
-------------------------------------------------------------------------------
-- getDatePrecision returns the number representing the precision of the first best date value
-- for the given property.
-- It takes the qid and property ID
-- The meanings are given at https://www.mediawiki.org/wiki/Wikibase/DataModel#Dates_and_times
-- 0 = 1 billion years .. 6 = millennium, 7 = century, 8 = decade, 9 = year, 10 = month, 11 = day
-- Returns 0 (or the second unnamed parameter) if the Wikidata does not exist.
-------------------------------------------------------------------------------
-- Dependencies: parseParam; sourced;
-------------------------------------------------------------------------------
function p.getDatePrecision(frame)
local args=frame.args
if not args[1] then args=frame:getParent().args end
local default = tonumber(args[2] or args.default) or 0
local prop = mw.text.trim(args[1] or "")
if prop == "" then return default end
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return default end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local stat = mw.wikibase.getBestStatements(qid, prop)
for i, v in ipairs(stat) do
local prec = (onlysrc == false or sourced(v))
and v.mainsnak.datavalue
and v.mainsnak.datavalue.value
and v.mainsnak.datavalue.value.precision
if prec then return prec end
end
return default
end
return p
-------------------------------------------------------------------------------
-- List of exported functions
-------------------------------------------------------------------------------
--[[
_getValue
getValue
getPreferredValue
getCoords
getQualifierValue
getSumOfParts
getValueByQual
getValueByLang
getValueByRefSource
getPropertyIDs
getQualifierIDs
getPropOfProp
getAwardCat
getIntersectCat
getGlobe
getCommonsLink
getSiteLink
getLink
getLabel
label
getAT
getDescription
getAliases
pageId
formatDate
location
checkBlacklist
emptyor
labelorid
getLang
getItemLangCode
findLanguage
getQID
followQid
globalSiteID
siteID
projID
formatNumber
examine
checkvalue
url2
getWebsite
getAllLabels
getAllDescriptions
getAllAliases
showNoLinks
checkValidity
getEntityFromTitle
getDatePrecision
--]]
-------------------------------------------------------------------------------
cdfad4f2433151e512d5023478c35bceaf5c980a
Template:Module link expanded
10
194
405
2023-07-13T14:23:50Z
wikipedia>Grufo
0
Add includeonly
wikitext
text/x-wiki
<includeonly><code>{{{{{{{|safesubst:}}}#invoke:Separated entries|main|[[Module:{{{1}}}{{{section|}}}|#invoke:{{{1}}}]]|{{{2|''function''}}}|separator=|}}}}</code></includeonly><noinclude>{{documentation}}<!-- Categories go on the /doc subpage and interwikis go on Wikidata. --></noinclude>
fe65540c0f768ae41c071fe8617ea0d5c38617e7
Module:Collapsible list
828
142
292
2023-07-13T14:29:43Z
wikipedia>Frietjes
0
we don't need to track this anymore after it was all cleaned up back in [[Template_talk:Collapsible_list/Archive_1#titlestyle_again|2018 to 2019]]
Scribunto
text/plain
local p = {}
local function getListItem( data )
if not type( data ) == 'string' then
return ''
end
return mw.ustring.format( '<li style="line-height: inherit; margin: 0">%s</li>', data )
end
-- Returns an array containing the keys of all positional arguments
-- that contain data (i.e. non-whitespace values).
local function getArgNums( args )
local nums = {}
for k, v in pairs( args ) do
if type( k ) == 'number' and
k >= 1 and
math.floor( k ) == k and
type( v ) == 'string' and
mw.ustring.match( v, '%S' ) then
table.insert( nums, k )
end
end
table.sort( nums )
return nums
end
-- Formats a list of classes, styles or other attributes.
local function formatAttributes( attrType, ... )
local attributes = { ... }
local nums = getArgNums( attributes )
local t = {}
for i, num in ipairs( nums ) do
table.insert( t, attributes[ num ] )
end
if #t == 0 then
return '' -- Return the blank string so concatenation will work.
end
return mw.ustring.format( ' %s="%s"', attrType, table.concat( t, ' ' ) )
end
-- TODO: use Module:List. Since the update for this comment is routine,
-- this is blocked without a consensus discussion by
-- [[MediaWiki_talk:Common.css/Archive_15#plainlist_+_hlist_indentation]]
-- if we decide hlist in plainlist in this template isn't an issue, we can use
-- module:list directly
-- [https://en.wikipedia.org/w/index.php?title=Module:Collapsible_list/sandbox&oldid=1130172480]
-- is an implementation (that will code rot slightly I expect)
local function buildList( args )
-- Get the list items.
local listItems = {}
local argNums = getArgNums( args )
for i, num in ipairs( argNums ) do
table.insert( listItems, getListItem( args[ num ] ) )
end
if #listItems == 0 then
return ''
end
listItems = table.concat( listItems )
-- hack around mw-collapsible show/hide jumpiness by looking for text-alignment
-- by setting a margin if centered
local textAlignmentCentered = 'text%-align%s*:%s*center'
local centeredTitle = (args.title_style and args.title_style:lower():match(textAlignmentCentered)
or args.titlestyle and args.titlestyle:lower():match(textAlignmentCentered))
local centeredTitleSpacing
if centeredTitle then
centeredTitleSpacing = 'margin: 0 4em'
else
centeredTitleSpacing = ''
end
-- Get class, style and title data.
local collapsibleContainerClass = formatAttributes(
'class',
'collapsible-list',
'mw-collapsible',
not args.expand and 'mw-collapsed'
)
local collapsibleContainerStyle = formatAttributes(
'style',
-- mostly work around .infobox-full-data defaulting to centered
'text-align: left;',
args.frame_style,
args.framestyle
)
local collapsibleTitleStyle = formatAttributes(
'style',
'line-height: 1.6em; font-weight: bold;',
args.title_style,
args.titlestyle
)
local jumpyTitleStyle = formatAttributes(
'style',
centeredTitleSpacing
)
local title = args.title or 'List'
local ulclass = formatAttributes( 'class', 'mw-collapsible-content', args.hlist and 'hlist' )
local ulstyle = formatAttributes(
'style',
'margin-top: 0; margin-bottom: 0; line-height: inherit;',
not args.bullets and 'list-style: none; margin-left: 0;',
args.list_style,
args.liststyle
)
local hlist_templatestyles = ''
if args.hlist then
hlist_templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Hlist/styles.css' }
}
end
-- Build the list.
return mw.ustring.format(
'%s<div%s%s>\n<div%s><div%s>%s</div></div>\n<ul%s%s>%s</ul>\n</div>',
hlist_templatestyles, collapsibleContainerClass, collapsibleContainerStyle,
collapsibleTitleStyle, jumpyTitleStyle, title, ulclass, ulstyle, listItems
)
end
function p.main( frame )
local origArgs
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
for k, v in pairs( frame.args ) do
origArgs = frame.args
break
end
else
origArgs = frame
end
local args = {}
for k, v in pairs( origArgs ) do
if type( k ) == 'number' or v ~= '' then
args[ k ] = v
end
end
return buildList( args )
end
return p
5b7e779e7529bcb12a219726ef6c948ea98874fd
Module:Plain text
828
128
264
2023-07-24T05:28:17Z
wikipedia>Jonesey95
0
keep contents of sub, sup, and underline (see talk)
Scribunto
text/plain
--converts text with wikilinks to plain text, e.g "[[foo|gah]] is [[bar]]" to "gah is bar"
--removes anything enclosed in tags that isn't nested, mediawiki strip markers (references etc), files, italic and bold markup
require[[strict]]
local p = {}
function p.main(frame)
local text = frame.args[1]
local encode = require('Module:yesno')(frame.args.encode)
return p._main(text, encode)
end
function p._main(text, encode)
if not text then return end
text = mw.text.killMarkers(text)
:gsub(' ', ' ') --replace nbsp spaces with regular spaces
:gsub('<br ?/?>', ', ') --replace br with commas
:gsub('<span.->(.-)</span>', '%1') --remove spans while keeping text inside
:gsub('<i.->(.-)</i>', '%1') --remove italics while keeping text inside
:gsub('<b.->(.-)</b>', '%1') --remove bold while keeping text inside
:gsub('<em.->(.-)</em>', '%1') --remove emphasis while keeping text inside
:gsub('<strong.->(.-)</strong>', '%1') --remove strong while keeping text inside
:gsub('<sub.->(.-)</sub>', '%1') --remove subscript markup; retain contents
:gsub('<sup.->(.-)</sup>', '%1') --remove superscript markup; retain contents
:gsub('<u.->(.-)</u>', '%1') --remove underline markup; retain contents
:gsub('<.->.-<.->', '') --strip out remaining tags and the text inside
:gsub('<.->', '') --remove any other tag markup
:gsub('%[%[%s*[Ff][Ii][Ll][Ee]%s*:.-%]%]', '') --strip out files
:gsub('%[%[%s*[Ii][Mm][Aa][Gg][Ee]%s*:.-%]%]', '') --strip out use of image:
:gsub('%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:.-%]%]', '') --strip out categories
:gsub('%[%[[^%]]-|', '') --strip out piped link text
:gsub('([^%[])%[[^%[%]][^%]]-%s', '%1') --strip out external link text
:gsub('^%[[^%[%]][^%]]-%s', '') --strip out external link text
:gsub('[%[%]]', '') --then strip out remaining [ and ]
:gsub("'''''", "") --strip out bold italic markup
:gsub("'''?", "") --not stripping out '''' gives correct output for bolded text in quotes
:gsub('----+', '') --remove ---- lines
:gsub("^%s+", "") --strip leading
:gsub("%s+$", "") --and trailing spaces
:gsub("%s+", " ") --strip redundant spaces
if encode then
return mw.text.encode(text)
else
return text
end
end
return p
8d406c43e8cf1dadf34be7d3b395f44ba4c48b75
Module:Documentation
828
56
114
2023-07-31T17:22:10Z
wikipedia>Izno
0
add a comment to make it obvious
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
local format = mw.ustring.format
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return format('[[%s|%s]]', page, display)
else
return format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return format(
'<span class="%s">(%s)</span>',
message('toolbar-class'),
table.concat(ret, ' | ')
)
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:attr('role', 'complementary')
:attr('aria-labelledby', args.heading ~= '' and 'documentation-heading' or nil)
:attr('aria-label', args.heading == '' and 'Documentation' or nil)
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.canonicalUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[File:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle
and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local pagetype
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
else
pagetype = message('sandbox-notice-pagetype-other')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if compareUrl then
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
else
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(message('sandbox-category'))
-- 'documentation-clear'
return '<div class="' .. message('clear') .. '"></div>'
.. require('Module:Message box').main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- The page is edit-protected.
return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
return require('Module:Protection banner')._main{
action = 'move', small = true
}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
return {
title = title,
docTitle = docTitle,
-- View, display, edit, and purge links if /doc exists.
viewLinkDisplay = message('view-link-display'),
editLinkDisplay = message('edit-link-display'),
historyLinkDisplay = message('history-link-display'),
purgeLinkDisplay = message('purge-link-display'),
preload = preload,
createLinkDisplay = message('create-link-display')
}
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create][purge] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local docTitle = data.docTitle
-- yes, we do intend to purge the template page on which the documentation appears
local purgeLink = makeWikilink("Special:Purge/" .. data.title.prefixedText, data.purgeLinkDisplay)
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeWikilink("Special:EditPage/" .. docTitle.prefixedText, data.editLinkDisplay)
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, data.historyLinkDisplay)
return "[" .. viewLink .. "] [" .. editLink .. "] [" .. historyLink .. "] [" .. purgeLink .. "]"
else
local createLink = makeUrlLink(docTitle:canonicalUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
return "[" .. createLink .. "] [" .. purgeLink .. "]"
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:attr('id', 'documentation-heading')
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:attr('role', 'note')
:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local ret
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editDisplay = message('edit-link-display')
local editLink = makeWikilink("Special:EditPage/" .. docTitle.prefixedText, editDisplay)
local historyDisplay = message('history-link-display')
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:canonicalUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
.. '<br />'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeWikilink("Special:EditPage/" .. sandboxPage, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:canonicalUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeWikilink("Special:EditPage/" .. testcasesPage, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:canonicalUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
end
return ret
end
return p
268dc89480af10873bfbca5439ae8e61b404f770
Template:Short description/doc
10
86
174
2023-08-02T05:28:41Z
wikipedia>Jusdafax
0
Reverted edits by [[Special:Contributions/177.236.76.0|177.236.76.0]] ([[User talk:177.236.76.0|talk]]): page blanking ([[WP:HG|HG]]) (3.4.10)
wikitext
text/x-wiki
{{Documentation subpage}}
{{High risk|all-pages = yes}}
{{Warning|'''Please do not use redirects/shortcuts for this template''', as they cause problems with the [[Wikipedia:Shortdesc helper|short description editing gadget]] and other maintenance tools.}}
{{Lua|Module:Check for unknown parameters|Module:String}}
'''[[Template:Short description]]''' is used to add a [[Wikipedia:Short description|short description]] (which can be edited from within Wikipedia) to a Wikipedia page. These descriptions appear in Wikipedia searches and elsewhere, and help users identify the desired article.
== Usage ==
{{tld|Short description|''Write your short description here''}}
This should be limited to about 40 characters, as explained at [[WP:SDFORMAT]], along with the other guidance at [[WP:SDCONTENT]].
== Parameters ==
{{TemplateData header|noheader=1}}
<templatedata>
{
"description": {
"en": "Creates a short description for a Wikipedia page, which is displayed in search results and other locations.",
"es": "Crea una breve descripción, para un artículo de Wikipedia, que se utiliza en el Editor Visual para proporcionar contexto en los wikilinks (wikienlaces)."
},
"params": {
"1": {
"label": {
"en": "Description",
"es": "Descripción"
},
"description": {
"en": "The short description of the article or 'none'. It should be limited to about 40 characters.",
"es": "La descripción corta del artículo"
},
"example": {
"en": "Chinese encyclopedia writer (1947–2001)",
"es": "La enciclopedia en línea que cualquiera puede editar"
},
"required": true,
"type": "content"
},
"2": {
"label": {
"en": "No replace?",
"es": "2"
},
"description": {
"en": "Should be unused or 'noreplace'. Templates with noreplace will not replace a short description defined by an earlier template. Mainly for use within transcluded templates.",
"es": "Se anula una descripción corta si se transcluye. Debe estar sin usar o con 'noreplace' (que significar no reemplazar)."
},
"example": {
"es": "noreplace"
},
"required": false,
"type": "string",
"autovalue": "noreplace",
"suggestedvalues": [
"noreplace"
]
},
"pagetype": {
"type": "string",
"description": {
"en": "The type of page. This puts it in the appropriate category - Things with short description. Normally unneeded, since handled through namespace detection.",
"es": "El tipo de página. La coloca en la categoría apropiada - Cosas con descripción corta"
},
"example": "Redirect, Disambiguation page",
"required": false
}
},
"format": "{{_|_ = _}}\n"
}
</templatedata>
== About writing good short descriptions ==
This page is about the short description {{em|template}}; it does not provide guidelines for writing a good short description. If you plan to use this template, you should make sure you read and follow the detailed guidance at [[WP:HOWTOSD]]. General information can be found at [[Wikipedia:Short description]].
== Template information ==
Eventually all articles should have a short description:
* by directly using this template, in which case the short description will be unique to the article
* transcluded in another template, such as a disambiguation template, where a generic short description is adequate for a large class of pages
* where the short description is assembled from data in an infobox
Automatically generated descriptions within templates should set the second parameter as {{code|noreplace}} so they do not override any short descriptions specifically added to the transcluding article.
Short descriptions are not normally needed for non-article pages, such as redirects, but can be added if useful.
If the article title alone is sufficient to ensure reliable identification of the desired article, a null value of {{tnull|Short description|none}} may be used.
Short descriptions do not necessarily serve the same function as the Wikidata description for an item and they do not have to be the same, but some overlap is expected in many cases. Some Wikidata descriptions may be unsuitable, and if imported must be checked for relevance, accuracy and fitness for purpose. Responsibility for such imports lies with the importer. {{crossref|(See also [[d:Help:Description|Wikidata:Help:Description]].)}}
=== Example ===
At [[Oxygen therapy]], add the following at the very top of the article, above everything else:
* {{tld|Short description|Use of oxygen as medical treatment}}
== Testing ==
For testing purposes, the display of this template can be enabled by adding a line to your [[Special:MyPage/common.css]]:
* <syntaxhighlight lang="CSS" inline>.shortdescription { display:block !important; }</syntaxhighlight>
This can be easily removed or disabled when testing is finished.
If you want to {{em|always}} see short descriptions, you may prefer a more utilitarian layout, such as:
<syntaxhighlight lang="CSS">
.shortdescription {
display:block !important;
white-space: pre-wrap;
}
.shortdescription::before {
content: "\A[Short description:\0020";
}
.shortdescription::after {
content: "]\A";
}
</syntaxhighlight>
There is a test version of this template available as [[Template:Short description/test]] which displays its text by default.
* {{tld|Short description/test}} displays the short description if supplied
* {{tld|Short description/test}} displays nothing if <code>none</code> is supplied
* {{tld|Short description/test}} displays the description from Wikidata if <code>wikidata</code> is supplied.
Taking {{Q|Q1096878}} as an example:
* <code><nowiki>{{short description/test|Underwater diving where breathing is from equipment independent of the surface}}</nowiki></code> → {{short description/test|Underwater diving where breathing is from equipment independent of the surface }}
* <code><nowiki>{{short description/test|none}}</nowiki></code> → {{short description/test|none}}
* <code><nowiki>{{short description/test|wikidata}}</nowiki></code> → {{short description/test|wikidata|qid=Q1096878}}
===Pagetype parameter===
If {{param|Pagetype}} is '''not''' set, then this template adds the article to a category based on the namespace:
* {{clc|Articles with short description}}
* {{clc|Redirects with short description}} {{--}} for redirects in any namespace
If {{param|Pagetype}} '''is''' set, then this template adds the article to a category matching the parameter. For example:
* {{cl|Redirects with short description}} {{--}} {{code|pagetype {{=}} Redirect }}
{{anchor|No-aliases}}
== Aliases ==
{{shortcut|WP:SDNOALIASES}}
While there are currently <span class="plainlinks">[{{fullurl:Special:WhatLinksHere/Template:Short_description|hidetrans=1&hidelinks=1&limit=500}} redirects to this template]</span>, '''they must not be used''', for the reasons below:
:* Other templates and gadgets attempt to extract short descriptions from pages by explicitly searching for the transclusions of the {{tl|Short description}} template.
:* For example, {{tl|Annotated link}} searches for the template in its uppercase "Short description" and lowercase form "short description".
'''Do not''' start the template with a space: {{code|<nowiki> {{ Short description...</nowiki>}}. While this does create a valid short description, the space will prevent searches for the {{code|<nowiki>{{Short description...</nowiki>}} text.
==Tracking categories==
* {{clc|Templates that generate short descriptions}}
* {{clc|Modules that create a short description}}
* {{clc|Short description matches Wikidata}}
* {{clc|Short description is different from Wikidata}}
* {{clc|Short description with empty Wikidata description}}
== Maintenance categories ==
* {{clc|Pages using short description with unknown parameters}}
* {{clc|Articles with long short description}}
* {{clc|Pages with lower-case short description}}
==See also ==
* {{tlx|Auto short description}}
* {{tlx|Annotated link}}
* {{tlx|laal}} – displays an article's pagelinks alongside its short description
* [[Wikipedia:Short descriptions]] — background information
* [[Wikipedia:WikiProject Short descriptions]] — project to add Short descriptions to all articles
<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
<!-- Category:Articles with short description (maintenance category)? -->
[[Category:Templates that add a tracking category]]
[[Category:Templates that generate short descriptions]]
}}</includeonly>
5de7c025a071fa8a4a8dadbf7245386999fb4ea7
Module:Transclusion count/data/C
828
178
373
2023-08-06T05:10:20Z
wikipedia>Ahechtbot
0
[[Wikipedia:BOT|Bot]]: Updated page.
Scribunto
text/plain
return {
["C"] = 649000,
["C-Class"] = 17000,
["C-SPAN"] = 12000,
["C-cmn"] = 2600,
["C-pl"] = 52000,
["C."] = 4000,
["CAN"] = 20000,
["CANelec"] = 14000,
["CANelec/gain"] = 2600,
["CANelec/hold"] = 4900,
["CANelec/source"] = 7100,
["CANelec/top"] = 6400,
["CANelec/total"] = 6200,
["CAS"] = 3800,
["CBB_Standings_End"] = 14000,
["CBB_Standings_Entry"] = 14000,
["CBB_Standings_Start"] = 14000,
["CBB_Yearly_Record_End"] = 3100,
["CBB_Yearly_Record_Entry"] = 3100,
["CBB_Yearly_Record_Start"] = 3000,
["CBB_Yearly_Record_Subhead"] = 3700,
["CBB_Yearly_Record_Subtotal"] = 2900,
["CBB_roster/Footer"] = 7900,
["CBB_roster/Header"] = 7900,
["CBB_roster/Player"] = 7900,
["CBB_schedule_end"] = 11000,
["CBB_schedule_entry"] = 11000,
["CBB_schedule_start"] = 11000,
["CBB_standings_end"] = 15000,
["CBB_standings_entry"] = 15000,
["CBB_standings_start"] = 15000,
["CBB_yearly_record_end"] = 4100,
["CBB_yearly_record_end/legend"] = 3600,
["CBB_yearly_record_entry"] = 4100,
["CBB_yearly_record_start"] = 4000,
["CBB_yearly_record_subhead"] = 3700,
["CBB_yearly_record_subtotal"] = 3800,
["CBSB_Standings_End"] = 4200,
["CBSB_Standings_Entry"] = 4200,
["CBSB_Standings_Start"] = 4200,
["CBSB_link"] = 3500,
["CBSB_standings_end"] = 4400,
["CBSB_standings_entry"] = 4400,
["CBSB_standings_start"] = 4400,
["CC0"] = 3900,
["CENTURY"] = 16000,
["CFB_Standings_End"] = 34000,
["CFB_Standings_Entry"] = 34000,
["CFB_Standings_Start"] = 34000,
["CFB_Yearly_Record_End"] = 6800,
["CFB_Yearly_Record_End/legend"] = 2400,
["CFB_Yearly_Record_Entry"] = 6800,
["CFB_Yearly_Record_Start"] = 6800,
["CFB_Yearly_Record_Subhead"] = 6800,
["CFB_Yearly_Record_Subtotal"] = 6600,
["CFB_schedule"] = 26000,
["CFB_schedule_entry"] = 19000,
["CFB_standings_end"] = 34000,
["CFB_standings_entry"] = 34000,
["CFB_standings_start"] = 34000,
["CFL_Year"] = 5600,
["CGF_year"] = 2600,
["CHE"] = 10000,
["CHI"] = 2700,
["CHL"] = 3600,
["CHN"] = 11000,
["CN"] = 3400,
["CO2"] = 3300,
["COI"] = 14000,
["COIUL"] = 129000,
["COI_editnotice"] = 6700,
["COL"] = 4900,
["COLON"] = 13000,
["CRI"] = 2200,
["CRO"] = 5400,
["CSK"] = 2800,
["CSS_image_crop"] = 4500,
["CUB"] = 3700,
["CURRENTDATE"] = 3600,
["CURRENTMINUTE"] = 2500,
["CYP"] = 2100,
["CZE"] = 15000,
["Calendar"] = 2400,
["California/color"] = 12000,
["Call_sign_disambiguation"] = 3100,
["Campaignbox"] = 23000,
["CanProvName"] = 14000,
["CanadaByProvinceCatNav"] = 9800,
["CanadaProvinceThe"] = 4000,
["Canadian_English"] = 6900,
["Canadian_Parliament_links"] = 5100,
["Canadian_election_result"] = 14000,
["Canadian_election_result/gain"] = 2700,
["Canadian_election_result/hold"] = 5000,
["Canadian_election_result/source"] = 8100,
["Canadian_election_result/top"] = 14000,
["Canadian_election_result/top/ElectionYearTest"] = 5800,
["Canadian_election_result/total"] = 11000,
["Canadian_party_colour"] = 8100,
["Canadian_party_colour/colour"] = 18000,
["Canadian_party_colour/colour/default"] = 18000,
["Canadian_party_colour/name"] = 15000,
["Canadian_party_colour/name/default"] = 6900,
["Canned_search"] = 5500,
["Cardinal_to_word"] = 6400,
["Cascite"] = 15000,
["Caselaw_source"] = 4000,
["Cassini-Ehess"] = 2600,
["Cast_listing"] = 15000,
["Castlist"] = 2400,
["Cat"] = 345000,
["CatAutoTOC"] = 658000,
["CatAutoTOC/core"] = 657000,
["CatRel"] = 3800,
["CatTrack"] = 3100,
["Cat_class"] = 6700,
["Cat_in_use"] = 50000,
["Cat_main"] = 199000,
["Cat_more"] = 101000,
["Cat_more_if_exists"] = 41000,
["Cat_see_also"] = 3500,
["Catalog_lookup_link"] = 515000,
["Category-Class"] = 14000,
["Category-inline"] = 9100,
["Category_TOC"] = 72000,
["Category_TOC/tracking"] = 72000,
["Category_U.S._State_elections_by_year"] = 7300,
["Category_U.S._State_elections_by_year/core"] = 7300,
["Category_class"] = 35000,
["Category_class/column"] = 35000,
["Category_class/second_row_column"] = 35000,
["Category_described_in_year"] = 5700,
["Category_diffuse"] = 7800,
["Category_disambiguation"] = 2400,
["Category_disambiguation/category_link"] = 2400,
["Category_explanation"] = 236000,
["Category_handler"] = 3300000,
["Category_ifexist"] = 5100,
["Category_importance"] = 10000,
["Category_importance/column"] = 10000,
["Category_importance/second_row_column"] = 10000,
["Category_link"] = 135000,
["Category_link_with_count"] = 6800,
["Category_more"] = 111000,
["Category_more_if_exists"] = 41000,
["Category_ordered_by_date"] = 11000,
["Category_other"] = 895000,
["Category_redirect"] = 109000,
["Category_see_also"] = 39000,
["Category_see_also/Category_pair_check"] = 39000,
["Category_see_also_if_exists"] = 72000,
["Category_see_also_if_exists_2"] = 88000,
["Category_title"] = 2400,
["Catexp"] = 7900,
["CathEncy"] = 2300,
["Catholic"] = 4100,
["Catholic_Encyclopedia"] = 5100,
["Catmain"] = 27000,
["Catmore"] = 9400,
["Cbb_link"] = 8700,
["Cbignore"] = 100000,
["Cbsb_link"] = 2100,
["Cc-by-2.5"] = 3800,
["Cc-by-3.0"] = 8600,
["Cc-by-sa-2.5"] = 2600,
["Cc-by-sa-2.5,2.0,1.0"] = 2600,
["Cc-by-sa-3.0"] = 25000,
["Cc-by-sa-3.0,2.5,2.0,1.0"] = 2200,
["Cc-by-sa-3.0-migrated"] = 24000,
["Cc-by-sa-4.0"] = 10000,
["Cc-zero"] = 3800,
["CensusAU"] = 9200,
["Census_2016_AUS"] = 6900,
["Cent"] = 5700,
["Center"] = 287000,
["Centralized_discussion"] = 6100,
["Centralized_discussion/core"] = 6100,
["Centralized_discussion/styles.css"] = 6100,
["Centre"] = 3200,
["Century"] = 2100,
["Century_name_from_decade"] = 2400,
["Century_name_from_decade_or_year"] = 77000,
["Century_name_from_title_decade"] = 7600,
["Century_name_from_title_year"] = 7500,
["Certification_Cite/Title"] = 30000,
["Certification_Cite/URL"] = 33000,
["Certification_Cite/archivedate"] = 6000,
["Certification_Cite/archiveurl"] = 6000,
["Certification_Cite_Ref"] = 29000,
["Certification_Table_Bottom"] = 29000,
["Certification_Table_Entry"] = 30000,
["Certification_Table_Entry/Foot"] = 29000,
["Certification_Table_Entry/Foot/helper"] = 29000,
["Certification_Table_Entry/Region"] = 30000,
["Certification_Table_Entry/Sales"] = 29000,
["Certification_Table_Entry/Sales/BelgianPeriod"] = 2100,
["Certification_Table_Entry/Sales/DanishPeriod"] = 3200,
["Certification_Table_Entry/Sales/DanishPeriodHelper1"] = 3200,
["Certification_Table_Entry/Sales/DanishPeriodHelper2"] = 3200,
["Certification_Table_Entry/Sales/GermanPeriod"] = 4000,
["Certification_Table_Entry/Sales/ItalianHelper"] = 3200,
["Certification_Table_Entry/Sales/NewZealandPeriod"] = 2000,
["Certification_Table_Entry/Sales/SwedishPeriod"] = 2100,
["Certification_Table_Separator"] = 2300,
["Certification_Table_Top"] = 30000,
["Cfb_link"] = 24000,
["Cfd_result"] = 2400,
["Cfdend"] = 4000,
["Chart"] = 4600,
["Chart/end"] = 4700,
["Chart/start"] = 4600,
["Chart_bottom"] = 3500,
["Chart_top"] = 3500,
["Check_completeness_of_transclusions"] = 7300,
["Check_talk"] = 30000,
["Check_talk_wp"] = 1370000,
["Check_winner_by_scores"] = 13000,
["CheckedSockpuppet"] = 7200,
["Checked_sockpuppet"] = 18000,
["Checkedsockpuppet"] = 5300,
["Checkip"] = 13000,
["Checkuser"] = 75000,
["Checkuserblock-account"] = 17000,
["Chem"] = 5800,
["Chem/atom"] = 5700,
["Chem/link"] = 5800,
["Chem2"] = 4800,
["Chem_molar_mass"] = 18000,
["Chem_molar_mass/format"] = 18000,
["Chembox"] = 14000,
["Chembox/styles.css"] = 14000,
["Chembox_3DMet"] = 14000,
["Chembox_3DMet/format"] = 14000,
["Chembox_AllOtherNames"] = 13000,
["Chembox_AllOtherNames/format"] = 13000,
["Chembox_Appearance"] = 6100,
["Chembox_BoilingPt"] = 3800,
["Chembox_CASNo"] = 14000,
["Chembox_CASNo/format"] = 14000,
["Chembox_CalcTemperatures"] = 6800,
["Chembox_ChEBI"] = 14000,
["Chembox_ChEBI/format"] = 14000,
["Chembox_ChEMBL"] = 14000,
["Chembox_ChEMBL/format"] = 14000,
["Chembox_ChemSpiderID"] = 14000,
["Chembox_ChemSpiderID/format"] = 14000,
["Chembox_CompTox"] = 14000,
["Chembox_CompTox/format"] = 14000,
["Chembox_Datapage_check"] = 14000,
["Chembox_Density"] = 4900,
["Chembox_DrugBank"] = 14000,
["Chembox_DrugBank/format"] = 14000,
["Chembox_ECHA"] = 7600,
["Chembox_ECNumber"] = 14000,
["Chembox_ECNumber/format"] = 14000,
["Chembox_Elements"] = 14000,
["Chembox_Elements/molecular_formula"] = 18000,
["Chembox_Footer"] = 14000,
["Chembox_Footer/tracking"] = 14000,
["Chembox_GHS_(set)"] = 3500,
["Chembox_Hazards"] = 12000,
["Chembox_IUPHAR_ligand"] = 14000,
["Chembox_IUPHAR_ligand/format"] = 14000,
["Chembox_Identifiers"] = 14000,
["Chembox_InChI"] = 13000,
["Chembox_InChI/format"] = 13000,
["Chembox_Indexlist"] = 14000,
["Chembox_Jmol"] = 14000,
["Chembox_Jmol/format"] = 14000,
["Chembox_KEGG"] = 14000,
["Chembox_KEGG/format"] = 14000,
["Chembox_MeltingPt"] = 5800,
["Chembox_Properties"] = 14000,
["Chembox_PubChem"] = 14000,
["Chembox_PubChem/format"] = 14000,
["Chembox_RTECS"] = 14000,
["Chembox_RTECS/format"] = 14000,
["Chembox_Related"] = 3400,
["Chembox_SMILES"] = 13000,
["Chembox_SMILES/format"] = 13000,
["Chembox_SolubilityInWater"] = 3900,
["Chembox_Structure"] = 2100,
["Chembox_UNII"] = 14000,
["Chembox_UNII/format"] = 14000,
["Chembox_headerbar"] = 14000,
["Chembox_image"] = 13000,
["Chembox_image_cell"] = 12000,
["Chembox_image_sbs"] = 13000,
["Chembox_parametercheck"] = 13000,
["Chembox_setDatarow"] = 4500,
["Chembox_setHeader"] = 4500,
["Chembox_templatePar/formatPreviewMessage"] = 14000,
["Chembox_verification"] = 7100,
["Chemicals"] = 7400,
["Chemistry"] = 3100,
["Chemspidercite"] = 11000,
["Chessgames_player"] = 3600,
["Chinese"] = 7200,
["Chr"] = 9100,
["ChristianityWikiProject"] = 5700,
["Circa"] = 70000,
["Circular_reference"] = 4100,
["Citation"] = 403000,
["Citation/make_link"] = 6000,
["Citation/styles.css"] = 46000,
["Citation_needed"] = 544000,
["Citation_needed_span"] = 3500,
["Citation_style"] = 4300,
["Cite_AV_media"] = 43000,
["Cite_AV_media_notes"] = 26000,
["Cite_Appletons'"] = 2400,
["Cite_Australian_Dictionary_of_Biography"] = 3300,
["Cite_Catholic_Encyclopedia"] = 8100,
["Cite_Colledge2006"] = 3100,
["Cite_DCB"] = 2800,
["Cite_DNB"] = 18000,
["Cite_EB1911"] = 25000,
["Cite_GNIS"] = 2300,
["Cite_Gaia_DR2"] = 2100,
["Cite_IUCN"] = 58000,
["Cite_Instagram"] = 2000,
["Cite_Jewish_Encyclopedia"] = 2900,
["Cite_NIE"] = 3600,
["Cite_NSW_Parliament"] = 3300,
["Cite_NSW_SHR"] = 2600,
["Cite_ODNB"] = 17000,
["Cite_Q"] = 44000,
["Cite_QHR"] = 3000,
["Cite_QPN"] = 4000,
["Cite_Rowlett"] = 2500,
["Cite_Russian_law"] = 7800,
["Cite_Ryan"] = 3200,
["Cite_Sports-Reference"] = 54000,
["Cite_USGov"] = 24000,
["Cite_WoRMS"] = 5400,
["Cite_act"] = 2700,
["Cite_arXiv"] = 5000,
["Cite_bcgnis"] = 3100,
["Cite_book"] = 1590000,
["Cite_certification"] = 33000,
["Cite_cgndb"] = 3300,
["Cite_comic"] = 2100,
["Cite_conference"] = 16000,
["Cite_court"] = 5400,
["Cite_court/styles.css"] = 5400,
["Cite_dictionary"] = 3600,
["Cite_document"] = 5200,
["Cite_encyclopedia"] = 204000,
["Cite_episode"] = 17000,
["Cite_gnis"] = 34000,
["Cite_interview"] = 7700,
["Cite_iucn"] = 58000,
["Cite_journal"] = 957000,
["Cite_magazine"] = 269000,
["Cite_map"] = 39000,
["Cite_news"] = 1510000,
["Cite_newspaper_The_Times"] = 6500,
["Cite_patent"] = 5500,
["Cite_patent/authors"] = 4400,
["Cite_patent/core"] = 5800,
["Cite_peakbagger"] = 4500,
["Cite_podcast"] = 3800,
["Cite_press_release"] = 65000,
["Cite_report"] = 35000,
["Cite_rowlett"] = 2500,
["Cite_simbad"] = 4500,
["Cite_sports-reference"] = 59000,
["Cite_thesis"] = 32000,
["Cite_tweet"] = 36000,
["Cite_video"] = 12000,
["Cite_video_game"] = 3100,
["Cite_web"] = 4560000,
["Cite_wikisource"] = 5600,
["Cite_wikisource/make_link"] = 58000,
["Civil_navigation"] = 2700,
["Cl"] = 132000,
["Clade"] = 7500,
["Clade/styles.css"] = 7600,
["Clarify"] = 40000,
["Class"] = 686000,
["Class/colour"] = 8560000,
["Class/icon"] = 21000,
["Class_mask"] = 8340000,
["Class_mask/b"] = 342000,
["Classical"] = 6900,
["Classicon"] = 4700,
["Clc"] = 5900,
["Cleanup"] = 10000,
["Cleanup_bare_URLs"] = 28000,
["Cleanup_reorganize"] = 2500,
["Cleanup_rewrite"] = 5900,
["Clear"] = 2940000,
["Clear-left"] = 4100,
["Clear_left"] = 31000,
["Clear_right"] = 2700,
["Clerk-Note"] = 9800,
["Clerk_Request"] = 2000,
["Clerknote"] = 7400,
["Clickable_button"] = 16000,
["Clickable_button_2"] = 957000,
["Closed_access"] = 4400,
["Closed_rfc_top"] = 2200,
["Clr"] = 3600,
["Clubplayerscat"] = 8500,
["Cmbox"] = 418000,
["Cn"] = 93000,
["Cnote2"] = 2300,
["Cnote2_Begin"] = 2300,
["Cnote2_End"] = 2300,
["Coat_of_arms"] = 5200,
["Cob"] = 12000,
["Code"] = 50000,
["Col-1-of-2"] = 2400,
["Col-2"] = 170000,
["Col-2-of-2"] = 2300,
["Col-3"] = 10000,
["Col-4"] = 3500,
["Col-begin"] = 212000,
["Col-break"] = 211000,
["Col-end"] = 211000,
["Col-float"] = 2700,
["Col-float-break"] = 2600,
["Col-float-end"] = 2700,
["Col-float/styles.css"] = 2700,
["Col-start"] = 20000,
["Colbegin"] = 21000,
["Colend"] = 24000,
["Collapse"] = 9700,
["Collapse_bottom"] = 51000,
["Collapse_top"] = 52000,
["Collapsebottom"] = 3800,
["Collapsetop"] = 3800,
["Collapsible_list"] = 53000,
["Collapsible_option"] = 134000,
["College"] = 8800,
["CollegePrimaryHeader"] = 5900,
["CollegePrimaryStyle"] = 96000,
["CollegeSecondaryStyle"] = 3500,
["College_Athlete_Recruit_End"] = 2900,
["College_Athlete_Recruit_Entry"] = 3000,
["College_Athlete_Recruit_Start"] = 2900,
["College_athlete_recruit_end"] = 4000,
["College_athlete_recruit_entry"] = 4200,
["College_athlete_recruit_start"] = 4200,
["College_color_list"] = 3900,
["Colon"] = 18000,
["Color"] = 469000,
["Color_box"] = 73000,
["Colorbox"] = 3600,
["Colorbull"] = 4900,
["Colored_link"] = 63000,
["Colors"] = 3800,
["Colour"] = 5800,
["Coloured_link"] = 6900,
["Column"] = 2400,
["Column/styles.css"] = 2400,
["Columns-end"] = 2100,
["Columns-list"] = 98000,
["Columns-start"] = 2200,
["Comedy"] = 2500,
["Comic_Book_DB"] = 3500,
["Comicbookdb"] = 3500,
["Comics-replaceability"] = 2900,
["Comics_infobox_sec/creator_nat"] = 2800,
["Comics_infobox_sec/formcat"] = 3200,
["Comics_infobox_sec/genre"] = 4000,
["Comics_infobox_sec/genrecat"] = 3600,
["Comics_infobox_sec/styles.css"] = 8100,
["Comicsproj"] = 28000,
["Comma_separated_entries"] = 426000,
["Comma_separated_values"] = 45000,
["Comment"] = 5200,
["Committed_identity"] = 3000,
["Committed_identity/styles.css"] = 3000,
["Commons"] = 66000,
["Commons-inline"] = 20000,
["Commons_cat"] = 48000,
["Commons_category"] = 844000,
["Commons_category-inline"] = 147000,
["Commons_category_inline"] = 6000,
["Commonscat"] = 65000,
["Commonscat-inline"] = 17000,
["Commonscat_inline"] = 2400,
["Commonscatinline"] = 6600,
["Compact_TOC"] = 7000,
["Compact_ToC"] = 4800,
["Compare"] = 5200,
["Compare_image_with_Wikidata"] = 10000,
["Composition_bar"] = 10000,
["Confirmed"] = 16000,
["Confused"] = 2800,
["Confusing"] = 2400,
["CongBio"] = 9600,
["CongLinks"] = 4600,
["Connected_contributor"] = 18000,
["Connected_contributor_(paid)"] = 6800,
["Constellation_navbox"] = 6800,
["Container"] = 11000,
["Container_cat"] = 7600,
["Container_category"] = 42000,
["Containercat"] = 2600,
["Contains_special_characters"] = 4100,
["Contains_special_characters/core"] = 4100,
["Contains_special_characters/styles.css"] = 4100,
["Content_category"] = 7600,
["Contentious_topics/list"] = 13000,
["Contentious_topics/page_restriction_editnotice_base"] = 2400,
["Contentious_topics/page_restriction_talk_notice_base"] = 3600,
["Contentious_topics/talk_notice"] = 6600,
["Context"] = 2700,
["Continent2continental"] = 16000,
["Continent_adjective_to_noun"] = 2200,
["Controversial"] = 3300,
["Convert"] = 1170000,
["Convinfobox"] = 204000,
["Convinfobox/2"] = 17000,
["Convinfobox/3"] = 119000,
["Convinfobox/pri2"] = 63000,
["Convinfobox/prisec2"] = 3100,
["Convinfobox/prisec3"] = 26000,
["Convinfobox/sec2"] = 9300,
["Coord"] = 1330000,
["Coord_missing"] = 95000,
["Coord_missing/CheckCat"] = 95000,
["Coords"] = 7600,
["Copied"] = 19000,
["Copy_edit"] = 2500,
["Copy_to_Wikimedia_Commons"] = 109000,
["Copyvios"] = 4800,
["Cospar"] = 2500,
["Cot"] = 12000,
["Count"] = 661000,
["Country2continent"] = 36000,
["Country2continental"] = 2400,
["Country2nationality"] = 343000,
["CountryPrefixThe"] = 109000,
["Country_abbreviation"] = 88000,
["Country_alias"] = 16000,
["Country_at_games_navbox"] = 2700,
["Country_at_games_navbox/below"] = 2600,
["Country_data"] = 6900,
["Country_data_AFG"] = 2200,
["Country_data_ALB"] = 6600,
["Country_data_ALG"] = 9400,
["Country_data_AND"] = 3000,
["Country_data_ANG"] = 3900,
["Country_data_ARG"] = 47000,
["Country_data_ARM"] = 7400,
["Country_data_AUS"] = 76000,
["Country_data_AUT"] = 46000,
["Country_data_AZE"] = 9100,
["Country_data_Afghanistan"] = 12000,
["Country_data_Alaska"] = 2100,
["Country_data_Albania"] = 20000,
["Country_data_Alberta"] = 3600,
["Country_data_Algeria"] = 25000,
["Country_data_American_Samoa"] = 2900,
["Country_data_Andorra"] = 7900,
["Country_data_Angola"] = 12000,
["Country_data_Anguilla"] = 2500,
["Country_data_Antigua_and_Barbuda"] = 6100,
["Country_data_Apulia"] = 7900,
["Country_data_Argentina"] = 81000,
["Country_data_Arizona"] = 2300,
["Country_data_Arkansas"] = 2000,
["Country_data_Armenia"] = 22000,
["Country_data_Aruba"] = 3600,
["Country_data_Australia"] = 126000,
["Country_data_Austria"] = 78000,
["Country_data_Azerbaijan"] = 28000,
["Country_data_BAH"] = 4000,
["Country_data_BAN"] = 3900,
["Country_data_BAR"] = 2400,
["Country_data_BEL"] = 51000,
["Country_data_BER"] = 2300,
["Country_data_BHR"] = 4600,
["Country_data_BIH"] = 13000,
["Country_data_BLR"] = 24000,
["Country_data_BOL"] = 5800,
["Country_data_BOT"] = 2300,
["Country_data_BRA"] = 57000,
["Country_data_BUL"] = 26000,
["Country_data_Bahamas"] = 9800,
["Country_data_Bahrain"] = 12000,
["Country_data_Bangladesh"] = 18000,
["Country_data_Barbados"] = 8000,
["Country_data_Belarus"] = 44000,
["Country_data_Belgium"] = 89000,
["Country_data_Belize"] = 5300,
["Country_data_Benin"] = 7400,
["Country_data_Bermuda"] = 5800,
["Country_data_Bhutan"] = 4700,
["Country_data_Bolivia"] = 15000,
["Country_data_Bosnia_and_Herzegovina"] = 29000,
["Country_data_Botswana"] = 9200,
["Country_data_Brazil"] = 102000,
["Country_data_British_Columbia"] = 3400,
["Country_data_British_Raj"] = 2200,
["Country_data_British_Virgin_Islands"] = 3300,
["Country_data_Brunei"] = 6300,
["Country_data_Bulgaria"] = 52000,
["Country_data_Burkina_Faso"] = 10000,
["Country_data_Burma"] = 2700,
["Country_data_Burundi"] = 6100,
["Country_data_CAM"] = 2100,
["Country_data_CAN"] = 58000,
["Country_data_CGO"] = 2400,
["Country_data_CHE"] = 4700,
["Country_data_CHI"] = 18000,
["Country_data_CHL"] = 2100,
["Country_data_CHN"] = 42000,
["Country_data_CIV"] = 8100,
["Country_data_CMR"] = 8700,
["Country_data_COD"] = 3200,
["Country_data_COL"] = 25000,
["Country_data_CPV"] = 2100,
["Country_data_CRC"] = 6700,
["Country_data_CRO"] = 33000,
["Country_data_CUB"] = 10000,
["Country_data_CYP"] = 9100,
["Country_data_CZE"] = 46000,
["Country_data_California"] = 5900,
["Country_data_Cambodia"] = 8800,
["Country_data_Cameroon"] = 18000,
["Country_data_Canada"] = 122000,
["Country_data_Cape_Verde"] = 6400,
["Country_data_Castile_and_León"] = 2000,
["Country_data_Catalonia"] = 3100,
["Country_data_Cayman_Islands"] = 4200,
["Country_data_Central_African_Republic"] = 5100,
["Country_data_Chad"] = 5600,
["Country_data_Chile"] = 40000,
["Country_data_China"] = 83000,
["Country_data_Chinese_Taipei"] = 20000,
["Country_data_Colombia"] = 46000,
["Country_data_Colorado"] = 5700,
["Country_data_Comoros"] = 4400,
["Country_data_Confederate_States_of_America"] = 3100,
["Country_data_Connecticut"] = 3200,
["Country_data_Cook_Islands"] = 3800,
["Country_data_Costa_Rica"] = 18000,
["Country_data_Croatia"] = 57000,
["Country_data_Cuba"] = 23000,
["Country_data_Curaçao"] = 3600,
["Country_data_Cyprus"] = 23000,
["Country_data_Czech_Republic"] = 81000,
["Country_data_Czechoslovakia"] = 19000,
["Country_data_DEN"] = 34000,
["Country_data_DEU"] = 8700,
["Country_data_DNK"] = 3600,
["Country_data_DOM"] = 7300,
["Country_data_Democratic_Republic_of_the_Congo"] = 13000,
["Country_data_Denmark"] = 69000,
["Country_data_Djibouti"] = 4600,
["Country_data_Dominica"] = 4300,
["Country_data_Dominican_Republic"] = 17000,
["Country_data_ECU"] = 12000,
["Country_data_EGY"] = 13000,
["Country_data_ENG"] = 47000,
["Country_data_ESA"] = 2300,
["Country_data_ESP"] = 73000,
["Country_data_EST"] = 14000,
["Country_data_ETH"] = 3600,
["Country_data_EU"] = 3700,
["Country_data_East_Germany"] = 14000,
["Country_data_East_Timor"] = 5000,
["Country_data_Ecuador"] = 25000,
["Country_data_Egypt"] = 32000,
["Country_data_El_Salvador"] = 13000,
["Country_data_Empire_of_Japan"] = 4000,
["Country_data_England"] = 97000,
["Country_data_Equatorial_Guinea"] = 5200,
["Country_data_Eritrea"] = 5400,
["Country_data_Estonia"] = 34000,
["Country_data_Eswatini"] = 5100,
["Country_data_Ethiopia"] = 13000,
["Country_data_Europe"] = 2400,
["Country_data_European_Union"] = 7400,
["Country_data_FIJ"] = 3800,
["Country_data_FIN"] = 34000,
["Country_data_FRA"] = 98000,
["Country_data_FRG"] = 15000,
["Country_data_FRO"] = 2000,
["Country_data_FR_Yugoslavia"] = 4000,
["Country_data_Faroe_Islands"] = 5400,
["Country_data_Federated_States_of_Micronesia"] = 3100,
["Country_data_Fiji"] = 12000,
["Country_data_Finland"] = 68000,
["Country_data_Florida"] = 6500,
["Country_data_France"] = 193000,
["Country_data_French_Guiana"] = 2100,
["Country_data_French_Polynesia"] = 3800,
["Country_data_GAB"] = 2400,
["Country_data_GAM"] = 2100,
["Country_data_GBR"] = 55000,
["Country_data_GDR"] = 8400,
["Country_data_GEO"] = 14000,
["Country_data_GER"] = 82000,
["Country_data_GHA"] = 9800,
["Country_data_GRE"] = 25000,
["Country_data_GUA"] = 5000,
["Country_data_GUI"] = 3200,
["Country_data_GUY"] = 2300,
["Country_data_Gabon"] = 7600,
["Country_data_Gambia"] = 6800,
["Country_data_Georgia"] = 10000,
["Country_data_Georgia_(U.S._state)"] = 2800,
["Country_data_Georgia_(country)"] = 29000,
["Country_data_German_Empire"] = 5400,
["Country_data_Germany"] = 151000,
["Country_data_Ghana"] = 24000,
["Country_data_Gibraltar"] = 5000,
["Country_data_Great_Britain"] = 74000,
["Country_data_Greece"] = 57000,
["Country_data_Greenland"] = 2900,
["Country_data_Grenada"] = 5200,
["Country_data_Guadeloupe"] = 2800,
["Country_data_Guam"] = 4700,
["Country_data_Guatemala"] = 13000,
["Country_data_Guernsey"] = 2200,
["Country_data_Guinea"] = 8400,
["Country_data_Guinea-Bissau"] = 5100,
["Country_data_Guyana"] = 7400,
["Country_data_HAI"] = 3100,
["Country_data_HKG"] = 13000,
["Country_data_HON"] = 4300,
["Country_data_HUN"] = 37000,
["Country_data_Haiti"] = 8700,
["Country_data_Honduras"] = 12000,
["Country_data_Hong_Kong"] = 26000,
["Country_data_Hungary"] = 70000,
["Country_data_IDN"] = 5000,
["Country_data_INA"] = 10000,
["Country_data_IND"] = 30000,
["Country_data_IRE"] = 10000,
["Country_data_IRI"] = 5500,
["Country_data_IRL"] = 21000,
["Country_data_IRN"] = 6300,
["Country_data_IRQ"] = 4200,
["Country_data_ISL"] = 8600,
["Country_data_ISR"] = 21000,
["Country_data_ITA"] = 86000,
["Country_data_Iceland"] = 23000,
["Country_data_Idaho"] = 2000,
["Country_data_Illinois"] = 4400,
["Country_data_India"] = 109000,
["Country_data_Indiana"] = 2700,
["Country_data_Indonesia"] = 37000,
["Country_data_Iowa"] = 2900,
["Country_data_Iran"] = 92000,
["Country_data_Iraq"] = 14000,
["Country_data_Ireland"] = 34000,
["Country_data_Isle_of_Man"] = 2900,
["Country_data_Israel"] = 46000,
["Country_data_Italy"] = 145000,
["Country_data_Ivory_Coast"] = 18000,
["Country_data_JAM"] = 9800,
["Country_data_JOR"] = 4000,
["Country_data_JP"] = 8100,
["Country_data_JPN"] = 59000,
["Country_data_Jamaica"] = 21000,
["Country_data_Japan"] = 119000,
["Country_data_Jersey"] = 2600,
["Country_data_Jordan"] = 12000,
["Country_data_KAZ"] = 20000,
["Country_data_KEN"] = 7400,
["Country_data_KGZ"] = 3800,
["Country_data_KOR"] = 31000,
["Country_data_KOS"] = 2400,
["Country_data_KSA"] = 6000,
["Country_data_KUW"] = 4100,
["Country_data_Kazakhstan"] = 34000,
["Country_data_Kenya"] = 20000,
["Country_data_Kingdom_of_France"] = 2100,
["Country_data_Kingdom_of_Great_Britain"] = 4800,
["Country_data_Kingdom_of_Italy"] = 4200,
["Country_data_Kiribati"] = 3000,
["Country_data_Kosovo"] = 8800,
["Country_data_Kuwait"] = 11000,
["Country_data_Kyrgyzstan"] = 9300,
["Country_data_LAT"] = 15000,
["Country_data_LBN"] = 2400,
["Country_data_LIB"] = 2600,
["Country_data_LIE"] = 3100,
["Country_data_LIT"] = 3100,
["Country_data_LTU"] = 12000,
["Country_data_LUX"] = 10000,
["Country_data_LVA"] = 2600,
["Country_data_Laos"] = 7500,
["Country_data_Latvia"] = 32000,
["Country_data_Lebanon"] = 15000,
["Country_data_Lesotho"] = 5200,
["Country_data_Liberia"] = 7300,
["Country_data_Libya"] = 8700,
["Country_data_Liechtenstein"] = 7800,
["Country_data_Lithuania"] = 31000,
["Country_data_Luxembourg"] = 24000,
["Country_data_MAC"] = 2400,
["Country_data_MAD"] = 2000,
["Country_data_MAR"] = 12000,
["Country_data_MAS"] = 11000,
["Country_data_MDA"] = 7700,
["Country_data_MEX"] = 30000,
["Country_data_MGL"] = 2900,
["Country_data_MKD"] = 7600,
["Country_data_MLI"] = 4400,
["Country_data_MLT"] = 5600,
["Country_data_MNE"] = 7900,
["Country_data_MON"] = 3700,
["Country_data_MOZ"] = 2200,
["Country_data_MRI"] = 2100,
["Country_data_MYA"] = 3000,
["Country_data_MYS"] = 3700,
["Country_data_Macau"] = 6400,
["Country_data_Macedonia"] = 4900,
["Country_data_Madagascar"] = 9100,
["Country_data_Malawi"] = 5700,
["Country_data_Malaysia"] = 36000,
["Country_data_Maldives"] = 6100,
["Country_data_Mali"] = 12000,
["Country_data_Malta"] = 17000,
["Country_data_Manitoba"] = 2500,
["Country_data_Marshall_Islands"] = 3700,
["Country_data_Martinique"] = 2800,
["Country_data_Maryland"] = 3100,
["Country_data_Massachusetts"] = 3000,
["Country_data_Mauritania"] = 5900,
["Country_data_Mauritius"] = 8000,
["Country_data_Mexico"] = 67000,
["Country_data_Michigan"] = 4300,
["Country_data_Minnesota"] = 3700,
["Country_data_Missouri"] = 2000,
["Country_data_Moldova"] = 19000,
["Country_data_Monaco"] = 10000,
["Country_data_Mongolia"] = 9800,
["Country_data_Montana"] = 2100,
["Country_data_Montenegro"] = 18000,
["Country_data_Montserrat"] = 2500,
["Country_data_Morocco"] = 27000,
["Country_data_Mozambique"] = 7300,
["Country_data_Myanmar"] = 14000,
["Country_data_NAM"] = 3400,
["Country_data_NED"] = 60000,
["Country_data_NEP"] = 2900,
["Country_data_NGA"] = 8200,
["Country_data_NGR"] = 8100,
["Country_data_NIR"] = 10000,
["Country_data_NLD"] = 6100,
["Country_data_NOR"] = 30000,
["Country_data_NZ"] = 3200,
["Country_data_NZL"] = 32000,
["Country_data_Namibia"] = 9900,
["Country_data_Nauru"] = 2500,
["Country_data_Nazi_Germany"] = 9700,
["Country_data_Nepal"] = 17000,
["Country_data_Netherlands"] = 114000,
["Country_data_Netherlands_Antilles"] = 2300,
["Country_data_New_Brunswick"] = 2500,
["Country_data_New_Caledonia"] = 3400,
["Country_data_New_Jersey"] = 4200,
["Country_data_New_South_Wales"] = 5800,
["Country_data_New_York"] = 4800,
["Country_data_New_York_(state)"] = 6800,
["Country_data_New_Zealand"] = 67000,
["Country_data_Newfoundland_and_Labrador"] = 2300,
["Country_data_Nicaragua"] = 8300,
["Country_data_Niger"] = 6000,
["Country_data_Nigeria"] = 33000,
["Country_data_North_Carolina"] = 3500,
["Country_data_North_Korea"] = 13000,
["Country_data_North_Macedonia"] = 18000,
["Country_data_Northern_Ireland"] = 15000,
["Country_data_Northern_Mariana_Islands"] = 2900,
["Country_data_Norway"] = 73000,
["Country_data_Nova_Scotia"] = 2300,
["Country_data_OMA"] = 2700,
["Country_data_Ohio"] = 4800,
["Country_data_Oman"] = 8700,
["Country_data_Ontario"] = 3800,
["Country_data_Ottoman_Empire"] = 2500,
["Country_data_PAK"] = 7900,
["Country_data_PAN"] = 5800,
["Country_data_PAR"] = 10000,
["Country_data_PER"] = 12000,
["Country_data_PHI"] = 12000,
["Country_data_PHL"] = 2500,
["Country_data_PNG"] = 2700,
["Country_data_POL"] = 50000,
["Country_data_POR"] = 31000,
["Country_data_PRC"] = 2100,
["Country_data_PRK"] = 4600,
["Country_data_PRT"] = 2900,
["Country_data_PUR"] = 7300,
["Country_data_Pakistan"] = 29000,
["Country_data_Palau"] = 3000,
["Country_data_Palestine"] = 6800,
["Country_data_Panama"] = 16000,
["Country_data_Papua_New_Guinea"] = 8000,
["Country_data_Paraguay"] = 21000,
["Country_data_Pennsylvania"] = 3700,
["Country_data_People's_Republic_of_China"] = 3300,
["Country_data_Peru"] = 30000,
["Country_data_Philippines"] = 35000,
["Country_data_Poland"] = 150000,
["Country_data_Portugal"] = 68000,
["Country_data_Prussia"] = 2600,
["Country_data_Puerto_Rico"] = 17000,
["Country_data_QAT"] = 7900,
["Country_data_Qatar"] = 17000,
["Country_data_Quebec"] = 4200,
["Country_data_ROM"] = 13000,
["Country_data_ROU"] = 26000,
["Country_data_RSA"] = 31000,
["Country_data_RUS"] = 63000,
["Country_data_Republic_of_China"] = 5700,
["Country_data_Republic_of_Ireland"] = 26000,
["Country_data_Republic_of_the_Congo"] = 7700,
["Country_data_Romania"] = 68000,
["Country_data_Russia"] = 115000,
["Country_data_Russian_Empire"] = 4900,
["Country_data_Rwanda"] = 7600,
["Country_data_SAM"] = 3100,
["Country_data_SCG"] = 3100,
["Country_data_SCO"] = 26000,
["Country_data_SEN"] = 8000,
["Country_data_SER"] = 3600,
["Country_data_SGP"] = 2800,
["Country_data_SIN"] = 7000,
["Country_data_SLO"] = 19000,
["Country_data_SLV"] = 3000,
["Country_data_SMR"] = 3100,
["Country_data_SPA"] = 4800,
["Country_data_SRB"] = 26000,
["Country_data_SRI"] = 4700,
["Country_data_SUI"] = 42000,
["Country_data_SUR"] = 2000,
["Country_data_SVK"] = 29000,
["Country_data_SVN"] = 6700,
["Country_data_SWE"] = 57000,
["Country_data_SWI"] = 4700,
["Country_data_SYR"] = 3600,
["Country_data_Saint_Kitts_and_Nevis"] = 4800,
["Country_data_Saint_Lucia"] = 4900,
["Country_data_Saint_Vincent_and_the_Grenadines"] = 4800,
["Country_data_Samoa"] = 7700,
["Country_data_San_Marino"] = 8500,
["Country_data_Saskatchewan"] = 2900,
["Country_data_Saudi_Arabia"] = 19000,
["Country_data_Scotland"] = 52000,
["Country_data_Senegal"] = 17000,
["Country_data_Serbia"] = 54000,
["Country_data_Serbia_and_Montenegro"] = 5100,
["Country_data_Seychelles"] = 5500,
["Country_data_Sierra_Leone"] = 7400,
["Country_data_Singapore"] = 27000,
["Country_data_Slovakia"] = 51000,
["Country_data_Slovenia"] = 43000,
["Country_data_Solomon_Islands"] = 4700,
["Country_data_Somalia"] = 6200,
["Country_data_South_Africa"] = 70000,
["Country_data_South_Carolina"] = 3300,
["Country_data_South_Korea"] = 66000,
["Country_data_South_Sudan"] = 4100,
["Country_data_Soviet_Union"] = 36000,
["Country_data_Spain"] = 133000,
["Country_data_Sri_Lanka"] = 19000,
["Country_data_Sudan"] = 8100,
["Country_data_Suriname"] = 6500,
["Country_data_Sweden"] = 101000,
["Country_data_Switzerland"] = 83000,
["Country_data_Syria"] = 15000,
["Country_data_São_Tomé_and_Príncipe"] = 3400,
["Country_data_TAN"] = 2500,
["Country_data_TCH"] = 11000,
["Country_data_THA"] = 21000,
["Country_data_TJK"] = 2600,
["Country_data_TKM"] = 2800,
["Country_data_TPE"] = 15000,
["Country_data_TRI"] = 4800,
["Country_data_TUN"] = 11000,
["Country_data_TUR"] = 28000,
["Country_data_Taiwan"] = 13000,
["Country_data_Tajikistan"] = 9000,
["Country_data_Tanzania"] = 12000,
["Country_data_Texas"] = 5300,
["Country_data_Thailand"] = 44000,
["Country_data_Togo"] = 7000,
["Country_data_Tonga"] = 6400,
["Country_data_Trinidad_and_Tobago"] = 14000,
["Country_data_Tunisia"] = 22000,
["Country_data_Turkey"] = 74000,
["Country_data_Turkmenistan"] = 7900,
["Country_data_Turks_and_Caicos_Islands"] = 2600,
["Country_data_Tuvalu"] = 2800,
["Country_data_U.S."] = 2100,
["Country_data_U.S._Virgin_Islands"] = 4800,
["Country_data_UAE"] = 9300,
["Country_data_UGA"] = 4100,
["Country_data_UK"] = 19000,
["Country_data_UKGBI"] = 3100,
["Country_data_UKR"] = 37000,
["Country_data_URS"] = 14000,
["Country_data_URU"] = 15000,
["Country_data_US"] = 4900,
["Country_data_USA"] = 133000,
["Country_data_USSR"] = 4500,
["Country_data_UZB"] = 12000,
["Country_data_Uganda"] = 13000,
["Country_data_Ukraine"] = 73000,
["Country_data_United_Arab_Emirates"] = 20000,
["Country_data_United_Kingdom"] = 89000,
["Country_data_United_Kingdom_of_Great_Britain_and_Ireland"] = 4400,
["Country_data_United_Nations"] = 4000,
["Country_data_United_States"] = 282000,
["Country_data_United_States_of_America"] = 5000,
["Country_data_Uruguay"] = 29000,
["Country_data_Uzbekistan"] = 21000,
["Country_data_VEN"] = 17000,
["Country_data_VIE"] = 6400,
["Country_data_Vanuatu"] = 5100,
["Country_data_Vatican_City"] = 2300,
["Country_data_Venezuela"] = 33000,
["Country_data_Vietnam"] = 23000,
["Country_data_Virginia"] = 2900,
["Country_data_WAL"] = 17000,
["Country_data_Wales"] = 34000,
["Country_data_Washington"] = 3400,
["Country_data_Washington,_D.C."] = 2200,
["Country_data_Washington_(state)"] = 3700,
["Country_data_West_Germany"] = 24000,
["Country_data_West_Indies"] = 2600,
["Country_data_Wisconsin"] = 5200,
["Country_data_YUG"] = 9700,
["Country_data_Yemen"] = 7800,
["Country_data_Yugoslavia"] = 18000,
["Country_data_ZAF"] = 4700,
["Country_data_ZAM"] = 3300,
["Country_data_ZIM"] = 8300,
["Country_data_Zambia"] = 9600,
["Country_data_Zimbabwe"] = 18000,
["Country_flagbio"] = 27000,
["Country_name"] = 23000,
["Country_showdata"] = 6100,
["Country_topics"] = 22000,
["County"] = 7700,
["County_(judet)_of_Romania"] = 3300,
["Course_assignment"] = 4200,
["Course_details"] = 6300,
["Course_instructor"] = 2400,
["Cquote"] = 37000,
["Cr"] = 4300,
["Cr-rt"] = 2100,
["Create_taxonomy/link"] = 107000,
["Cref2"] = 2300,
["Cricinfo"] = 24000,
["Cricketarchive"] = 3000,
["Crime_opentask"] = 49000,
["Croatian_Census_2011"] = 2100,
["Cross"] = 3200,
["Crossreference"] = 2600,
["Crossreference/styles.css"] = 2600,
["Csv"] = 3000,
["Ct"] = 12000,
["Curlie"] = 6700,
["Currency"] = 3600,
["Current_events"] = 8200,
["Current_events/styles.css"] = 8200,
["Currentdate"] = 22000,
["Cvt"] = 103000,
["Cycling_Archives"] = 4300,
["Cycling_archives"] = 2500,
["Cycling_data_LTS"] = 2100,
["Cycling_data_TJV"] = 2000,
["Cycling_team_link"] = 12000,
["Module:CFB_schedule"] = 26000,
["Module:CallAssert"] = 244000,
["Module:CanElecResTopTest"] = 5800,
["Module:CanadaByProvinceCatNav"] = 9800,
["Module:Cat_main"] = 199000,
["Module:Catalog_lookup_link"] = 515000,
["Module:Category_described_in_year"] = 5700,
["Module:Category_described_in_year/conf"] = 5700,
["Module:Category_handler"] = 4430000,
["Module:Category_handler/blacklist"] = 4430000,
["Module:Category_handler/config"] = 4430000,
["Module:Category_handler/data"] = 4430000,
["Module:Category_handler/shared"] = 4430000,
["Module:Category_more_if_exists"] = 41000,
["Module:Category_pair"] = 6100,
["Module:Category_see_also"] = 39000,
["Module:Celestial_object_quadrangle"] = 2300,
["Module:Check_DYK_hook"] = 114000,
["Module:Check_for_clobbered_parameters"] = 1210000,
["Module:Check_for_deprecated_parameters"] = 59000,
["Module:Check_for_unknown_parameters"] = 18500000,
["Module:Check_isxn"] = 481000,
["Module:Check_winner_by_scores"] = 13000,
["Module:Checkuser"] = 76000,
["Module:Chem2"] = 4800,
["Module:Chem2/styles.css"] = 4800,
["Module:Citation/CS1"] = 5580000,
["Module:Citation/CS1/COinS"] = 5580000,
["Module:Citation/CS1/Configuration"] = 5580000,
["Module:Citation/CS1/Date_validation"] = 5580000,
["Module:Citation/CS1/Identifiers"] = 5580000,
["Module:Citation/CS1/Suggestions"] = 24000,
["Module:Citation/CS1/Utilities"] = 5580000,
["Module:Citation/CS1/Whitelist"] = 5580000,
["Module:Citation/CS1/styles.css"] = 5720000,
["Module:Cite_IUCN"] = 58000,
["Module:Cite_Q"] = 44000,
["Module:Cite_tweet"] = 36000,
["Module:Cite_web"] = 40000,
["Module:Clade"] = 7600,
["Module:Class"] = 10200000,
["Module:Class/definition.json"] = 10200000,
["Module:Class/styles.css"] = 9380000,
["Module:Class_mask"] = 10500000,
["Module:Clickable_button_2"] = 957000,
["Module:Collapsible_list"] = 55000,
["Module:College_color"] = 127000,
["Module:College_color/data"] = 127000,
["Module:Color_contrast"] = 499000,
["Module:Color_contrast/colors"] = 501000,
["Module:Commons_link"] = 257000,
["Module:Complex_date"] = 66000,
["Module:Convert"] = 1230000,
["Module:Convert/data"] = 1230000,
["Module:Convert/helper"] = 8600,
["Module:Convert/text"] = 1230000,
["Module:Convert/wikidata"] = 3300,
["Module:Convert/wikidata/data"] = 3300,
["Module:ConvertNumeric"] = 21000,
["Module:Convert_character_width"] = 2800,
["Module:Convert_character_width/data"] = 2800,
["Module:Coordinates"] = 1330000,
["Module:Coordinates/styles.css"] = 1330000,
["Module:Copied"] = 19000,
["Module:Count_banners"] = 47000,
["Module:CountryAdjectiveDemonym"] = 45000,
["Module:CountryAdjectiveDemonym/Adjectives"] = 45000,
["Module:CountryAdjectiveDemonym/Demonyms"] = 45000,
["Module:CountryAdjectiveDemonym/The"] = 45000,
["Module:CountryData"] = 143000,
["Module:CountryData/cacheA"] = 12000,
["Module:CountryData/cacheB"] = 8300,
["Module:CountryData/cacheC"] = 12000,
["Module:CountryData/cacheD"] = 4500,
["Module:CountryData/cacheE"] = 2800,
["Module:CountryData/cacheF"] = 2600,
["Module:CountryData/cacheG"] = 2700,
["Module:CountryData/summary"] = 143000,
["Module:Country_adjective"] = 4300,
["Module:Country_alias"] = 52000,
["Module:Country_alias/data"] = 52000,
["Module:Currency"] = 3600,
["Module:Currency/Presentation"] = 3600,
}
b5974d0194e019096fb2348ee080590d1895d8ea
Module:Transclusion count/data/I
828
190
397
2023-08-06T05:11:20Z
wikipedia>Ahechtbot
0
[[Wikipedia:BOT|Bot]]: Updated page.
Scribunto
text/plain
return {
["IAAF_name"] = 2200,
["IAST"] = 6100,
["IBDB_name"] = 9100,
["ICD10"] = 4700,
["ICD9"] = 4400,
["ICS"] = 2900,
["IDN"] = 3400,
["IMDb_episode"] = 9900,
["IMDb_episodes"] = 2600,
["IMDb_name"] = 153000,
["IMDb_title"] = 188000,
["IMO_Number"] = 4100,
["IMSLP"] = 8200,
["INA"] = 2100,
["IND"] = 7500,
["INR"] = 6500,
["INRConvert"] = 5600,
["INRConvert/CurrentRate"] = 5500,
["INRConvert/USD"] = 5500,
["INRConvert/out"] = 5500,
["IOC_profile"] = 5300,
["IP"] = 2600,
["IPA"] = 142000,
["IPA-all"] = 3600,
["IPA-de"] = 8100,
["IPA-es"] = 8100,
["IPA-fr"] = 44000,
["IPA-it"] = 5900,
["IPA-nl"] = 3700,
["IPA-pl"] = 4100,
["IPA-pt"] = 3700,
["IPA-ru"] = 2700,
["IPA-sh"] = 2700,
["IPA-sl"] = 6900,
["IPA-th"] = 3000,
["IPA_audio_link"] = 19000,
["IPA_link"] = 3400,
["IPAc-cmn"] = 2600,
["IPAc-en"] = 48000,
["IPAc-pl"] = 52000,
["IPC_athlete"] = 2800,
["IPSummary"] = 78000,
["IP_summary"] = 78000,
["IPtalk"] = 21000,
["IPuser"] = 7000,
["IPvandal"] = 2900,
["IRC"] = 7300,
["IRI"] = 2200,
["IRL"] = 5500,
["IRN"] = 3600,
["ISBN"] = 461000,
["ISBNT"] = 39000,
["ISBN_missing"] = 2500,
["ISFDB_name"] = 4100,
["ISFDB_title"] = 4600,
["ISL"] = 2100,
["ISO_15924/script-example-character"] = 2800,
["ISO_15924/wp-article"] = 2800,
["ISO_15924/wp-article/format"] = 2800,
["ISO_15924/wp-article/label"] = 2700,
["ISO_3166_code"] = 514000,
["ISO_3166_name"] = 16000,
["ISO_639_name"] = 8000,
["ISP"] = 5300,
["ISR"] = 4800,
["ISSN"] = 12000,
["ISSN_link"] = 30000,
["ISTAT"] = 8100,
["ISU_figure_skater"] = 2500,
["ITA"] = 17000,
["ITF"] = 6200,
["ITF_profile"] = 9000,
["ITIS"] = 4400,
["ITN_talk"] = 10000,
["ITN_talk/date"] = 10000,
["IUCN_banner"] = 15000,
["I_sup"] = 4500,
["Iaaf_name"] = 7400,
["Ice_hockey"] = 19000,
["Ice_hockey_stats"] = 16000,
["Icehockeystats"] = 12000,
["Icon"] = 576000,
["If"] = 269000,
["If_all"] = 6400,
["If_between"] = 3700,
["If_both"] = 798000,
["If_empty"] = 3630000,
["If_first_display_both"] = 73000,
["If_in_page"] = 9400,
["If_last_display_both"] = 30000,
["If_preview"] = 57000,
["If_then_show"] = 283000,
["Ifempty"] = 4000,
["Ifeq"] = 16000,
["Iferror_then_show"] = 3200,
["Ifexist_not_redirect"] = 1120000,
["Ifnotempty"] = 14000,
["Ifnumber"] = 35000,
["Ifsubst"] = 437000,
["Ih"] = 7500,
["Ill"] = 112000,
["Illm"] = 6700,
["Image_frame"] = 4900,
["Image_label"] = 4500,
["Image_label_begin"] = 3900,
["Image_label_end"] = 3500,
["Image_label_small"] = 2600,
["Image_needed"] = 4500,
["Image_other"] = 274000,
["Image_requested"] = 167000,
["Image_requested/Category_helper"] = 158000,
["Imbox"] = 914000,
["Imdb_name"] = 5400,
["Imdb_title"] = 4200,
["Import_style"] = 11000,
["Import_style/inputbox.css"] = 11000,
["Importance"] = 5610000,
["Importance/colour"] = 5620000,
["Importance_mask"] = 10200000,
["Improve_categories"] = 7400,
["Improve_documentation"] = 2300,
["In_class"] = 5800,
["In_lang"] = 353000,
["In_progress"] = 3200,
["In_string"] = 74000,
["In_title"] = 19000,
["Inactive_WikiProject_banner"] = 205000,
["Inactive_userpage_blanked"] = 4900,
["Include-USGov"] = 29000,
["Incomplete_list"] = 23000,
["Inconclusive"] = 2100,
["Increase"] = 43000,
["Incumbent_pope"] = 4300,
["Indent"] = 4300,
["IndexFungorum"] = 2200,
["Indian_English"] = 4300,
["Indian_Rupee"] = 10000,
["Indian_railway_code"] = 3200,
["Inflation"] = 19000,
["Inflation-fn"] = 5400,
["Inflation-year"] = 4400,
["Inflation/IN/startyear"] = 5500,
["Inflation/UK"] = 4300,
["Inflation/UK/dataset"] = 4300,
["Inflation/UK/startyear"] = 4300,
["Inflation/US"] = 12000,
["Inflation/US/dataset"] = 12000,
["Inflation/US/startyear"] = 12000,
["Inflation/fn"] = 6200,
["Inflation/year"] = 24000,
["Info"] = 7200,
["Infobox"] = 3210000,
["Infobox/Columns"] = 2400,
["Infobox/mobileviewfix.css"] = 143000,
["Infobox3cols"] = 17000,
["Infobox_AFL_biography"] = 14000,
["Infobox_Aircraft_Begin"] = 5400,
["Infobox_Aircraft_Type"] = 4700,
["Infobox_Athletics_Championships"] = 2700,
["Infobox_Australian_place"] = 15000,
["Infobox_CFL_biography"] = 2200,
["Infobox_COA_wide"] = 3100,
["Infobox_Canada_electoral_district"] = 2400,
["Infobox_Canadian_Football_League_biography"] = 5700,
["Infobox_Canadian_Football_League_biography/position"] = 5700,
["Infobox_Chinese"] = 20000,
["Infobox_Chinese/Chinese"] = 2700,
["Infobox_Chinese/Footer"] = 8700,
["Infobox_Chinese/Header"] = 8700,
["Infobox_Chinese/Korean"] = 17000,
["Infobox_Christian_leader"] = 18000,
["Infobox_Election"] = 2200,
["Infobox_French_commune"] = 38000,
["Infobox_GAA_player"] = 2800,
["Infobox_Gaelic_games_player"] = 5000,
["Infobox_German_location"] = 13000,
["Infobox_German_place"] = 14000,
["Infobox_Grand_Prix_race_report"] = 2000,
["Infobox_Greece_place"] = 2800,
["Infobox_Greek_Dimos"] = 2800,
["Infobox_Hindu_temple"] = 2400,
["Infobox_Indian_constituency"] = 4600,
["Infobox_Indian_constituency/defaultdata"] = 4600,
["Infobox_Italian_comune"] = 8100,
["Infobox_Korean_name"] = 15000,
["Infobox_Korean_name/categories"] = 15000,
["Infobox_MLB_yearly"] = 3100,
["Infobox_NASCAR_race_report"] = 2200,
["Infobox_NCAA_team_season"] = 18000,
["Infobox_NFL_biography"] = 28000,
["Infobox_NFL_player"] = 7900,
["Infobox_NFL_season"] = 2500,
["Infobox_NFL_team_season"] = 3900,
["Infobox_NRHP"] = 72000,
["Infobox_NRHP/conv"] = 18000,
["Infobox_NRHP/locmapin2region"] = 66000,
["Infobox_Officeholder"] = 4900,
["Infobox_Olympic_event"] = 7300,
["Infobox_Olympic_event/games_text"] = 7300,
["Infobox_Paralympic_event"] = 2600,
["Infobox_Paralympic_event/games_text"] = 2600,
["Infobox_Politician"] = 2200,
["Infobox_Romanian_subdivision"] = 3200,
["Infobox_Russian_district"] = 2000,
["Infobox_Russian_inhabited_locality"] = 4400,
["Infobox_SCOTUS_case"] = 3700,
["Infobox_Site_of_Special_Scientific_Interest"] = 2000,
["Infobox_Swiss_town"] = 2800,
["Infobox_Switzerland_municipality"] = 2900,
["Infobox_Turkey_place"] = 16000,
["Infobox_U.S._county"] = 3000,
["Infobox_U.S._county/district"] = 3000,
["Infobox_UK_constituency"] = 2100,
["Infobox_UK_constituency/year"] = 2100,
["Infobox_UK_legislation"] = 3200,
["Infobox_UK_place"] = 26000,
["Infobox_UK_place/NoDialCode"] = 7900,
["Infobox_UK_place/NoPostCode"] = 3100,
["Infobox_UK_place/area"] = 2400,
["Infobox_UK_place/dist"] = 2500,
["Infobox_UK_place/local"] = 26000,
["Infobox_UK_place/styles.css"] = 26000,
["Infobox_UN_resolution"] = 2300,
["Infobox_US_Supreme_Court_case"] = 3800,
["Infobox_US_Supreme_Court_case/courts"] = 3800,
["Infobox_Wikipedia_user"] = 9700,
["Infobox_YouTube_personality"] = 2600,
["Infobox_YouTube_personality/styles.css"] = 2600,
["Infobox_academic"] = 13000,
["Infobox_aircraft_begin"] = 14000,
["Infobox_aircraft_occurrence"] = 2300,
["Infobox_aircraft_type"] = 12000,
["Infobox_airline"] = 4600,
["Infobox_airport"] = 15000,
["Infobox_airport/datatable"] = 15000,
["Infobox_album"] = 161000,
["Infobox_album/color"] = 190000,
["Infobox_album/link"] = 161000,
["Infobox_anatomy"] = 4500,
["Infobox_ancient_site"] = 5300,
["Infobox_animanga/Footer"] = 6700,
["Infobox_animanga/Header"] = 6800,
["Infobox_animanga/Print"] = 5400,
["Infobox_animanga/Video"] = 4700,
["Infobox_architect"] = 3700,
["Infobox_artist"] = 28000,
["Infobox_artist_discography"] = 5900,
["Infobox_artwork"] = 11000,
["Infobox_athlete"] = 2900,
["Infobox_automobile"] = 8400,
["Infobox_award"] = 13000,
["Infobox_badminton_player"] = 3200,
["Infobox_baseball_biography"] = 28000,
["Infobox_baseball_biography/style"] = 28000,
["Infobox_baseball_biography/styles.css"] = 28000,
["Infobox_basketball_biography"] = 21000,
["Infobox_basketball_biography/style"] = 21000,
["Infobox_basketball_club"] = 3000,
["Infobox_beauty_pageant"] = 2400,
["Infobox_bilateral_relations"] = 4400,
["Infobox_body_of_water"] = 18000,
["Infobox_book"] = 52000,
["Infobox_boxer"] = 5700,
["Infobox_bridge"] = 6000,
["Infobox_building"] = 27000,
["Infobox_character"] = 7600,
["Infobox_chess_biography"] = 3800,
["Infobox_chess_player"] = 3100,
["Infobox_church"] = 15000,
["Infobox_church/denomination"] = 15000,
["Infobox_church/font_color"] = 15000,
["Infobox_civil_conflict"] = 2400,
["Infobox_civilian_attack"] = 5400,
["Infobox_college_coach"] = 11000,
["Infobox_college_football_game"] = 2100,
["Infobox_college_sports_team_season"] = 39000,
["Infobox_college_sports_team_season/link"] = 39000,
["Infobox_college_sports_team_season/name"] = 39000,
["Infobox_college_sports_team_season/succession"] = 39000,
["Infobox_college_sports_team_season/team"] = 39000,
["Infobox_comic_book_title"] = 2900,
["Infobox_comics_character"] = 3600,
["Infobox_comics_creator"] = 3500,
["Infobox_comics_creator/styles.css"] = 3500,
["Infobox_company"] = 83000,
["Infobox_computing_device"] = 2300,
["Infobox_concert"] = 3300,
["Infobox_constituency"] = 5200,
["Infobox_country"] = 6300,
["Infobox_country/formernext"] = 6000,
["Infobox_country/imagetable"] = 5200,
["Infobox_country/multirow"] = 8200,
["Infobox_country/status_text"] = 2700,
["Infobox_country/styles.css"] = 6400,
["Infobox_country_at_games"] = 15000,
["Infobox_country_at_games/core"] = 15000,
["Infobox_country_at_games/see_also"] = 12000,
["Infobox_court_case"] = 4600,
["Infobox_court_case/images"] = 2400,
["Infobox_cricket_tournament"] = 2300,
["Infobox_cricketer"] = 32000,
["Infobox_cricketer/career"] = 32000,
["Infobox_cricketer/national_side"] = 7500,
["Infobox_criminal"] = 6300,
["Infobox_curler"] = 2600,
["Infobox_cycling_race_report"] = 4500,
["Infobox_cyclist"] = 16000,
["Infobox_dam"] = 5600,
["Infobox_designation_list"] = 19000,
["Infobox_designation_list/entry"] = 17000,
["Infobox_dim"] = 6900,
["Infobox_dim/core"] = 6900,
["Infobox_diocese"] = 3800,
["Infobox_drug"] = 9600,
["Infobox_drug/chemical_formula"] = 9600,
["Infobox_drug/data_page_link"] = 9600,
["Infobox_drug/formatATC"] = 9500,
["Infobox_drug/formatCASnumber"] = 9600,
["Infobox_drug/formatChEBI"] = 9600,
["Infobox_drug/formatChEMBL"] = 9600,
["Infobox_drug/formatChemDBNIAID"] = 9600,
["Infobox_drug/formatChemSpider"] = 9600,
["Infobox_drug/formatCompTox"] = 9600,
["Infobox_drug/formatDrugBank"] = 9600,
["Infobox_drug/formatIUPHARBPS"] = 9600,
["Infobox_drug/formatJmol"] = 9600,
["Infobox_drug/formatKEGG"] = 9600,
["Infobox_drug/formatPDBligand"] = 8900,
["Infobox_drug/formatPubChemCID"] = 9600,
["Infobox_drug/formatPubChemSID"] = 9600,
["Infobox_drug/formatUNII"] = 9600,
["Infobox_drug/legal_status"] = 9700,
["Infobox_drug/licence"] = 9600,
["Infobox_drug/maintenance_categories"] = 9600,
["Infobox_drug/non-ref-space"] = 4000,
["Infobox_drug/pregnancy_category"] = 9600,
["Infobox_drug/title"] = 9600,
["Infobox_election"] = 29000,
["Infobox_election/row"] = 29000,
["Infobox_election/shortname"] = 28000,
["Infobox_enzyme"] = 5100,
["Infobox_ethnic_group"] = 7200,
["Infobox_event"] = 5400,
["Infobox_family"] = 2100,
["Infobox_figure_skater"] = 4200,
["Infobox_film"] = 155000,
["Infobox_film/short_description"] = 151000,
["Infobox_film_awards"] = 2600,
["Infobox_film_awards/link"] = 2600,
["Infobox_film_awards/style"] = 2600,
["Infobox_food"] = 6800,
["Infobox_football_biography"] = 205000,
["Infobox_football_club"] = 27000,
["Infobox_football_club_season"] = 20000,
["Infobox_football_league"] = 2600,
["Infobox_football_league_season"] = 19000,
["Infobox_football_match"] = 5900,
["Infobox_football_tournament_season"] = 7900,
["Infobox_former_subdivision"] = 3300,
["Infobox_former_subdivision/styles.css"] = 3300,
["Infobox_galaxy"] = 2100,
["Infobox_game"] = 2500,
["Infobox_game_score"] = 3400,
["Infobox_gene"] = 13000,
["Infobox_given_name"] = 4000,
["Infobox_golfer"] = 4400,
["Infobox_golfer/highest_ranking"] = 4400,
["Infobox_government_agency"] = 10000,
["Infobox_government_cabinet"] = 2500,
["Infobox_gridiron_football_person"] = 2500,
["Infobox_gridiron_football_person/position"] = 5700,
["Infobox_gymnast"] = 3400,
["Infobox_handball_biography"] = 4900,
["Infobox_historic_site"] = 11000,
["Infobox_horseraces"] = 2600,
["Infobox_hospital"] = 6300,
["Infobox_hospital/care_system"] = 6300,
["Infobox_hospital/lists"] = 6300,
["Infobox_ice_hockey_biography"] = 20000,
["Infobox_ice_hockey_player"] = 19000,
["Infobox_ice_hockey_team"] = 3000,
["Infobox_ice_hockey_team_season"] = 2000,
["Infobox_international_football_competition"] = 5700,
["Infobox_islands"] = 8700,
["Infobox_islands/area"] = 9100,
["Infobox_islands/density"] = 9100,
["Infobox_islands/length"] = 8700,
["Infobox_islands/styles.css"] = 8700,
["Infobox_journal"] = 9700,
["Infobox_journal/Abbreviation_search"] = 9600,
["Infobox_journal/Bluebook_check"] = 9400,
["Infobox_journal/Former_check"] = 9400,
["Infobox_journal/ISO_4_check"] = 9400,
["Infobox_journal/ISSN-eISSN"] = 9500,
["Infobox_journal/Indexing_search"] = 9500,
["Infobox_journal/MathSciNet_check"] = 9400,
["Infobox_journal/NLM_check"] = 9400,
["Infobox_journal/frequency"] = 8600,
["Infobox_lake"] = 4400,
["Infobox_language"] = 9500,
["Infobox_language/family-color"] = 11000,
["Infobox_language/genetic"] = 6500,
["Infobox_language/linguistlist"] = 9500,
["Infobox_language/ref"] = 7100,
["Infobox_legislature"] = 3600,
["Infobox_library"] = 2100,
["Infobox_lighthouse"] = 2600,
["Infobox_lighthouse/light"] = 2600,
["Infobox_locomotive"] = 4900,
["Infobox_magazine"] = 7600,
["Infobox_manner_of_address"] = 3300,
["Infobox_mapframe"] = 79000,
["Infobox_martial_artist"] = 5700,
["Infobox_martial_artist/record"] = 5700,
["Infobox_medal_templates"] = 421000,
["Infobox_medical_condition"] = 10000,
["Infobox_medical_condition_(new)"] = 8200,
["Infobox_medical_details"] = 2000,
["Infobox_military_conflict"] = 22000,
["Infobox_military_installation"] = 9700,
["Infobox_military_person"] = 45000,
["Infobox_military_unit"] = 26000,
["Infobox_mine"] = 2100,
["Infobox_model"] = 2300,
["Infobox_mountain"] = 28000,
["Infobox_multi-sport_competition_event"] = 2300,
["Infobox_museum"] = 10000,
["Infobox_musical_artist"] = 121000,
["Infobox_musical_artist/color"] = 121000,
["Infobox_musical_artist/hCard_class"] = 312000,
["Infobox_musical_composition"] = 2900,
["Infobox_name"] = 7400,
["Infobox_name_module"] = 6800,
["Infobox_newspaper"] = 9600,
["Infobox_nobility"] = 2400,
["Infobox_noble"] = 7300,
["Infobox_officeholder"] = 216000,
["Infobox_officeholder/office"] = 221000,
["Infobox_official_post"] = 8000,
["Infobox_organization"] = 36000,
["Infobox_pageant_titleholder"] = 3000,
["Infobox_park"] = 7300,
["Infobox_person"] = 469000,
["Infobox_person/Wikidata"] = 4900,
["Infobox_person/height"] = 102000,
["Infobox_person/length"] = 7100,
["Infobox_person/weight"] = 66000,
["Infobox_philosopher"] = 3400,
["Infobox_planet"] = 4700,
["Infobox_play"] = 3900,
["Infobox_political_party"] = 14000,
["Infobox_power_station"] = 3000,
["Infobox_prepared_food"] = 3100,
["Infobox_professional_wrestler"] = 4200,
["Infobox_professional_wrestling_event"] = 2600,
["Infobox_protected_area"] = 14000,
["Infobox_protein_family"] = 2100,
["Infobox_publisher"] = 2400,
["Infobox_racehorse"] = 5500,
["Infobox_racing_driver"] = 3800,
["Infobox_racing_driver_series_section"] = 2000,
["Infobox_radio_station"] = 22000,
["Infobox_rail"] = 2900,
["Infobox_rail_line"] = 7200,
["Infobox_rail_service"] = 2900,
["Infobox_rail_service/doc"] = 2900,
["Infobox_reality_competition_season"] = 3500,
["Infobox_record_label"] = 4000,
["Infobox_recurring_event"] = 6300,
["Infobox_religious_biography"] = 5200,
["Infobox_religious_building"] = 12000,
["Infobox_religious_building/color"] = 17000,
["Infobox_restaurant"] = 2700,
["Infobox_river"] = 30000,
["Infobox_river/calcunit"] = 30000,
["Infobox_river/discharge"] = 30000,
["Infobox_river/row-style"] = 30000,
["Infobox_river/source"] = 30000,
["Infobox_road"] = 24000,
["Infobox_road/meta/mask/category"] = 24000,
["Infobox_road/meta/mask/country"] = 24000,
["Infobox_road/styles.css"] = 25000,
["Infobox_road_small"] = 2300,
["Infobox_rockunit"] = 6400,
["Infobox_royalty"] = 21000,
["Infobox_royalty/short_description"] = 13000,
["Infobox_rugby_biography"] = 16000,
["Infobox_rugby_biography/correct_date"] = 16000,
["Infobox_rugby_biography/depcheck"] = 15000,
["Infobox_rugby_league_biography"] = 9900,
["Infobox_rugby_league_biography/PLAYER"] = 9800,
["Infobox_rugby_team"] = 2600,
["Infobox_sailboat_specifications"] = 2300,
["Infobox_saint"] = 5000,
["Infobox_school"] = 38000,
["Infobox_school/short_description"] = 38000,
["Infobox_school_district"] = 5600,
["Infobox_school_district/styles.css"] = 5600,
["Infobox_scientist"] = 48000,
["Infobox_service_record"] = 2600,
["Infobox_settlement"] = 559000,
["Infobox_settlement/areadisp"] = 233000,
["Infobox_settlement/columns"] = 94000,
["Infobox_settlement/columns/styles.css"] = 94000,
["Infobox_settlement/densdisp"] = 433000,
["Infobox_settlement/impus"] = 81000,
["Infobox_settlement/lengthdisp"] = 168000,
["Infobox_settlement/link"] = 94000,
["Infobox_settlement/metric"] = 207000,
["Infobox_settlement/pref"] = 289000,
["Infobox_settlement/styles.css"] = 559000,
["Infobox_ship_begin"] = 41000,
["Infobox_ship_career"] = 37000,
["Infobox_ship_characteristics"] = 41000,
["Infobox_ship_class_overview"] = 4100,
["Infobox_ship_image"] = 40000,
["Infobox_shopping_mall"] = 3400,
["Infobox_short_story"] = 2300,
["Infobox_skier"] = 2500,
["Infobox_soap_character"] = 2900,
["Infobox_software"] = 14000,
["Infobox_software/simple"] = 14000,
["Infobox_song"] = 75000,
["Infobox_song/color"] = 75000,
["Infobox_song/link"] = 75000,
["Infobox_spaceflight"] = 3500,
["Infobox_spaceflight/styles.css"] = 3500,
["Infobox_sport_event"] = 2100,
["Infobox_sports_competition_event"] = 17000,
["Infobox_sports_competition_event/medalrow"] = 11000,
["Infobox_sports_league"] = 5000,
["Infobox_sports_season"] = 5300,
["Infobox_sports_team"] = 2200,
["Infobox_sportsperson"] = 106000,
["Infobox_stadium"] = 3500,
["Infobox_station"] = 55000,
["Infobox_station/doc"] = 55000,
["Infobox_station/services"] = 55000,
["Infobox_station/styles.css"] = 55000,
["Infobox_street"] = 3400,
["Infobox_swimmer"] = 9300,
["Infobox_television"] = 56000,
["Infobox_television/Short_description"] = 54000,
["Infobox_television_channel"] = 6200,
["Infobox_television_episode"] = 12000,
["Infobox_television_episode/styles.css"] = 12000,
["Infobox_television_season"] = 9400,
["Infobox_television_station"] = 3700,
["Infobox_tennis_biography"] = 10000,
["Infobox_tennis_event"] = 2400,
["Infobox_tennis_tournament_event"] = 19000,
["Infobox_tennis_tournament_year"] = 9100,
["Infobox_tennis_tournament_year/color"] = 28000,
["Infobox_tennis_tournament_year/footer"] = 28000,
["Infobox_train"] = 2300,
["Infobox_union"] = 2100,
["Infobox_university"] = 26000,
["Infobox_user"] = 2600,
["Infobox_venue"] = 18000,
["Infobox_video_game"] = 28000,
["Infobox_video_game/styles.css"] = 28000,
["Infobox_volleyball_biography"] = 5300,
["Infobox_weapon"] = 7300,
["Infobox_website"] = 7700,
["Infobox_writer"] = 38000,
["Information"] = 102000,
["Information/styles.css"] = 102000,
["Inprogress"] = 2400,
["Input_link"] = 32000,
["Instagram"] = 11000,
["Interlanguage_link"] = 150000,
["Interlanguage_link_multi"] = 19000,
["Internet_Archive_author"] = 18000,
["Internet_Archive_film"] = 2500,
["Intitle"] = 12000,
["Invalid_SVG"] = 3600,
["Invalid_SVG/styles.css"] = 3600,
["Iptalk"] = 20000,
["IranCensus2006"] = 48000,
["IranNCSGN"] = 3200,
["Iran_Census_2006"] = 48000,
["Irc"] = 2100,
["Irish_place_name"] = 2600,
["IsIPAddress"] = 39000,
["IsValidPageName"] = 140000,
["Is_country_in_Central_America"] = 13000,
["Is_country_in_the_Caribbean"] = 14000,
["Is_interwiki_link"] = 6100,
["Is_italic_taxon"] = 473000,
["Is_redirect"] = 26000,
["Isbn"] = 7400,
["Isfdb_name"] = 3800,
["Isfdb_title"] = 4500,
["Isnumeric"] = 205000,
["Iso2continent"] = 35000,
["Iso2country"] = 23000,
["Iso2country/article"] = 22000,
["Iso2country/data"] = 23000,
["Iso2nationality"] = 224000,
["Issubst"] = 72000,
["Isu_name"] = 2200,
["Italic_dab2"] = 5200,
["Italic_title"] = 284000,
["Italic_title_prefixed"] = 8700,
["Italics_colon"] = 3700,
["Italictitle"] = 4300,
["Ivm"] = 5700,
["Ivm/styles.css"] = 5700,
["Ivmbox"] = 122000,
["Ivory_messagebox"] = 140000,
["Module:I18n/complex_date"] = 66000,
["Module:IP"] = 130000,
["Module:IPA_symbol"] = 4700,
["Module:IPA_symbol/data"] = 4700,
["Module:IPAc-en"] = 48000,
["Module:IPAc-en/data"] = 48000,
["Module:IPAc-en/phonemes"] = 48000,
["Module:IPAc-en/pronunciation"] = 48000,
["Module:IPAddress"] = 189000,
["Module:ISO_3166"] = 1030000,
["Module:ISO_3166/data/AT"] = 2500,
["Module:ISO_3166/data/BA"] = 3400,
["Module:ISO_3166/data/CA"] = 2500,
["Module:ISO_3166/data/CN"] = 2100,
["Module:ISO_3166/data/DE"] = 14000,
["Module:ISO_3166/data/ES"] = 3600,
["Module:ISO_3166/data/FR"] = 38000,
["Module:ISO_3166/data/GB"] = 6400,
["Module:ISO_3166/data/GR"] = 3100,
["Module:ISO_3166/data/IN"] = 29000,
["Module:ISO_3166/data/IR"] = 6300,
["Module:ISO_3166/data/National"] = 1030000,
["Module:ISO_3166/data/PL"] = 5800,
["Module:ISO_3166/data/RS"] = 3200,
["Module:ISO_3166/data/RU"] = 25000,
["Module:ISO_3166/data/US"] = 85000,
["Module:ISO_639_name"] = 20000,
["Module:ISOdate"] = 66000,
["Module:Icon"] = 577000,
["Module:Icon/data"] = 577000,
["Module:If_empty"] = 3630000,
["Module:If_in_page"] = 9400,
["Module:If_preview"] = 287000,
["Module:If_preview/configuration"] = 287000,
["Module:If_preview/styles.css"] = 287000,
["Module:Import_style"] = 11000,
["Module:In_lang"] = 354000,
["Module:Indent"] = 4300,
["Module:Infobox"] = 4080000,
["Module:Infobox/dates"] = 68000,
["Module:Infobox/styles.css"] = 4330000,
["Module:Infobox3cols"] = 295000,
["Module:InfoboxImage"] = 4380000,
["Module:Infobox_body_of_water_tracking"] = 18000,
["Module:Infobox_cyclist_tracking"] = 16000,
["Module:Infobox_gene"] = 13000,
["Module:Infobox_mapframe"] = 401000,
["Module:Infobox_military_conflict"] = 22000,
["Module:Infobox_military_conflict/styles.css"] = 22000,
["Module:Infobox_multi-lingual_name"] = 20000,
["Module:Infobox_multi-lingual_name/data"] = 20000,
["Module:Infobox_power_station"] = 3000,
["Module:Infobox_road"] = 25000,
["Module:Infobox_road/browselinks"] = 25000,
["Module:Infobox_road/errors"] = 24000,
["Module:Infobox_road/length"] = 25000,
["Module:Infobox_road/locations"] = 24000,
["Module:Infobox_road/map"] = 24000,
["Module:Infobox_road/route"] = 25000,
["Module:Infobox_road/sections"] = 24000,
["Module:Infobox_television"] = 56000,
["Module:Infobox_television_disambiguation_check"] = 63000,
["Module:Infobox_television_episode"] = 12000,
["Module:Infobox_television_season_disambiguation_check"] = 8900,
["Module:Infobox_television_season_name"] = 9400,
["Module:Internet_Archive"] = 18000,
["Module:IrelandByCountyCatNav"] = 3300,
["Module:Is_infobox_in_lead"] = 376000,
["Module:Is_instance"] = 334000,
["Module:Italic_title"] = 1110000,
["Module:Italic_title2"] = 5200,
}
a29f03d181b4fcf53177bd213f7cc28801871433
Module:Transclusion count/data/S
828
80
162
2023-08-06T05:13:00Z
wikipedia>Ahechtbot
0
[[Wikipedia:BOT|Bot]]: Updated page.
Scribunto
text/plain
return {
["S"] = 3500,
["S-aca"] = 6400,
["S-ach"] = 16000,
["S-aft"] = 218000,
["S-aft/filter"] = 218000,
["S-bef"] = 222000,
["S-bef/filter"] = 222000,
["S-break"] = 5000,
["S-civ"] = 2600,
["S-dip"] = 5300,
["S-end"] = 245000,
["S-gov"] = 7900,
["S-hon"] = 3800,
["S-hou"] = 9500,
["S-inc"] = 13000,
["S-legal"] = 9300,
["S-mil"] = 12000,
["S-new"] = 15000,
["S-non"] = 9200,
["S-npo"] = 4000,
["S-off"] = 41000,
["S-par"] = 50000,
["S-par/en"] = 3200,
["S-par/gb"] = 3300,
["S-par/uk"] = 11000,
["S-par/us-hs"] = 11000,
["S-par/us-sen"] = 2000,
["S-ppo"] = 13000,
["S-prec"] = 3200,
["S-rail"] = 6300,
["S-rail-start"] = 6200,
["S-rail/lines"] = 6400,
["S-reg"] = 20000,
["S-rel"] = 18000,
["S-roy"] = 2700,
["S-s"] = 3600,
["S-sports"] = 10000,
["S-start"] = 239000,
["S-ttl"] = 229000,
["S-vac"] = 6000,
["SCO"] = 3700,
["SDcat"] = 5390000,
["SECOND"] = 2300,
["SGP"] = 2600,
["SIA"] = 2600,
["SIPA"] = 2600,
["SLO"] = 4200,
["SMS"] = 7200,
["SMU"] = 2100,
["SPI_archive_notice"] = 70000,
["SPIarchive_notice"] = 70000,
["SPIcat"] = 3800,
["SPIclose"] = 3300,
["SPIpriorcases"] = 65000,
["SR/Olympics_profile"] = 3200,
["SRB"] = 3600,
["SS"] = 20000,
["SSPa"] = 2600,
["STN"] = 12000,
["SUBJECTSPACE_formatted"] = 42000,
["SUI"] = 8400,
["SVG"] = 3200,
["SVG-Logo"] = 17000,
["SVG-Res"] = 15000,
["SVG-logo"] = 2900,
["SVK"] = 5900,
["SVN"] = 5200,
["SWE"] = 12000,
["Sandbox_other"] = 230000,
["Saturday"] = 2600,
["Saved_book"] = 52000,
["Sc"] = 3000,
["Scholia"] = 2700,
["School_block"] = 13000,
["School_disambiguation"] = 3300,
["Schoolblock"] = 6700,
["Schooldis"] = 2700,
["Schoolip"] = 10000,
["Scientist_icon"] = 15000,
["Scientist_icon2"] = 15000,
["Sclass"] = 31000,
["Sclass2"] = 10000,
["Screen_reader-only"] = 43000,
["Screen_reader-only/styles.css"] = 43000,
["Script"] = 5800,
["Script/Arabic"] = 2100,
["Script/Hebrew"] = 4700,
["Script/Nastaliq"] = 14000,
["Script/doc/id-unk"] = 2900,
["Script/doc/id-unk/core"] = 2900,
["Script/doc/id-unk/is-iso-alpha4"] = 2800,
["Script/doc/id-unk/name-to-alpha4"] = 2900,
["Script/styles.css"] = 3000,
["Script/styles_arabic.css"] = 2100,
["Script/styles_hebrew.css"] = 4700,
["Sdash"] = 3000,
["Search_box"] = 49000,
["Search_link"] = 9800,
["Section_link"] = 52000,
["Section_sizes"] = 2400,
["See"] = 11000,
["See_also"] = 184000,
["Seealso"] = 6700,
["Select_skin"] = 4300,
["Selected_article"] = 2700,
["Selected_picture"] = 2500,
["Self"] = 49000,
["Self-published_inline"] = 3900,
["Self-published_source"] = 6600,
["Self-reference"] = 2700,
["Self-reference_tool"] = 5100,
["Self/migration"] = 33000,
["Self2"] = 2100,
["Sent_off"] = 13000,
["Sentoff"] = 4100,
["Separated_entries"] = 175000,
["Sequence"] = 3700,
["Serial_killer_opentask"] = 3600,
["Series_overview"] = 7600,
["Serif"] = 2800,
["Set_category"] = 35000,
["Set_index_article"] = 5700,
["Sets_taxobox_colour"] = 93000,
["Sfn"] = 152000,
["SfnRef"] = 133000,
["Sfnm"] = 3500,
["Sfnp"] = 17000,
["Sfnref"] = 11000,
["Sfrac"] = 4200,
["Sfrac/styles.css"] = 4200,
["SharedIPEDU"] = 3200,
["Shared_IP"] = 11000,
["Shared_IP_advice"] = 16000,
["Shared_IP_corp"] = 5000,
["Shared_IP_edu"] = 126000,
["Shared_IP_gov"] = 3000,
["Sharedip"] = 3300,
["Sharedipedu"] = 3600,
["Sherdog"] = 2600,
["Ship"] = 85000,
["Ship/maintenancecategory"] = 85000,
["Ship_index"] = 7000,
["Shipboxflag"] = 20000,
["Shipboxflag/core"] = 20000,
["Shipwrecks_navbox_footer"] = 10000,
["Shipwrecks_navbox_footer/link"] = 10000,
["Short_description"] = 5500000,
["Short_description/lowercasecheck"] = 5500000,
["Short_pages_monitor"] = 10000,
["Short_pages_monitor/maximum_length"] = 10000,
["Shortcut"] = 19000,
["Should_be_SVG"] = 9100,
["Show_button"] = 2130000,
["Sic"] = 32000,
["Sica"] = 3000,
["Side_box"] = 1120000,
["Sidebar"] = 254000,
["Sidebar_games_events"] = 36000,
["Sidebar_person"] = 2300,
["Sidebar_person/styles.css"] = 2300,
["Sidebar_with_collapsible_lists"] = 93000,
["Sigfig"] = 3700,
["Significant_figures"] = 5000,
["Significant_figures/rnd"] = 4600,
["Signpost-subscription"] = 2100,
["Sildb_prim"] = 2000,
["Silver02"] = 16000,
["Silver2"] = 48000,
["Silver_medal"] = 5500,
["Similar_names"] = 2100,
["Single+double"] = 6800,
["Single+space"] = 14000,
["Single-innings_cricket_match"] = 3200,
["Single_chart"] = 37000,
["Single_chart/chartnote"] = 37000,
["Single_namespace"] = 200000,
["Singlechart"] = 20000,
["Singles"] = 41000,
["Sister-inline"] = 187000,
["Sister_project"] = 1040000,
["Sister_project_links"] = 11000,
["Sisterlinks"] = 2800,
["Skip_to_talk"] = 12000,
["Skip_to_talk/styles.css"] = 12000,
["Sky"] = 2700,
["Sky/styles.css"] = 2700,
["Slink"] = 13000,
["Small"] = 597000,
["Small_Solar_System_bodies"] = 3600,
["Smallcaps"] = 18000,
["Smallcaps/styles.css"] = 18000,
["Smallcaps_all"] = 3100,
["Smalldiv"] = 21000,
["Smaller"] = 72000,
["Smallsup"] = 21000,
["Smiley"] = 43000,
["Snd"] = 160000,
["Snds"] = 6300,
["Soccer_icon"] = 130000,
["Soccer_icon2"] = 130000,
["Soccer_icon4"] = 5100,
["Soccerbase"] = 13000,
["Soccerbase_season"] = 6700,
["Soccerway"] = 75000,
["Sock"] = 47000,
["Sock_list"] = 4000,
["Sockcat"] = 2000,
["Sockmaster"] = 9300,
["Sockpuppet"] = 237000,
["Sockpuppet/altmaster"] = 2100,
["Sockpuppet/categorise"] = 237000,
["SockpuppetCheckuser"] = 5500,
["Sockpuppet_category"] = 45000,
["Sockpuppet_category/confirmed"] = 23000,
["Sockpuppet_category/suspected"] = 22000,
["Sockpuppetcheckuser"] = 3600,
["Sockpuppeteer"] = 24000,
["Soft_redirect"] = 6100,
["Soft_redirect_protection"] = 8200,
["Softredirect"] = 3200,
["Solar_luminosity"] = 4400,
["Solar_mass"] = 5200,
["Solar_radius"] = 4200,
["Soldier_icon"] = 3900,
["Soldier_icon2"] = 3900,
["Song"] = 8300,
["Songs"] = 19000,
["Songs_category"] = 8300,
["Songs_category/core"] = 8300,
["Sort"] = 116000,
["Sortname"] = 52000,
["Source-attribution"] = 28000,
["Source_check"] = 965000,
["Sourcecheck"] = 965000,
["Sources"] = 2400,
["South_America_topic"] = 2500,
["Sp"] = 250000,
["Space"] = 55000,
["Space+double"] = 18000,
["Space+single"] = 13000,
["Spaced_en_dash"] = 192000,
["Spaced_en_dash_space"] = 6400,
["Spaced_ndash"] = 23000,
["Spaces"] = 2690000,
["Spain_metadata_Wikidata"] = 7500,
["Spamlink"] = 13000,
["Species_Latin_name_abbreviation_disambiguation"] = 2200,
["Species_list"] = 15000,
["Speciesbox"] = 288000,
["Speciesbox/getGenus"] = 288000,
["Speciesbox/getSpecies"] = 288000,
["Speciesbox/name"] = 288000,
["Speciesbox/parameterCheck"] = 288000,
["Speciesbox/trim"] = 288000,
["Specieslist"] = 5400,
["Split_article"] = 3600,
["Spnd"] = 4100,
["Sport_icon"] = 14000,
["Sport_icon2"] = 15000,
["SportsYearCatUSstate"] = 6500,
["SportsYearCatUSstate/core"] = 6500,
["Sports_links"] = 65000,
["Sports_reference"] = 7300,
["Squad_maintenance"] = 3500,
["Sronly"] = 41000,
["Srt"] = 5100,
["Stack"] = 25000,
["Stack/styles.css"] = 34000,
["Stack_begin"] = 8900,
["Stack_end"] = 8900,
["StaleIP"] = 3200,
["Standings_table_end"] = 54000,
["Standings_table_entry"] = 54000,
["Standings_table_entry/record"] = 54000,
["Standings_table_start"] = 54000,
["Standings_table_start/colheader"] = 54000,
["Standings_table_start/colspan"] = 54000,
["Standings_table_start/styles.css"] = 54000,
["Starbox_astrometry"] = 5100,
["Starbox_begin"] = 5300,
["Starbox_catalog"] = 5200,
["Starbox_character"] = 5100,
["Starbox_detail"] = 5000,
["Starbox_end"] = 5200,
["Starbox_image"] = 2900,
["Starbox_observe"] = 5100,
["Starbox_reference"] = 5200,
["Start-Class"] = 18000,
["Start-date"] = 3800,
["Start_and_end_dates"] = 2700,
["Start_box"] = 8100,
["Start_date"] = 433000,
["Start_date_and_age"] = 138000,
["Start_date_and_years_ago"] = 6600,
["Start_of_course_timeline"] = 6000,
["Start_of_course_week"] = 6200,
["Start_tab"] = 4900,
["Startflatlist"] = 144000,
["Static_IP"] = 5900,
["Station"] = 7700,
["Station_link"] = 16000,
["Stdinchicite"] = 10000,
["Steady"] = 14000,
["Stl"] = 14000,
["Stn"] = 7300,
["Stn_art_lnk"] = 2000,
["Stnlnk"] = 30000,
["Storm_colour"] = 5100,
["Storm_path"] = 2100,
["StoryTeleplay"] = 3400,
["Str_endswith"] = 199000,
["Str_find"] = 115000,
["Str_index"] = 13000,
["Str_left"] = 1580000,
["Str_len"] = 18000,
["Str_letter"] = 175000,
["Str_letter/trim"] = 20000,
["Str_number"] = 8000,
["Str_number/trim"] = 169000,
["Str_rep"] = 311000,
["Str_right"] = 678000,
["Str_trim"] = 5300,
["Str_≠_len"] = 34000,
["Str_≥_len"] = 72000,
["Strfind_short"] = 222000,
["Strikethrough"] = 16000,
["String_split"] = 2600,
["Strip_tags"] = 37000,
["Strong"] = 852000,
["Structurae"] = 2100,
["Stub-Class"] = 17000,
["Stub_Category"] = 13000,
["Stub_category"] = 18000,
["Stub_documentation"] = 36000,
["Student_editor"] = 27000,
["Student_sandbox"] = 4500,
["Student_table_row"] = 5100,
["Students_table"] = 5100,
["Su"] = 9700,
["Su-census1989"] = 4500,
["Sub"] = 4100,
["Subinfobox_bodystyle"] = 35000,
["Subject_bar"] = 18000,
["Suboff"] = 6200,
["Subon"] = 6300,
["Subpage_other"] = 285000,
["Subscription"] = 4300,
["Subscription_required"] = 34000,
["Subsidebar_bodystyle"] = 6700,
["Subst_only"] = 4600,
["Substituted_comment"] = 19000,
["Succession_box"] = 119000,
["Succession_links"] = 162000,
["Summer_Olympics_by_year_category_navigation"] = 2400,
["Summer_Olympics_by_year_category_navigation/core"] = 2400,
["Sunday"] = 2600,
["Sup"] = 58000,
["Suppress_categories"] = 5100,
["Surname"] = 66000,
["Swiss_populations"] = 2400,
["Swiss_populations_NC"] = 3000,
["Swiss_populations_YM"] = 2300,
["Swiss_populations_ref"] = 2400,
["Switcher"] = 2700,
["Module:SDcat"] = 5390000,
["Module:SPI_archive_notice"] = 32000,
["Module:Science_redirect"] = 253000,
["Module:Science_redirect/conf"] = 253000,
["Module:Section_link"] = 52000,
["Module:Section_sizes"] = 3500,
["Module:See_also_if_exists"] = 72000,
["Module:Separated_entries"] = 2270000,
["Module:Series_overview"] = 7700,
["Module:Settlement_short_description"] = 709000,
["Module:Shortcut"] = 23000,
["Module:Shortcut/config"] = 23000,
["Module:Shortcut/styles.css"] = 23000,
["Module:Side_box"] = 1150000,
["Module:Side_box/styles.css"] = 1150000,
["Module:Sidebar"] = 336000,
["Module:Sidebar/configuration"] = 336000,
["Module:Sidebar/styles.css"] = 342000,
["Module:Sidebar_games_events"] = 36000,
["Module:Sidebar_games_events/styles.css"] = 36000,
["Module:Singles"] = 41000,
["Module:Sister_project_links"] = 14000,
["Module:Sister_project_links/bar/styles.css"] = 3300,
["Module:Sister_project_links/styles.css"] = 11000,
["Module:Sock_list"] = 4000,
["Module:Sort_title"] = 17000,
["Module:Sortkey"] = 197000,
["Module:Split_article"] = 3600,
["Module:Sports_career"] = 19000,
["Module:Sports_color"] = 68000,
["Module:Sports_color/baseball"] = 34000,
["Module:Sports_color/basketball"] = 22000,
["Module:Sports_color/ice_hockey"] = 3200,
["Module:Sports_rbr_table"] = 11000,
["Module:Sports_rbr_table/styles.css"] = 11000,
["Module:Sports_reference"] = 7300,
["Module:Sports_results"] = 14000,
["Module:Sports_results/styles.css"] = 9400,
["Module:Sports_table"] = 57000,
["Module:Sports_table/WDL"] = 50000,
["Module:Sports_table/WDL_OT"] = 2600,
["Module:Sports_table/WL"] = 3900,
["Module:Sports_table/argcheck"] = 57000,
["Module:Sports_table/styles.css"] = 57000,
["Module:Sports_table/sub"] = 57000,
["Module:Sports_table/totalscheck"] = 41000,
["Module:Stock_tickers/NYSE"] = 2100,
["Module:Storm_categories"] = 5200,
["Module:Storm_categories/categories"] = 5200,
["Module:Storm_categories/colors"] = 5200,
["Module:Storm_categories/icons"] = 5200,
["Module:String"] = 11900000,
["Module:String2"] = 2280000,
["Module:Su"] = 12000,
["Module:Subject_bar"] = 18000,
["Module:Suppress_categories"] = 5200,
}
03ba019c97a222c7612ec7459698be278cb1bd12
Module:Citation/CS1/Configuration
828
112
232
2023-08-07T11:54:33Z
wikipedia>Trappist the monk
0
bump ssrn;
Scribunto
text/plain
local lang_obj = mw.language.getContentLanguage(); -- make a language object for the local language; used here for languages and dates
--[[--------------------------< U N C A T E G O R I Z E D _ N A M E S P A C E S >------------------------------
List of namespaces identifiers for namespaces that will not be included in citation error categories.
Same as setting notracking = true by default.
For wikis that have a current version of Module:cs1 documentation support, this #invoke will return an unordered
list of namespace names and their associated identifiers:
{{#invoke:cs1 documentation support|uncategorized_namespace_lister|all=<anything>}}
]]
uncategorized_namespaces_t = {[2]=true}; -- init with user namespace id
for k, _ in pairs (mw.site.talkNamespaces) do -- add all talk namespace ids
uncategorized_namespaces_t[k] = true;
end
local uncategorized_subpages = {'/[Ss]andbox', '/[Tt]estcases', '/[^/]*[Ll]og', '/[Aa]rchive'}; -- list of Lua patterns found in page names of pages we should not categorize
--[[--------------------------< M E S S A G E S >--------------------------------------------------------------
Translation table
The following contains fixed text that may be output as part of a citation.
This is separated from the main body to aid in future translations of this
module.
]]
local messages = {
['agency'] = '$1 $2', -- $1 is sepc, $2 is agency
['archived-dead'] = 'Archived from $1 on $2',
['archived-live'] = '$1 from the original on $2',
['archived-missing'] = 'Archived from the original $1 on $2',
['archived-unfit'] = 'Archived from the original on ',
['archived'] = 'Archived',
['by'] = 'By', -- contributions to authored works: introduction, foreword, afterword
['cartography'] = 'Cartography by $1',
['editor'] = 'ed.',
['editors'] = 'eds.',
['edition'] = '($1 ed.)',
['episode'] = 'Episode $1',
['et al'] = 'et al.',
['in'] = 'In', -- edited works
['inactive'] = 'inactive',
['inset'] = '$1 inset',
['interview'] = 'Interviewed by $1',
['lay summary'] = 'Lay summary',
['mismatch'] = '<code class="cs1-code">|$1=</code> / <code class="cs1-code">|$2=</code> mismatch', -- $1 is year param name; $2 is date param name
['newsgroup'] = '[[Usenet newsgroup|Newsgroup]]: $1',
['notitle'] = 'No title', -- for |title=(()) and (in the future) |title=none
['original'] = 'the original',
['origdate'] = ' [$1]',
['published'] = ' (published $1)',
['retrieved'] = 'Retrieved $1',
['season'] = 'Season $1',
['section'] = '§ $1',
['sections'] = '§§ $1',
['series'] = '$1 $2', -- $1 is sepc, $2 is series
['seriesnum'] = 'Series $1',
['translated'] = 'Translated by $1',
['type'] = ' ($1)', -- for titletype
['written'] = 'Written at $1',
['vol'] = '$1 Vol. $2', -- $1 is sepc; bold journal style volume is in presentation{}
['vol-no'] = '$1 Vol. $2, no. $3', -- sepc, volume, issue (alternatively insert $1 after $2, but then we'd also have to change capitalization)
['issue'] = '$1 No. $2', -- $1 is sepc
['art'] = '$1 Art. $2', -- $1 is sepc; for {{cite conference}} only
['vol-art'] = '$1 Vol. $2, art. $3', -- sepc, volume, article-number; for {{cite conference}} only
['j-vol'] = '$1 $2', -- sepc, volume; bold journal volume is in presentation{}
['j-issue'] = ' ($1)',
['j-article-num'] = ' $1', -- TODO: any punctuation here? static text?
['nopp'] = '$1 $2'; -- page(s) without prefix; $1 is sepc
['p-prefix'] = "$1 p. $2", -- $1 is sepc
['pp-prefix'] = "$1 pp. $2", -- $1 is sepc
['j-page(s)'] = ': $1', -- same for page and pages
['sheet'] = '$1 Sheet $2', -- $1 is sepc
['sheets'] = '$1 Sheets $2', -- $1 is sepc
['j-sheet'] = ': Sheet $1',
['j-sheets'] = ': Sheets $1',
['language'] = '(in $1)',
['via'] = " – via $1",
['event'] = 'Event occurs at',
['minutes'] = 'minutes in',
-- Determines the location of the help page
['help page link'] = 'Help:CS1 errors',
['help page label'] = 'help',
-- categories
['cat wikilink'] = '[[Category:$1]]', -- $1 is the category name
[':cat wikilink'] = '[[:Category:$1|link]]', -- category name as maintenance message wikilink; $1 is the category name
-- Internal errors (should only occur if configuration is bad)
['undefined_error'] = 'Called with an undefined error condition',
['unknown_ID_key'] = 'Unrecognized ID key: ', -- an ID key in id_handlers not found in ~/Identifiers func_map{}
['unknown_ID_access'] = 'Unrecognized ID access keyword: ', -- an ID access keyword in id_handlers not found in keywords_lists['id-access']{}
['unknown_argument_map'] = 'Argument map not defined for this variable',
['bare_url_no_origin'] = 'Bare URL found but origin indicator is nil or empty',
['warning_msg_e'] = '<span style="color:#d33">One or more <code style="color: inherit; background: inherit; border: none; padding: inherit;">{{$1}}</code> templates have errors</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link
['warning_msg_m'] = '<span style="color:#3a3">One or more <code style="color: inherit; background: inherit; border: none; padding: inherit;">{{$1}}</code> templates have maintenance messages</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link
}
--[[--------------------------< C I T A T I O N _ C L A S S _ M A P >------------------------------------------
this table maps the value assigned to |CitationClass= in the cs1|2 templates to the canonical template name when
the value assigned to |CitationClass= is different from the canonical template name. |CitationClass= values are
used as class attributes in the <cite> tag that encloses the citation so these names may not contain spaces while
the canonical template name may. These names are used in warning_msg_e and warning_msg_m to create links to the
template's documentation when an article is displayed in preview mode.
Most cs1|2 template |CitationClass= values at en.wiki match their canonical template names so are not listed here.
]]
local citation_class_map_t = { -- TODO: if kept, these and all other config.CitationClass 'names' require some sort of i18n
['audio-visual'] = 'AV media',
['AV-media-notes'] = 'AV media notes',
['encyclopaedia'] = 'encyclopedia',
['mailinglist'] = 'mailing list',
['pressrelease'] = 'press release'
}
--[=[-------------------------< E T _ A L _ P A T T E R N S >--------------------------------------------------
This table provides Lua patterns for the phrase "et al" and variants in name text
(author, editor, etc.). The main module uses these to identify and emit the 'etal' message.
]=]
local et_al_patterns = {
"[;,]? *[\"']*%f[%a][Ee][Tt]%.? *[Aa][Ll][%.;,\"']*$", -- variations on the 'et al' theme
"[;,]? *[\"']*%f[%a][Ee][Tt]%.? *[Aa][Ll][Ii][AaIi][Ee]?[%.;,\"']*$", -- variations on the 'et alia', 'et alii' and 'et aliae' themes (false positive 'et aliie' unlikely to match)
"[;,]? *%f[%a]and [Oo]thers", -- an alternative to et al.
"%[%[ *[Ee][Tt]%.? *[Aa][Ll]%.? *%]%]", -- a wikilinked form
"%(%( *[Ee][Tt]%.? *[Aa][Ll]%.? *%)%)", -- a double-bracketed form (to counter partial removal of ((...)) syntax)
"[%(%[] *[Ee][Tt]%.? *[Aa][Ll]%.? *[%)%]]", -- a bracketed form
}
--[[--------------------------< P R E S E N T A T I O N >------------------------
Fixed presentation markup. Originally part of citation_config.messages it has
been moved into its own, more semantically correct place.
]]
local presentation =
{
-- .citation-comment class is specified at Help:CS1_errors#Controlling_error_message_display
['hidden-error'] = '<span class="cs1-hidden-error citation-comment">$1</span>',
['visible-error'] = '<span class="cs1-visible-error citation-comment">$1</span>',
['hidden-maint'] = '<span class="cs1-maint citation-comment">$1</span>',
['accessdate'] = '<span class="reference-accessdate">$1$2</span>', -- to allow editors to hide accessdate using personal CSS
['bdi'] = '<bdi$1>$2</bdi>', -- bidirectional isolation used with |script-title= and the like
['cite'] = '<cite class="$1">$2</cite>'; -- for use when citation does not have a namelist and |ref= not set so no id="..." attribute
['cite-id'] = '<cite id="$1" class="$2">$3</cite>'; -- for use when when |ref= is set or when citation has a namelist
['format'] = ' <span class="cs1-format">($1)</span>', -- for |format=, |chapter-format=, etc.
['interwiki'] = ' <span class="cs1-format">[in $1]</span>', -- for interwiki-language-linked author, editor, etc
['interproj'] = ' <span class="cs1-format">[at $1]</span>', -- for interwiki-project-linked author, editor, etc (:d: and :s: supported; :w: ignored)
-- various access levels, for |access=, |doi-access=, |arxiv=, ...
-- narrow no-break space   may work better than nowrap CSS. Or not? Browser support?
['ext-link-access-signal'] = '<span class="$1" title="$2">$3</span>', -- external link with appropriate lock icon
['free'] = {class='cs1-lock-free', title='Freely accessible'}, -- classes defined in Module:Citation/CS1/styles.css
['registration'] = {class='cs1-lock-registration', title='Free registration required'},
['limited'] = {class='cs1-lock-limited', title='Free access subject to limited trial, subscription normally required'},
['subscription'] = {class='cs1-lock-subscription', title='Paid subscription required'},
['interwiki-icon'] = '<span class="$1" title="$2">$3</span>',
['class-wikisource'] = 'cs1-ws-icon',
['italic-title'] = "''$1''",
['kern-left'] = '<span class="cs1-kern-left"></span>$1', -- spacing to use when title contains leading single or double quote mark
['kern-right'] = '$1<span class="cs1-kern-right"></span>', -- spacing to use when title contains trailing single or double quote mark
['nowrap1'] = '<span class="nowrap">$1</span>', -- for nowrapping an item: <span ...>yyyy-mm-dd</span>
['nowrap2'] = '<span class="nowrap">$1</span> $2', -- for nowrapping portions of an item: <span ...>dd mmmm</span> yyyy (note white space)
['ocins'] = '<span title="$1" class="Z3988"></span>',
['parameter'] = '<code class="cs1-code">|$1=</code>',
['ps_cs1'] = '.'; -- CS1 style postscript (terminal) character
['ps_cs2'] = ''; -- CS2 style postscript (terminal) character (empty string)
['quoted-text'] = '<q>$1</q>', -- for wrapping |quote= content
['quoted-title'] = '"$1"',
['sep_cs1'] = '.', -- CS1 element separator
['sep_cs2'] = ',', -- CS2 separator
['sep_nl'] = ';', -- CS1|2 style name-list separator between names is a semicolon
['sep_nl_and'] = ' and ', -- used as last nl sep when |name-list-style=and and list has 2 items
['sep_nl_end'] = '; and ', -- used as last nl sep when |name-list-style=and and list has 3+ names
['sep_name'] = ', ', -- CS1|2 style last/first separator is <comma><space>
['sep_nl_vanc'] = ',', -- Vancouver style name-list separator between authors is a comma
['sep_name_vanc'] = ' ', -- Vancouver style last/first separator is a space
['sep_list'] = ', ', -- used for |language= when list has 3+ items except for last sep which uses sep_list_end
['sep_list_pair'] = ' and ', -- used for |language= when list has 2 items
['sep_list_end'] = ', and ', -- used as last list sep for |language= when list has 3+ items
['trans-italic-title'] = "[''$1'']",
['trans-quoted-title'] = "[$1]", -- for |trans-title= and |trans-quote=
['vol-bold'] = '$1 <b>$2</b>', -- sepc, volume; for bold journal cites; for other cites ['vol'] in messages{}
}
--[[--------------------------< A L I A S E S >---------------------------------
Aliases table for commonly passed parameters.
Parameter names on the right side in the assignments in this table must have been
defined in the Whitelist before they will be recognized as valid parameter names
]]
local aliases = {
['AccessDate'] = {'access-date', 'accessdate'}, -- Used by InternetArchiveBot
['Agency'] = 'agency',
['ArchiveDate'] = {'archive-date', 'archivedate'}, -- Used by InternetArchiveBot
['ArchiveFormat'] = 'archive-format',
['ArchiveURL'] = {'archive-url', 'archiveurl'}, -- Used by InternetArchiveBot
['ArticleNumber'] = 'article-number',
['ASINTLD'] = 'asin-tld',
['At'] = 'at', -- Used by InternetArchiveBot
['Authors'] = {'authors', 'people', 'credits'},
['BookTitle'] = {'book-title', 'booktitle'},
['Cartography'] = 'cartography',
['Chapter'] = {'chapter', 'contribution', 'entry', 'article', 'section'},
['ChapterFormat'] = {'chapter-format', 'contribution-format', 'entry-format',
'article-format', 'section-format'};
['ChapterURL'] = {'chapter-url', 'contribution-url', 'entry-url', 'article-url', 'section-url', 'chapterurl'}, -- Used by InternetArchiveBot
['ChapterUrlAccess'] = {'chapter-url-access', 'contribution-url-access',
'entry-url-access', 'article-url-access', 'section-url-access'}, -- Used by InternetArchiveBot
['Class'] = 'class', -- cite arxiv and arxiv identifier
['Collaboration'] = 'collaboration',
['Conference'] = {'conference', 'event'},
['ConferenceFormat'] = 'conference-format',
['ConferenceURL'] = 'conference-url', -- Used by InternetArchiveBot
['Date'] = {'date', 'air-date', 'airdate'}, -- air-date and airdate for cite episode and cite serial only
['Degree'] = 'degree',
['DF'] = 'df',
['DisplayAuthors'] = {'display-authors', 'display-subjects'},
['DisplayContributors'] = 'display-contributors',
['DisplayEditors'] = 'display-editors',
['DisplayInterviewers'] = 'display-interviewers',
['DisplayTranslators'] = 'display-translators',
['Docket'] = 'docket',
['DoiBroken'] = 'doi-broken-date',
['Edition'] = 'edition',
['Embargo'] = 'pmc-embargo-date',
['Encyclopedia'] = {'encyclopedia', 'encyclopaedia', 'dictionary'}, -- cite encyclopedia only
['Episode'] = 'episode', -- cite serial only TODO: make available to cite episode?
['Format'] = 'format',
['ID'] = {'id', 'ID'},
['Inset'] = 'inset',
['Issue'] = {'issue', 'number'},
['Language'] = {'language', 'lang'},
['LayDate'] = 'lay-date',
['LayFormat'] = 'lay-format',
['LaySource'] = 'lay-source',
['LayURL'] = 'lay-url',
['MailingList'] = {'mailing-list', 'mailinglist'}, -- cite mailing list only
['Map'] = 'map', -- cite map only
['MapFormat'] = 'map-format', -- cite map only
['MapURL'] = {'map-url', 'mapurl'}, -- cite map only -- Used by InternetArchiveBot
['MapUrlAccess'] = 'map-url-access', -- cite map only -- Used by InternetArchiveBot
['Minutes'] = 'minutes',
['Mode'] = 'mode',
['NameListStyle'] = 'name-list-style',
['Network'] = 'network',
['Newsgroup'] = 'newsgroup', -- cite newsgroup only
['NoPP'] = {'no-pp', 'nopp'},
['NoTracking'] = {'no-tracking', 'template-doc-demo'},
['Number'] = 'number', -- this case only for cite techreport
['OrigDate'] = {'orig-date', 'orig-year', 'origyear'},
['Others'] = 'others',
['Page'] = {'page', 'p'}, -- Used by InternetArchiveBot
['Pages'] = {'pages', 'pp'}, -- Used by InternetArchiveBot
['Periodical'] = {'journal', 'magazine', 'newspaper', 'periodical', 'website', 'work'},
['Place'] = {'place', 'location'},
['PostScript'] = 'postscript',
['PublicationDate'] = {'publication-date', 'publicationdate'},
['PublicationPlace'] = {'publication-place', 'publicationplace'},
['PublisherName'] = {'publisher', 'institution'},
['Quote'] = {'quote', 'quotation'},
['QuotePage'] = 'quote-page',
['QuotePages'] = 'quote-pages',
['Ref'] = 'ref',
['Scale'] = 'scale',
['ScriptChapter'] = {'script-chapter', 'script-contribution', 'script-entry',
'script-article', 'script-section'},
['ScriptMap'] = 'script-map',
['ScriptPeriodical'] = {'script-journal', 'script-magazine', 'script-newspaper',
'script-periodical', 'script-website', 'script-work'},
['ScriptQuote'] = 'script-quote',
['ScriptTitle'] = 'script-title', -- Used by InternetArchiveBot
['Season'] = 'season',
['Sections'] = 'sections', -- cite map only
['Series'] = {'series', 'version'},
['SeriesLink'] = {'series-link', 'serieslink'},
['SeriesNumber'] = {'series-number', 'series-no'},
['Sheet'] = 'sheet', -- cite map only
['Sheets'] = 'sheets', -- cite map only
['Station'] = 'station',
['Time'] = 'time',
['TimeCaption'] = 'time-caption',
['Title'] = 'title', -- Used by InternetArchiveBot
['TitleLink'] = {'title-link', 'episode-link', 'episodelink'}, -- Used by InternetArchiveBot
['TitleNote'] = 'department',
['TitleType'] = {'type', 'medium'},
['TransChapter'] = {'trans-article', 'trans-chapter', 'trans-contribution',
'trans-entry', 'trans-section'},
['Transcript'] = 'transcript',
['TranscriptFormat'] = 'transcript-format',
['TranscriptURL'] = {'transcript-url', 'transcripturl'}, -- Used by InternetArchiveBot
['TransMap'] = 'trans-map', -- cite map only
['TransPeriodical'] = {'trans-journal', 'trans-magazine', 'trans-newspaper',
'trans-periodical', 'trans-website', 'trans-work'},
['TransQuote'] = 'trans-quote',
['TransTitle'] = 'trans-title', -- Used by InternetArchiveBot
['URL'] = {'url', 'URL'}, -- Used by InternetArchiveBot
['UrlAccess'] = 'url-access', -- Used by InternetArchiveBot
['UrlStatus'] = 'url-status', -- Used by InternetArchiveBot
['Vauthors'] = 'vauthors',
['Veditors'] = 'veditors',
['Via'] = 'via',
['Volume'] = 'volume',
['Year'] = 'year',
['AuthorList-First'] = {"first#", "author-first#", "author#-first", "given#",
"author-given#", "author#-given"},
['AuthorList-Last'] = {"last#", "author-last#", "author#-last", "surname#",
"author-surname#", "author#-surname", "author#", "subject#", 'host#'},
['AuthorList-Link'] = {"author-link#", "author#-link", "subject-link#",
"subject#-link", "authorlink#", "author#link"},
['AuthorList-Mask'] = {"author-mask#", "author#-mask", "subject-mask#", "subject#-mask"},
['ContributorList-First'] = {'contributor-first#', 'contributor#-first',
'contributor-given#', 'contributor#-given'},
['ContributorList-Last'] = {'contributor-last#', 'contributor#-last',
'contributor-surname#', 'contributor#-surname', 'contributor#'},
['ContributorList-Link'] = {'contributor-link#', 'contributor#-link'},
['ContributorList-Mask'] = {'contributor-mask#', 'contributor#-mask'},
['EditorList-First'] = {"editor-first#", "editor#-first", "editor-given#", "editor#-given"},
['EditorList-Last'] = {"editor-last#", "editor#-last", "editor-surname#",
"editor#-surname", "editor#"},
['EditorList-Link'] = {"editor-link#", "editor#-link"},
['EditorList-Mask'] = {"editor-mask#", "editor#-mask"},
['InterviewerList-First'] = {'interviewer-first#', 'interviewer#-first',
'interviewer-given#', 'interviewer#-given'},
['InterviewerList-Last'] = {'interviewer-last#', 'interviewer#-last',
'interviewer-surname#', 'interviewer#-surname', 'interviewer#'},
['InterviewerList-Link'] = {'interviewer-link#', 'interviewer#-link'},
['InterviewerList-Mask'] = {'interviewer-mask#', 'interviewer#-mask'},
['TranslatorList-First'] = {'translator-first#', 'translator#-first',
'translator-given#', 'translator#-given'},
['TranslatorList-Last'] = {'translator-last#', 'translator#-last',
'translator-surname#', 'translator#-surname', 'translator#'},
['TranslatorList-Link'] = {'translator-link#', 'translator#-link'},
['TranslatorList-Mask'] = {'translator-mask#', 'translator#-mask'},
}
--[[--------------------------< P U N C T _ S K I P >---------------------------
builds a table of parameter names that the extraneous terminal punctuation check should not check.
]]
local punct_meta_params = { -- table of aliases[] keys (meta parameters); each key has a table of parameter names for a value
'BookTitle', 'Chapter', 'ScriptChapter', 'ScriptTitle', 'Title', 'TransChapter', 'Transcript', 'TransMap', 'TransTitle', -- title-holding parameters
'AuthorList-Mask', 'ContributorList-Mask', 'EditorList-Mask', 'InterviewerList-Mask', 'TranslatorList-Mask', -- name-list mask may have name separators
'PostScript', 'Quote', 'ScriptQuote', 'TransQuote', 'Ref', -- miscellaneous
'ArchiveURL', 'ChapterURL', 'ConferenceURL', 'LayURL', 'MapURL', 'TranscriptURL', 'URL', -- URL-holding parameters
}
local url_meta_params = { -- table of aliases[] keys (meta parameters); each key has a table of parameter names for a value
'ArchiveURL', 'ChapterURL', 'ConferenceURL', 'ID', 'LayURL', 'MapURL', 'TranscriptURL', 'URL', -- parameters allowed to hold urls
'Page', 'Pages', 'At', 'QuotePage', 'QuotePages', -- insource locators allowed to hold urls
}
local function build_skip_table (skip_t, meta_params)
for _, meta_param in ipairs (meta_params) do -- for each meta parameter key
local params = aliases[meta_param]; -- get the parameter or the table of parameters associated with the meta parameter name
if 'string' == type (params) then
skip_t[params] = 1; -- just a single parameter
else
for _, param in ipairs (params) do -- get the parameter name
skip_t[param] = 1; -- add the parameter name to the skip table
local count;
param, count = param:gsub ('#', ''); -- remove enumerator marker from enumerated parameters
if 0 ~= count then -- if removed
skip_t[param] = 1; -- add param name without enumerator marker
end
end
end
end
return skip_t;
end
local punct_skip = {};
local url_skip = {};
--[[--------------------------< S I N G L E - L E T T E R S E C O N D - L E V E L D O M A I N S >----------
this is a list of tlds that are known to have single-letter second-level domain names. This list does not include
ccTLDs which are accepted in is_domain_name().
]]
local single_letter_2nd_lvl_domains_t = {'cash', 'company', 'foundation', 'org', 'today'};
--[[-----------< S P E C I A L C A S E T R A N S L A T I O N S >------------
This table is primarily here to support internationalization. Translations in
this table are used, for example, when an error message, category name, etc.,
is extracted from the English alias key. There may be other cases where
this translation table may be useful.
]]
local is_Latn = 'A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143';
local special_case_translation = {
['AuthorList'] = 'authors list', -- used to assemble maintenance category names
['ContributorList'] = 'contributors list', -- translation of these names plus translation of the base maintenance category names in maint_cats{} table below
['EditorList'] = 'editors list', -- must match the names of the actual categories
['InterviewerList'] = 'interviewers list', -- this group or translations used by name_has_ed_markup() and name_has_mult_names()
['TranslatorList'] = 'translators list',
-- Lua patterns to match pseudo-titles used by InternetArchiveBot and others as placeholder for unknown |title= value
['archived_copy'] = { -- used with CS1 maint: Archive[d] copy as title
['en'] = '^archived?%s+copy$', -- for English; translators: keep this because templates imported from en.wiki
['local'] = nil, -- translators: replace ['local'] = nil with lowercase translation only when bots or tools create generic titles in your language
},
-- Lua patterns to match generic titles; usually created by bots or reference filling tools
-- translators: replace ['local'] = nil with lowercase translation only when bots or tools create generic titles in your language
-- generic titles and patterns in this table should be lowercase only
-- leave ['local'] nil except when there is a matching generic title in your language
-- boolean 'true' for plain-text searches; 'false' for pattern searches
['generic_titles'] = {
['accept'] = {
},
['reject'] = {
{['en'] = {'^wayback%s+machine$', false}, ['local'] = nil},
{['en'] = {'are you a robot', true}, ['local'] = nil},
{['en'] = {'hugedomains.com', true}, ['local'] = nil},
{['en'] = {'^[%(%[{<]?no +title[>}%]%)]?$', false}, ['local'] = nil},
{['en'] = {'page not found', true}, ['local'] = nil},
{['en'] = {'subscribe to read', true}, ['local'] = nil},
{['en'] = {'^[%(%[{<]?unknown[>}%]%)]?$', false}, ['local'] = nil},
{['en'] = {'website is for sale', true}, ['local'] = nil},
{['en'] = {'^404', false}, ['local'] = nil},
{['en'] = {'internet archive wayback machine', true}, ['local'] = nil},
{['en'] = {'log into facebook', true}, ['local'] = nil},
{['en'] = {'login • instagram', true}, ['local'] = nil},
{['en'] = {'redirecting...', true}, ['local'] = nil},
{['en'] = {'usurped title', true}, ['local'] = nil}, -- added by a GreenC bot
{['en'] = {'webcite query result', true}, ['local'] = nil},
{['en'] = {'wikiwix\'s cache', true}, ['local'] = nil},
}
},
-- boolean 'true' for plain-text searches, search string must be lowercase only
-- boolean 'false' for pattern searches
-- leave ['local'] nil except when there is a matching generic name in your language
['generic_names'] = {
['accept'] = {
{['en'] = {'%[%[[^|]*%(author%) *|[^%]]*%]%]', false}, ['local'] = nil},
},
['reject'] = {
{['en'] = {'about us', true}, ['local'] = nil},
{['en'] = {'%f[%a][Aa]dvisor%f[%A]', false}, ['local'] = nil},
{['en'] = {'allmusic', true}, ['local'] = nil},
{['en'] = {'%f[%a][Aa]uthor%f[%A]', false}, ['local'] = nil},
{['en'] = {'business', true}, ['local'] = nil},
{['en'] = {'cnn', true}, ['local'] = nil},
{['en'] = {'collaborator', true}, ['local'] = nil},
{['en'] = {'contributor', true}, ['local'] = nil},
{['en'] = {'contact us', true}, ['local'] = nil},
{['en'] = {'directory', true}, ['local'] = nil},
{['en'] = {'%f[%(%[][%(%[]%s*eds?%.?%s*[%)%]]?$', false}, ['local'] = nil},
{['en'] = {'[,%.%s]%f[e]eds?%.?$', false}, ['local'] = nil},
{['en'] = {'^eds?[%.,;]', false}, ['local'] = nil},
{['en'] = {'^[%(%[]%s*[Ee][Dd][Ss]?%.?%s*[%)%]]', false}, ['local'] = nil},
{['en'] = {'%f[%a][Ee]dited%f[%A]', false}, ['local'] = nil},
{['en'] = {'%f[%a][Ee]ditors?%f[%A]', false}, ['local'] = nil},
{['en'] = {'%f[%a]]Ee]mail%f[%A]', false}, ['local'] = nil},
{['en'] = {'facebook', true}, ['local'] = nil},
{['en'] = {'google', true}, ['local'] = nil},
{['en'] = {'home page', true}, ['local'] = nil},
{['en'] = {'^[Ii]nc%.?$', false}, ['local'] = nil},
{['en'] = {'instagram', true}, ['local'] = nil},
{['en'] = {'interviewer', true}, ['local'] = nil},
{['en'] = {'linkedIn', true}, ['local'] = nil},
{['en'] = {'^[Nn]ews$', false}, ['local'] = nil},
{['en'] = {'pinterest', true}, ['local'] = nil},
{['en'] = {'policy', true}, ['local'] = nil},
{['en'] = {'privacy', true}, ['local'] = nil},
{['en'] = {'reuters', true}, ['local'] = nil},
{['en'] = {'translator', true}, ['local'] = nil},
{['en'] = {'tumblr', true}, ['local'] = nil},
{['en'] = {'twitter', true}, ['local'] = nil},
{['en'] = {'site name', true}, ['local'] = nil},
{['en'] = {'statement', true}, ['local'] = nil},
{['en'] = {'submitted', true}, ['local'] = nil},
{['en'] = {'super.?user', false}, ['local'] = nil},
{['en'] = {'%f['..is_Latn..'][Uu]ser%f[^'..is_Latn..']', false}, ['local'] = nil},
{['en'] = {'verfasser', true}, ['local'] = nil},
}
}
}
--[[--------------------------< D A T E _ N A M E S >----------------------------------------------------------
This table of tables lists local language date names and fallback English date names.
The code in Date_validation will look first in the local table for valid date names.
If date names are not found in the local table, the code will look in the English table.
Because citations can be copied to the local wiki from en.wiki, the English is
required when the date-name translation function date_name_xlate() is used.
In these tables, season numbering is defined by
Extended Date/Time Format (EDTF) Specification (https://www.loc.gov/standards/datetime/)
which became part of ISO 8601 in 2019. See '§Sub-year groupings'. The standard
defines various divisions using numbers 21-41. CS1|2 only supports generic seasons.
EDTF does support the distinction between north and south hemisphere seasons
but CS1|2 has no way to make that distinction.
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
The standard does not address 'named' dates so, for the purposes of CS1|2,
Easter and Christmas are defined here as 98 and 99, which should be out of the
ISO 8601 (EDTF) range of uses for a while.
local_date_names_from_mediawiki is a boolean. When set to:
true – module will fetch local month names from MediaWiki for both date_names['local']['long'] and date_names['local']['short']
false – module will *not* fetch local month names from MediaWiki
Caveat lector: There is no guarantee that MediaWiki will provide short month names. At your wiki you can test
the results of the MediaWiki fetch in the debug console with this command (the result is alpha sorted):
=mw.dumpObject (p.date_names['local'])
While the module can fetch month names from MediaWiki, it cannot fetch the quarter, season, and named date names
from MediaWiki. Those must be translated manually.
]]
local local_date_names_from_mediawiki = true; -- when false, manual translation required for date_names['local']['long'] and date_names['local']['short']
-- when true, module fetches long and short month names from MediaWiki
local date_names = {
['en'] = { -- English
['long'] = {['January'] = 1, ['February'] = 2, ['March'] = 3, ['April'] = 4, ['May'] = 5, ['June'] = 6, ['July'] = 7, ['August'] = 8, ['September'] = 9, ['October'] = 10, ['November'] = 11, ['December'] = 12},
['short'] = {['Jan'] = 1, ['Feb'] = 2, ['Mar'] = 3, ['Apr'] = 4, ['May'] = 5, ['Jun'] = 6, ['Jul'] = 7, ['Aug'] = 8, ['Sep'] = 9, ['Oct'] = 10, ['Nov'] = 11, ['Dec'] = 12},
['quarter'] = {['First Quarter'] = 33, ['Second Quarter'] = 34, ['Third Quarter'] = 35, ['Fourth Quarter'] = 36},
['season'] = {['Winter'] = 24, ['Spring'] = 21, ['Summer'] = 22, ['Fall'] = 23, ['Autumn'] = 23},
['named'] = {['Easter'] = 98, ['Christmas'] = 99},
},
-- when local_date_names_from_mediawiki = false
['local'] = { -- replace these English date names with the local language equivalents
['long'] = {['January'] = 1, ['February'] = 2, ['March'] = 3, ['April'] = 4, ['May'] = 5, ['June'] = 6, ['July'] = 7, ['August'] = 8, ['September'] = 9, ['October'] = 10, ['November'] = 11, ['December'] = 12},
['short'] = {['Jan'] = 1, ['Feb'] = 2, ['Mar'] = 3, ['Apr'] = 4, ['May'] = 5, ['Jun'] = 6, ['Jul'] = 7, ['Aug'] = 8, ['Sep'] = 9, ['Oct'] = 10, ['Nov'] = 11, ['Dec'] = 12},
['quarter'] = {['First Quarter'] = 33, ['Second Quarter'] = 34, ['Third Quarter'] = 35, ['Fourth Quarter'] = 36},
['season'] = {['Winter'] = 24, ['Spring'] = 21, ['Summer'] = 22, ['Fall'] = 23, ['Autumn'] = 23},
['named'] = {['Easter'] = 98, ['Christmas'] = 99},
},
['inv_local_long'] = {}, -- used in date reformatting & translation; copy of date_names['local'].long where k/v are inverted: [1]='<local name>' etc.
['inv_local_short'] = {}, -- used in date reformatting & translation; copy of date_names['local'].short where k/v are inverted: [1]='<local name>' etc.
['inv_local_quarter'] = {}, -- used in date translation; copy of date_names['local'].quarter where k/v are inverted: [1]='<local name>' etc.
['inv_local_season'] = {}, -- used in date translation; copy of date_names['local'].season where k/v are inverted: [1]='<local name>' etc.
['inv_local_named'] = {}, -- used in date translation; copy of date_names['local'].named where k/v are inverted: [1]='<local name>' etc.
['local_digits'] = {['0'] = '0', ['1'] = '1', ['2'] = '2', ['3'] = '3', ['4'] = '4', ['5'] = '5', ['6'] = '6', ['7'] = '7', ['8'] = '8', ['9'] = '9'}, -- used to convert local language digits to Western 0-9
['xlate_digits'] = {},
}
if local_date_names_from_mediawiki then -- if fetching local month names from MediaWiki is enabled
local long_t = {};
local short_t = {};
for i=1, 12 do -- loop 12x and
local name = lang_obj:formatDate('F', '2022-' .. i .. '-1'); -- get long month name for each i
long_t[name] = i; -- save it
name = lang_obj:formatDate('M', '2022-' .. i .. '-1'); -- get short month name for each i
short_t[name] = i; -- save it
end
date_names['local']['long'] = long_t; -- write the long table – overwrites manual translation
date_names['local']['short'] = short_t; -- write the short table – overwrites manual translation
end
-- create inverted date-name tables for reformatting and/or translation
for _, invert_t in pairs {{'long', 'inv_local_long'}, {'short', 'inv_local_short'}, {'quarter', 'inv_local_quarter'}, {'season', 'inv_local_season'}, {'named', 'inv_local_named'}} do
for name, i in pairs (date_names['local'][invert_t[1]]) do -- this table is ['name'] = i
date_names[invert_t[2]][i] = name; -- invert to get [i] = 'name' for conversions from ymd
end
end
for ld, ed in pairs (date_names.local_digits) do -- make a digit translation table for simple date translation from en to local language using local_digits table
date_names.xlate_digits [ed] = ld; -- en digit becomes index with local digit as the value
end
local df_template_patterns = { -- table of redirects to {{Use dmy dates}} and {{Use mdy dates}}
'{{ *[Uu]se +(dmy) +dates *[|}]', -- 1159k -- sorted by approximate transclusion count
'{{ *[Uu]se +(mdy) +dates *[|}]', -- 212k
'{{ *[Uu]se +(MDY) +dates *[|}]', -- 788
'{{ *[Uu]se +(DMY) +dates *[|}]', -- 343
'{{ *([Mm]dy) *[|}]', -- 176
'{{ *[Uu]se *(dmy) *[|}]', -- 156 + 18
'{{ *[Uu]se *(mdy) *[|}]', -- 149 + 11
'{{ *([Dd]my) *[|}]', -- 56
'{{ *[Uu]se +(MDY) *[|}]', -- 5
'{{ *([Dd]MY) *[|}]', -- 3
'{{ *[Uu]se(mdy)dates *[|}]', -- 1
'{{ *[Uu]se +(DMY) *[|}]', -- 0
'{{ *([Mm]DY) *[|}]', -- 0
}
local function get_date_format ()
local title_object = mw.title.getCurrentTitle();
if title_object.namespace == 10 then -- not in template space so that unused templates appear in unused-template-reports;
return nil; -- auto-formatting does not work in Template space so don't set global_df
end
local content = title_object:getContent() or ''; -- get the content of the article or ''; new pages edited w/ve do not have 'content' until saved; ve does not preview; phab:T221625
for _, pattern in ipairs (df_template_patterns) do -- loop through the patterns looking for {{Use dmy dates}} or {{Use mdy dates}} or any of their redirects
local start, _, match = content:find(pattern); -- match is the three letters indicating desired date format
if match then
content = content:match ('%b{}', start); -- get the whole template
if content:match ('| *cs1%-dates *= *[lsy][sy]?') then -- look for |cs1-dates=publication date length access-/archive-date length
return match:lower() .. '-' .. content:match ('| *cs1%-dates *= *([lsy][sy]?)');
else
return match:lower() .. '-all'; -- no |cs1-dates= k/v pair; return value appropriate for use in |df=
end
end
end
end
local global_df;
--[[-----------------< V O L U M E , I S S U E , P A G E S >------------------
These tables hold cite class values (from the template invocation) and identify those templates that support
|volume=, |issue=, and |page(s)= parameters. Cite conference and cite map require further qualification which
is handled in the main module.
]]
local templates_using_volume = {'citation', 'audio-visual', 'book', 'conference', 'encyclopaedia', 'interview', 'journal', 'magazine', 'map', 'news', 'report', 'techreport', 'thesis'}
local templates_using_issue = {'citation', 'conference', 'episode', 'interview', 'journal', 'magazine', 'map', 'news', 'podcast'}
local templates_not_using_page = {'audio-visual', 'episode', 'mailinglist', 'newsgroup', 'podcast', 'serial', 'sign', 'speech'}
--[[
These tables control when it is appropriate for {{citation}} to render |volume= and/or |issue=. The parameter
names in the tables constrain {{citation}} so that its renderings match the renderings of the equivalent cs1
templates. For example, {{cite web}} does not support |volume= so the equivalent {{citation |website=...}} must
not support |volume=.
]]
local citation_no_volume_t = { -- {{citation}} does not render |volume= when these parameters are used
'website', 'mailinglist', 'script-website',
}
local citation_issue_t = { -- {{citation}} may render |issue= when these parameters are used
'journal', 'magazine', 'newspaper', 'periodical', 'work',
'script-journal', 'script-magazine', 'script-newspaper', 'script-periodical', 'script-work',
}
--[[
Patterns for finding extra text in |volume=, |issue=, |page=, |pages=
]]
local vol_iss_pg_patterns = {
good_ppattern = '^P[^%.PpGg]', -- OK to begin with uppercase P: P7 (page 7 of section P), but not p123 (page 123); TODO: this allows 'Pages' which it should not
bad_ppatterns = { -- patterns for |page= and |pages=
'^[Pp][PpGg]?%.?[ %d]',
'^[Pp][Pp]?%. ', -- from {{p.}} and {{pp.}} templates
'^[Pp]ages?',
'^[Pp]gs.?',
},
vpatterns = { -- patterns for |volume=
'^volumes?',
'^vols?[%.:=]?'
},
ipatterns = { -- patterns for |issue=
'^issues?',
'^iss[%.:=]?',
'^numbers?',
'^nos?%A', -- don't match 'november' or 'nostradamus'
'^nr[%.:=]?',
'^n[%.:= ]' -- might be a valid issue without separator (space char is sep char here)
}
}
--[[--------------------------< K E Y W O R D S >-------------------------------
These tables hold keywords for those parameters that have defined sets of acceptable keywords.
]]
--[[-------------------< K E Y W O R D S T A B L E >--------------------------
this is a list of keywords; each key in the list is associated with a table of
synonymous keywords possibly from different languages.
for I18N: add local-language keywords to value table; do not change the key.
For example, adding the German keyword 'ja':
['affirmative'] = {'yes', 'true', 'y', 'ja'},
Because CS1|2 templates from en.wiki articles are often copied to other local wikis,
it is recommended that the English keywords remain in these tables.
]]
local keywords = {
['amp'] = {'&', 'amp', 'ampersand'}, -- |name-list-style=
['and'] = {'and', 'serial'}, -- |name-list-style=
['affirmative'] = {'yes', 'true', 'y'}, -- |no-tracking=, |no-pp= -- Used by InternetArchiveBot
['afterword'] = {'afterword'}, -- |contribution=
['bot: unknown'] = {'bot: unknown'}, -- |url-status= -- Used by InternetArchiveBot
['cs1'] = {'cs1'}, -- |mode=
['cs2'] = {'cs2'}, -- |mode=
['dead'] = {'dead', 'deviated'}, -- |url-status= -- Used by InternetArchiveBot
['dmy'] = {'dmy'}, -- |df=
['dmy-all'] = {'dmy-all'}, -- |df=
['foreword'] = {'foreword'}, -- |contribution=
['free'] = {'free'}, -- |<id>-access= -- Used by InternetArchiveBot
['harv'] = {'harv'}, -- |ref=; this no longer supported; is_valid_parameter_value() called with <invert> = true
['introduction'] = {'introduction'}, -- |contribution=
['limited'] = {'limited'}, -- |url-access= -- Used by InternetArchiveBot
['live'] = {'live'}, -- |url-status= -- Used by InternetArchiveBot
['mdy'] = {'mdy'}, -- |df=
['mdy-all'] = {'mdy-all'}, -- |df=
['none'] = {'none'}, -- |postscript=, |ref=, |title=, |type= -- Used by InternetArchiveBot
['off'] = {'off'}, -- |title= (potentially also: |title-link=, |postscript=, |ref=, |type=)
['preface'] = {'preface'}, -- |contribution=
['registration'] = {'registration'}, -- |url-access= -- Used by InternetArchiveBot
['subscription'] = {'subscription'}, -- |url-access= -- Used by InternetArchiveBot
['unfit'] = {'unfit'}, -- |url-status= -- Used by InternetArchiveBot
['usurped'] = {'usurped'}, -- |url-status= -- Used by InternetArchiveBot
['vanc'] = {'vanc'}, -- |name-list-style=
['ymd'] = {'ymd'}, -- |df=
['ymd-all'] = {'ymd-all'}, -- |df=
-- ['yMd'] = {'yMd'}, -- |df=; not supported at en.wiki
-- ['yMd-all'] = {'yMd-all'}, -- |df=; not supported at en.wiki
}
--[[------------------------< X L A T E _ K E Y W O R D S >---------------------
this function builds a list, keywords_xlate{}, of the keywords found in keywords{} where the values from keywords{}
become the keys in keywords_xlate{} and the keys from keywords{} become the values in keywords_xlate{}:
['affirmative'] = {'yes', 'true', 'y'}, -- in keywords{}
becomes
['yes'] = 'affirmative', -- in keywords_xlate{}
['true'] = 'affirmative',
['y'] = 'affirmative',
the purpose of this function is to act as a translator between a non-English keyword and its English equivalent
that may be used in other modules of this suite
]]
local function xlate_keywords ()
local out_table = {}; -- output goes here
for k, keywords_t in pairs (keywords) do -- spin through the keywords table
for _, keyword in ipairs (keywords_t) do -- for each keyword
out_table[keyword] = k; -- create an entry in the output table where keyword is the key
end
end
return out_table;
end
local keywords_xlate = xlate_keywords (); -- the list of translated keywords
--[[----------------< M A K E _ K E Y W O R D S _ L I S T >---------------------
this function assembles, for parameter-value validation, the list of keywords appropriate to that parameter.
keywords_lists{}, is a table of tables from keywords{}
]]
local function make_keywords_list (keywords_lists)
local out_table = {}; -- output goes here
for _, keyword_list in ipairs (keywords_lists) do -- spin through keywords_lists{} and get a table of keywords
for _, keyword in ipairs (keyword_list) do -- spin through keyword_list{} and add each keyword, ...
table.insert (out_table, keyword); -- ... as plain text, to the output list
end
end
return out_table;
end
--[[----------------< K E Y W O R D S _ L I S T S >-----------------------------
this is a list of lists of valid keywords for the various parameters in [key].
Generally the keys in this table are the canonical en.wiki parameter names though
some are contrived because of use in multiple differently named parameters:
['yes_true_y'], ['id-access'].
The function make_keywords_list() extracts the individual keywords from the
appropriate list in keywords{}.
The lists in this table are used to validate the keyword assignment for the
parameters named in this table's keys.
]]
local keywords_lists = {
['yes_true_y'] = make_keywords_list ({keywords.affirmative}),
['contribution'] = make_keywords_list ({keywords.afterword, keywords.foreword, keywords.introduction, keywords.preface}),
['df'] = make_keywords_list ({keywords.dmy, keywords['dmy-all'], keywords.mdy, keywords['mdy-all'], keywords.ymd, keywords['ymd-all']}),
-- ['df'] = make_keywords_list ({keywords.dmy, keywords['dmy-all'], keywords.mdy, keywords['mdy-all'], keywords.ymd, keywords['ymd-all'], keywords.yMd, keywords['yMd-all']}), -- not supported at en.wiki
['mode'] = make_keywords_list ({keywords.cs1, keywords.cs2}),
['name-list-style'] = make_keywords_list ({keywords.amp, keywords['and'], keywords.vanc}),
['ref'] = make_keywords_list ({keywords.harv}), -- inverted check; |ref=harv no longer supported
['url-access'] = make_keywords_list ({keywords.subscription, keywords.limited, keywords.registration}),
['url-status'] = make_keywords_list ({keywords.dead, keywords.live, keywords.unfit, keywords.usurped, keywords['bot: unknown']}),
['id-access'] = make_keywords_list ({keywords.free}),
}
--[[---------------------< S T R I P M A R K E R S >----------------------------
Common pattern definition location for stripmarkers so that we don't have to go
hunting for them if (when) MediaWiki changes their form.
]]
local stripmarkers = {
['any'] = '\127[^\127]*UNIQ%-%-(%a+)%-[%a%d]+%-QINU[^\127]*\127', -- capture returns name of stripmarker
['math'] = '\127[^\127]*UNIQ%-%-math%-[%a%d]+%-QINU[^\127]*\127' -- math stripmarkers used in coins_cleanup() and coins_replace_math_stripmarker()
}
--[[------------< I N V I S I B L E _ C H A R A C T E R S >---------------------
This table holds non-printing or invisible characters indexed either by name or
by Unicode group. Values are decimal representations of UTF-8 codes. The table
is organized as a table of tables because the Lua pairs keyword returns table
data in an arbitrary order. Here, we want to process the table from top to bottom
because the entries at the top of the table are also found in the ranges specified
by the entries at the bottom of the table.
Also here is a pattern that recognizes stripmarkers that begin and end with the
delete characters. The nowiki stripmarker is not an error but some others are
because the parameter values that include them become part of the template's
metadata before stripmarker replacement.
]]
local invisible_defs = {
del = '\127', -- used to distinguish between stripmarker and del char
zwj = '\226\128\141', -- used with capture because zwj may be allowed
}
local invisible_chars = {
{'replacement', '\239\191\189'}, -- U+FFFD, EF BF BD
{'zero width joiner', '('.. invisible_defs.zwj .. ')'}, -- U+200D, E2 80 8D; capture because zwj may be allowed
{'zero width space', '\226\128\139'}, -- U+200B, E2 80 8B
{'hair space', '\226\128\138'}, -- U+200A, E2 80 8A
{'soft hyphen', '\194\173'}, -- U+00AD, C2 AD
{'horizontal tab', '\009'}, -- U+0009 (HT), 09
{'line feed', '\010'}, -- U+000A (LF), 0A
{'no-break space', '\194\160'}, -- U+00A0 (NBSP), C2 A0
{'carriage return', '\013'}, -- U+000D (CR), 0D
{'stripmarker', stripmarkers.any}, -- stripmarker; may or may not be an error; capture returns the stripmaker type
{'delete', '('.. invisible_defs.del .. ')'}, -- U+007F (DEL), 7F; must be done after stripmarker test; capture to distinguish isolated del chars not part of stripmarker
{'C0 control', '[\000-\008\011\012\014-\031]'}, -- U+0000–U+001F (NULL–US), 00–1F (except HT, LF, CR (09, 0A, 0D))
{'C1 control', '[\194\128-\194\159]'}, -- U+0080–U+009F (XXX–APC), C2 80 – C2 9F
-- {'Specials', '[\239\191\185-\239\191\191]'}, -- U+FFF9-U+FFFF, EF BF B9 – EF BF BF
-- {'Private use area', '[\238\128\128-\239\163\191]'}, -- U+E000–U+F8FF, EE 80 80 – EF A3 BF
-- {'Supplementary Private Use Area-A', '[\243\176\128\128-\243\191\191\189]'}, -- U+F0000–U+FFFFD, F3 B0 80 80 – F3 BF BF BD
-- {'Supplementary Private Use Area-B', '[\244\128\128\128-\244\143\191\189]'}, -- U+100000–U+10FFFD, F4 80 80 80 – F4 8F BF BD
}
--[[
Indic script makes use of zero width joiner as a character modifier so zwj
characters must be left in. This pattern covers all of the unicode characters
for these languages:
Devanagari 0900–097F – https://unicode.org/charts/PDF/U0900.pdf
Devanagari extended A8E0–A8FF – https://unicode.org/charts/PDF/UA8E0.pdf
Bengali 0980–09FF – https://unicode.org/charts/PDF/U0980.pdf
Gurmukhi 0A00–0A7F – https://unicode.org/charts/PDF/U0A00.pdf
Gujarati 0A80–0AFF – https://unicode.org/charts/PDF/U0A80.pdf
Oriya 0B00–0B7F – https://unicode.org/charts/PDF/U0B00.pdf
Tamil 0B80–0BFF – https://unicode.org/charts/PDF/U0B80.pdf
Telugu 0C00–0C7F – https://unicode.org/charts/PDF/U0C00.pdf
Kannada 0C80–0CFF – https://unicode.org/charts/PDF/U0C80.pdf
Malayalam 0D00–0D7F – https://unicode.org/charts/PDF/U0D00.pdf
plus the not-necessarily Indic scripts for Sinhala and Burmese:
Sinhala 0D80-0DFF - https://unicode.org/charts/PDF/U0D80.pdf
Myanmar 1000-109F - https://unicode.org/charts/PDF/U1000.pdf
Myanmar extended A AA60-AA7F - https://unicode.org/charts/PDF/UAA60.pdf
Myanmar extended B A9E0-A9FF - https://unicode.org/charts/PDF/UA9E0.pdf
the pattern is used by has_invisible_chars() and coins_cleanup()
]]
local indic_script = '[\224\164\128-\224\181\191\224\163\160-\224\183\191\225\128\128-\225\130\159\234\167\160-\234\167\191\234\169\160-\234\169\191]';
-- list of emoji that use a zwj character (U+200D) to combine with another emoji
-- from: https://unicode.org/Public/emoji/15.0/emoji-zwj-sequences.txt; version: 15.0; 2022-05-06
-- table created by: [[:en:Module:Make emoji zwj table]]
local emoji_t = { -- indexes are decimal forms of the hex values in U+xxxx
[9760] = true, -- U+2620 ☠ skull and crossbones
[9792] = true, -- U+2640 ♀ female sign
[9794] = true, -- U+2642 ♂ male sign
[9877] = true, -- U+2695 ⚕ staff of aesculapius
[9878] = true, -- U+2696 ⚖ scales
[9895] = true, -- U+26A7 ⚧ male with stroke and male and female sign
[9992] = true, -- U+2708 ✈ airplane
[10052] = true, -- U+2744 ❄ snowflake
[10084] = true, -- U+2764 ❤ heavy black heart
[11035] = true, -- U+2B1B ⬛ black large square
[127752] = true, -- U+1F308 🌈 rainbow
[127787] = true, -- U+1F32B 🌫 fog
[127806] = true, -- U+1F33E 🌾 ear of rice
[127859] = true, -- U+1F373 🍳 cooking
[127868] = true, -- U+1F37C 🍼 baby bottle
[127876] = true, -- U+1F384 🎄 christmas tree
[127891] = true, -- U+1F393 🎓 graduation cap
[127908] = true, -- U+1F3A4 🎤 microphone
[127912] = true, -- U+1F3A8 🎨 artist palette
[127979] = true, -- U+1F3EB 🏫 school
[127981] = true, -- U+1F3ED 🏭 factory
[128102] = true, -- U+1F466 👦 boy
[128103] = true, -- U+1F467 👧 girl
[128104] = true, -- U+1F468 👨 man
[128105] = true, -- U+1F469 👩 woman
[128139] = true, -- U+1F48B 💋 kiss mark
[128168] = true, -- U+1F4A8 💨 dash symbol
[128171] = true, -- U+1F4AB 💫 dizzy symbol
[128187] = true, -- U+1F4BB 💻 personal computer
[128188] = true, -- U+1F4BC 💼 brief case
[128293] = true, -- U+1F525 🔥 fire
[128295] = true, -- U+1F527 🔧 wrench
[128300] = true, -- U+1F52C 🔬 microscope
[128488] = true, -- U+1F5E8 🗨 left speech bubble
[128640] = true, -- U+1F680 🚀 rocket
[128658] = true, -- U+1F692 🚒 fire engine
[129309] = true, -- U+1F91D 🤝 handshake
[129455] = true, -- U+1F9AF 🦯 probing cane
[129456] = true, -- U+1F9B0 🦰 emoji component red hair
[129457] = true, -- U+1F9B1 🦱 emoji component curly hair
[129458] = true, -- U+1F9B2 🦲 emoji component bald
[129459] = true, -- U+1F9B3 🦳 emoji component white hair
[129466] = true, -- U+1F9BA 🦺 safety vest
[129468] = true, -- U+1F9BC 🦼 motorized wheelchair
[129469] = true, -- U+1F9BD 🦽 manual wheelchair
[129489] = true, -- U+1F9D1 🧑 adult
[129657] = true, -- U+1FA79 🩹 adhesive bandage
[129778] = true, -- U+1FAF2 🫲 leftwards hand
}
--[[----------------------< L A N G U A G E S U P P O R T >-------------------
These tables and constants support various language-specific functionality.
]]
--local this_wiki_code = mw.getContentLanguage():getCode(); -- get this wiki's language code
local this_wiki_code = lang_obj:getCode(); -- get this wiki's language code
if string.match (mw.site.server, 'wikidata') then
this_wiki_code = mw.getCurrentFrame():preprocess('{{int:lang}}'); -- on Wikidata so use interface language setting instead
end
local mw_languages_by_tag_t = mw.language.fetchLanguageNames (this_wiki_code, 'all'); -- get a table of language tag/name pairs known to Wikimedia; used for interwiki tests
local mw_languages_by_name_t = {};
for k, v in pairs (mw_languages_by_tag_t) do -- build a 'reversed' table name/tag language pairs know to MediaWiki; used for |language=
v = mw.ustring.lower (v); -- lowercase for tag fetch; get name's proper case from mw_languages_by_tag_t[<tag>]
if mw_languages_by_name_t[v] then -- when name already in the table
if 2 == #k or 3 == #k then -- if tag does not have subtags
mw_languages_by_name_t[v] = k; -- prefer the shortest tag for this name
end
else -- here when name not in the table
mw_languages_by_name_t[v] = k; -- so add name and matching tag
end
end
local inter_wiki_map = {}; -- map of interwiki prefixes that are language-code prefixes
for k, v in pairs (mw.site.interwikiMap ('local')) do -- spin through the base interwiki map (limited to local)
if mw_languages_by_tag_t[v["prefix"]] then -- if the prefix matches a known language tag
inter_wiki_map[v["prefix"]] = true; -- add it to our local map
end
end
--[[--------------------< S C R I P T _ L A N G _ C O D E S >-------------------
This table is used to hold ISO 639-1 two-character and ISO 639-3 three-character
language codes that apply only to |script-title= and |script-chapter=
]]
local script_lang_codes = {
'ab', 'am', 'ar', 'be', 'bg', 'bn', 'bo', 'bs', 'dv', 'dz', 'el', 'fa', 'gu',
'he', 'hi', 'hy', 'ja', 'ka', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'lo', 'mk',
'ml', 'mn', 'mr', 'my', 'ne', 'or', 'ota', 'pa', 'ps', 'ru', 'sd', 'si', 'sr',
'syc', 'ta', 'te', 'tg', 'th', 'ti', 'tt', 'ug', 'uk', 'ur', 'uz', 'yi', 'yue', 'zh'
};
--[[---------------< L A N G U A G E R E M A P P I N G >----------------------
These tables hold language information that is different (correct) from MediaWiki's definitions
For each ['code'] = 'language name' in lang_code_remap{} there must be a matching ['language name'] = {'language name', 'code'} in lang_name_remap{}
lang_code_remap{}:
key is always lowercase ISO 639-1, -2, -3 language code or a valid lowercase IETF language tag
value is properly spelled and capitalized language name associated with key
only one language name per key;
key/value pair must have matching entry in lang_name_remap{}
lang_name_remap{}:
key is always lowercase language name
value is a table the holds correctly spelled and capitalized language name [1] and associated code [2] (code must match a code key in lang_code_remap{})
may have multiple keys referring to a common preferred name and code; For example:
['kolsch'] and ['kölsch'] both refer to 'Kölsch' and 'ksh'
]]
local lang_code_remap = { -- used for |language= and |script-title= / |script-chapter=
['als'] = 'Tosk Albanian', -- MediaWiki returns Alemannisch
['bh'] = 'Bihari', -- MediaWiki uses 'bh' as a subdomain name for Bhojpuri Wikipedia: bh.wikipedia.org
['bla'] = 'Blackfoot', -- MediaWiki/IANA/ISO 639: Siksika; use en.wiki preferred name
['bn'] = 'Bengali', -- MediaWiki returns Bangla
['ca-valencia'] = 'Valencian', -- IETF variant of Catalan
['ilo'] = 'Ilocano', -- MediaWiki/IANA/ISO 639: Iloko; use en.wiki preferred name
['ksh'] = 'Kölsch', -- MediaWiki: Colognian; use IANA/ISO 639 preferred name
['ksh-x-colog'] = 'Colognian', -- override MediaWiki ksh; no IANA/ISO 639 code for Colognian; IETF private code created at Module:Lang/data
['mis-x-ripuar'] = 'Ripuarian', -- override MediaWiki ksh; no IANA/ISO 639 code for Ripuarian; IETF private code created at Module:Lang/data
['nan-tw'] = 'Taiwanese Hokkien', -- make room for MediaWiki/IANA/ISO 639 nan: Min Nan Chinese and support en.wiki preferred name
}
local lang_name_remap = { -- used for |language=; names require proper capitalization; tags must be lowercase
['alemannisch'] = {'Swiss German', 'gsw'}, -- not an ISO or IANA language name; MediaWiki uses 'als' as a subdomain name for Alemannic Wikipedia: als.wikipedia.org
['bangla'] = {'Bengali', 'bn'}, -- MediaWiki returns Bangla (the endonym) but we want Bengali (the exonym); here we remap
['bengali'] = {'Bengali', 'bn'}, -- MediaWiki doesn't use exonym so here we provide correct language name and 639-1 code
['bhojpuri'] = {'Bhojpuri', 'bho'}, -- MediaWiki uses 'bh' as a subdomain name for Bhojpuri Wikipedia: bh.wikipedia.org
['bihari'] = {'Bihari', 'bh'}, -- MediaWiki replaces 'Bihari' with 'Bhojpuri' so 'Bihari' cannot be found
['blackfoot'] = {'Blackfoot', 'bla'}, -- MediaWiki/IANA/ISO 639: Siksika; use en.wiki preferred name
['colognian'] = {'Colognian', 'ksh-x-colog'}, -- MediaWiki preferred name for ksh
['ilocano'] = {'Ilocano', 'ilo'}, -- MediaWiki/IANA/ISO 639: Iloko; use en.wiki preferred name
['kolsch'] = {'Kölsch', 'ksh'}, -- use IANA/ISO 639 preferred name (use non-diacritical o instead of umlaut ö)
['kölsch'] = {'Kölsch', 'ksh'}, -- use IANA/ISO 639 preferred name
['ripuarian'] = {'Ripuarian', 'mis-x-ripuar'}, -- group of dialects; no code in MediaWiki or in IANA/ISO 639
['taiwanese hokkien'] = {'Taiwanese Hokkien', 'nan-tw'}, -- make room for MediaWiki/IANA/ISO 639 nan: Min Nan Chinese
['tosk albanian'] = {'Tosk Albanian', 'als'}, -- MediaWiki replaces 'Tosk Albanian' with 'Alemannisch' so 'Tosk Albanian' cannot be found
['valencian'] = {'Valencian', 'ca-valencia'}, -- variant of Catalan; categorizes as Valencian
}
--[[---------------< P R O P E R T I E S _ C A T E G O R I E S >----------------
Properties categories. These are used for investigating qualities of citations.
]]
local prop_cats = {
['foreign-lang-source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is foreign-language name, $2 is ISO639-1 code
['foreign-lang-source-2'] = 'CS1 foreign language sources (ISO 639-2)|$1', -- |language= category; a cat for ISO639-2 languages; $1 is the ISO 639-2 code used as a sort key
['jul-greg-uncertainty'] = 'CS1: Julian–Gregorian uncertainty', -- probably temporary cat to identify scope of template with dates 1 October 1582 – 1 January 1926
['local-lang-source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is local-language name, $2 is ISO639-1 code; not emitted when local_lang_cat_enable is false
['location-test'] = 'CS1 location test',
['long-vol'] = 'CS1: long volume value', -- probably temporary cat to identify scope of |volume= values longer than 4 characters
['script'] = 'CS1 uses $1-language script ($2)', -- |script-title=xx: has matching category; $1 is language name, $2 is ISO639-1 code
['tracked-param'] = 'CS1 tracked parameter: $1', -- $1 is base (enumerators removed) parameter name
['year-range-abbreviated'] = 'CS1: abbreviated year range', -- probably temporary cat to identify scope of |date=, |year= values using YYYY–YY form
}
--[[-------------------< T I T L E _ T Y P E S >--------------------------------
Here we map a template's CitationClass to TitleType (default values for |type= parameter)
]]
local title_types = {
['AV-media-notes'] = 'Media notes',
['interview'] = 'Interview',
['mailinglist'] = 'Mailing list',
['map'] = 'Map',
['podcast'] = 'Podcast',
['pressrelease'] = 'Press release',
['report'] = 'Report',
['speech'] = 'Speech',
['techreport'] = 'Technical report',
['thesis'] = 'Thesis',
}
--[[===================<< E R R O R M E S S A G I N G >>======================
]]
--[[----------< E R R O R M E S S A G E S U P P L I M E N T S >-------------
I18N for those messages that are supplemented with additional specific text that
describes the reason for the error
TODO: merge this with special_case_translations{}?
]]
local err_msg_supl = {
['char'] = 'invalid character', -- |isbn=, |sbn=
['check'] = 'checksum', -- |isbn=, |sbn=
['flag'] = 'flag', -- |archive-url=
['form'] = 'invalid form', -- |isbn=, |sbn=
['group'] = 'invalid group id', -- |isbn=
['initials'] = 'initials', -- Vancouver
['invalid language code'] = 'invalid language code', -- |script-<param>=
['journal'] = 'journal', -- |bibcode=
['length'] = 'length', -- |isbn=, |bibcode=, |sbn=
['liveweb'] = 'liveweb', -- |archive-url=
['missing comma'] = 'missing comma', -- Vancouver
['missing prefix'] = 'missing prefix', -- |script-<param>=
['missing title part'] = 'missing title part', -- |script-<param>=
['name'] = 'name', -- Vancouver
['non-Latin char'] = 'non-Latin character', -- Vancouver
['path'] = 'path', -- |archive-url=
['prefix'] = 'invalid prefix', -- |isbn=
['punctuation'] = 'punctuation', -- Vancouver
['save'] = 'save command', -- |archive-url=
['suffix'] = 'suffix', -- Vancouver
['timestamp'] = 'timestamp', -- |archive-url=
['unknown language code'] = 'unknown language code', -- |script-<param>=
['value'] = 'value', -- |bibcode=
['year'] = 'year', -- |bibcode=
}
--[[--------------< E R R O R _ C O N D I T I O N S >---------------------------
Error condition table. This table has two sections: errors at the top, maintenance
at the bottom. Maint 'messaging' does not have a 'message' (message=nil)
The following contains a list of IDs for various error conditions defined in the
code. For each ID, we specify a text message to display, an error category to
include, and whether the error message should be wrapped as a hidden comment.
Anchor changes require identical changes to matching anchor in Help:CS1 errors
TODO: rename error_conditions{} to something more generic; create separate error
and maint tables inside that?
]]
local error_conditions = {
err_accessdate_missing_url = {
message = '<code class="cs1-code">|access-date=</code> requires <code class="cs1-code">|url=</code>',
anchor = 'accessdate_missing_url',
category = 'CS1 errors: access-date without URL',
hidden = false
},
err_apostrophe_markup = {
message = 'Italic or bold markup not allowed in: <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'apostrophe_markup',
category = 'CS1 errors: markup',
hidden = false
},
err_archive_missing_date = {
message = '<code class="cs1-code">|archive-url=</code> requires <code class="cs1-code">|archive-date=</code>',
anchor = 'archive_missing_date',
category = 'CS1 errors: archive-url',
hidden = false
},
err_archive_missing_url = {
message = '<code class="cs1-code">|archive-url=</code> requires <code class="cs1-code">|url=</code>',
anchor = 'archive_missing_url',
category = 'CS1 errors: archive-url',
hidden = false
},
err_archive_url = {
message = '<code class="cs1-code">|archive-url=</code> is malformed: $1', -- $1 is error message detail
anchor = 'archive_url',
category = 'CS1 errors: archive-url',
hidden = false
},
err_arxiv_missing = {
message = '<code class="cs1-code">|arxiv=</code> required',
anchor = 'arxiv_missing',
category = 'CS1 errors: arXiv', -- same as bad arxiv
hidden = false
},
err_asintld_missing_asin = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|asin=</code>', -- $1 is parameter name
anchor = 'asintld_missing_asin',
category = 'CS1 errors: ASIN TLD',
hidden = false
},
err_bad_arxiv = {
message = 'Check <code class="cs1-code">|arxiv=</code> value',
anchor = 'bad_arxiv',
category = 'CS1 errors: arXiv',
hidden = false
},
err_bad_asin = {
message = 'Check <code class="cs1-code">|asin=</code> value',
anchor = 'bad_asin',
category ='CS1 errors: ASIN',
hidden = false
},
err_bad_asin_tld = {
message = 'Check <code class="cs1-code">|asin-tld=</code> value',
anchor = 'bad_asin_tld',
category ='CS1 errors: ASIN TLD',
hidden = false
},
err_bad_bibcode = {
message = 'Check <code class="cs1-code">|bibcode=</code> $1', -- $1 is error message detail
anchor = 'bad_bibcode',
category = 'CS1 errors: bibcode',
hidden = false
},
err_bad_biorxiv = {
message = 'Check <code class="cs1-code">|biorxiv=</code> value',
anchor = 'bad_biorxiv',
category = 'CS1 errors: bioRxiv',
hidden = false
},
err_bad_citeseerx = {
message = 'Check <code class="cs1-code">|citeseerx=</code> value',
anchor = 'bad_citeseerx',
category = 'CS1 errors: citeseerx',
hidden = false
},
err_bad_date = {
message = 'Check date values in: $1', -- $1 is a parameter name list
anchor = 'bad_date',
category = 'CS1 errors: dates',
hidden = false
},
err_bad_doi = {
message = 'Check <code class="cs1-code">|doi=</code> value',
anchor = 'bad_doi',
category = 'CS1 errors: DOI',
hidden = false
},
err_bad_hdl = {
message = 'Check <code class="cs1-code">|hdl=</code> value',
anchor = 'bad_hdl',
category = 'CS1 errors: HDL',
hidden = false
},
err_bad_isbn = {
message = 'Check <code class="cs1-code">|isbn=</code> value: $1', -- $1 is error message detail
anchor = 'bad_isbn',
category = 'CS1 errors: ISBN',
hidden = false
},
err_bad_ismn = {
message = 'Check <code class="cs1-code">|ismn=</code> value',
anchor = 'bad_ismn',
category = 'CS1 errors: ISMN',
hidden = false
},
err_bad_issn = {
message = 'Check <code class="cs1-code">|$1issn=</code> value', -- $1 is 'e' or '' for eissn or issn
anchor = 'bad_issn',
category = 'CS1 errors: ISSN',
hidden = false
},
err_bad_jfm = {
message = 'Check <code class="cs1-code">|jfm=</code> value',
anchor = 'bad_jfm',
category = 'CS1 errors: JFM',
hidden = false
},
err_bad_jstor = {
message = 'Check <code class="cs1-code">|jstor=</code> value',
anchor = 'bad_jstor',
category = 'CS1 errors: JSTOR',
hidden = false
},
err_bad_lccn = {
message = 'Check <code class="cs1-code">|lccn=</code> value',
anchor = 'bad_lccn',
category = 'CS1 errors: LCCN',
hidden = false
},
err_bad_mr = {
message = 'Check <code class="cs1-code">|mr=</code> value',
anchor = 'bad_mr',
category = 'CS1 errors: MR',
hidden = false
},
err_bad_oclc = {
message = 'Check <code class="cs1-code">|oclc=</code> value',
anchor = 'bad_oclc',
category = 'CS1 errors: OCLC',
hidden = false
},
err_bad_ol = {
message = 'Check <code class="cs1-code">|ol=</code> value',
anchor = 'bad_ol',
category = 'CS1 errors: OL',
hidden = false
},
err_bad_osti = {
message = 'Check <code class="cs1-code">|osti=</code> value',
anchor = 'bad_osti',
category = 'CS1 errors: OSTI',
hidden = false
},
err_bad_paramlink = { -- for |title-link=, |author/editor/translator-link=, |series-link=, |episode-link=
message = 'Check <code class="cs1-code">|$1=</code> value', -- $1 is parameter name
anchor = 'bad_paramlink',
category = 'CS1 errors: parameter link',
hidden = false
},
err_bad_pmc = {
message = 'Check <code class="cs1-code">|pmc=</code> value',
anchor = 'bad_pmc',
category = 'CS1 errors: PMC',
hidden = false
},
err_bad_pmid = {
message = 'Check <code class="cs1-code">|pmid=</code> value',
anchor = 'bad_pmid',
category = 'CS1 errors: PMID',
hidden = false
},
err_bad_rfc = {
message = 'Check <code class="cs1-code">|rfc=</code> value',
anchor = 'bad_rfc',
category = 'CS1 errors: RFC',
hidden = false
},
err_bad_s2cid = {
message = 'Check <code class="cs1-code">|s2cid=</code> value',
anchor = 'bad_s2cid',
category = 'CS1 errors: S2CID',
hidden = false
},
err_bad_sbn = {
message = 'Check <code class="cs1-code">|sbn=</code> value: $1', -- $1 is error message detail
anchor = 'bad_sbn',
category = 'CS1 errors: SBN',
hidden = false
},
err_bad_ssrn = {
message = 'Check <code class="cs1-code">|ssrn=</code> value',
anchor = 'bad_ssrn',
category = 'CS1 errors: SSRN',
hidden = false
},
err_bad_url = {
message = 'Check $1 value', -- $1 is parameter name
anchor = 'bad_url',
category = 'CS1 errors: URL',
hidden = false
},
err_bad_usenet_id = {
message = 'Check <code class="cs1-code">|message-id=</code> value',
anchor = 'bad_message_id',
category = 'CS1 errors: message-id',
hidden = false
},
err_bad_zbl = {
message = 'Check <code class="cs1-code">|zbl=</code> value',
anchor = 'bad_zbl',
category = 'CS1 errors: Zbl',
hidden = false
},
err_bare_url_missing_title = {
message = '$1 missing title', -- $1 is parameter name
anchor = 'bare_url_missing_title',
category = 'CS1 errors: bare URL',
hidden = false
},
err_biorxiv_missing = {
message = '<code class="cs1-code">|biorxiv=</code> required',
anchor = 'biorxiv_missing',
category = 'CS1 errors: bioRxiv', -- same as bad bioRxiv
hidden = false
},
err_chapter_ignored = {
message = '<code class="cs1-code">|$1=</code> ignored', -- $1 is parameter name
anchor = 'chapter_ignored',
category = 'CS1 errors: chapter ignored',
hidden = false
},
err_citation_missing_title = {
message = 'Missing or empty <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'citation_missing_title',
category = 'CS1 errors: missing title',
hidden = false
},
err_citeseerx_missing = {
message = '<code class="cs1-code">|citeseerx=</code> required',
anchor = 'citeseerx_missing',
category = 'CS1 errors: citeseerx', -- same as bad citeseerx
hidden = false
},
err_cite_web_url = { -- this error applies to cite web and to cite podcast
message = 'Missing or empty <code class="cs1-code">|url=</code>',
anchor = 'cite_web_url',
category = 'CS1 errors: requires URL',
hidden = false
},
err_class_ignored = {
message = '<code class="cs1-code">|class=</code> ignored',
anchor = 'class_ignored',
category = 'CS1 errors: class',
hidden = false
},
err_contributor_ignored = {
message = '<code class="cs1-code">|contributor=</code> ignored',
anchor = 'contributor_ignored',
category = 'CS1 errors: contributor',
hidden = false
},
err_contributor_missing_required_param = {
message = '<code class="cs1-code">|contributor=</code> requires <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'contributor_missing_required_param',
category = 'CS1 errors: contributor',
hidden = false
},
err_deprecated_params = {
message = 'Cite uses deprecated parameter <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'deprecated_params',
category = 'CS1 errors: deprecated parameters',
hidden = false
},
err_disp_name = {
message = 'Invalid <code class="cs1-code">|$1=$2</code>', -- $1 is parameter name; $2 is the assigned value
anchor = 'disp_name',
category = 'CS1 errors: display-names',
hidden = false,
},
err_doibroken_missing_doi = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|doi=</code>', -- $1 is parameter name
anchor = 'doibroken_missing_doi',
category = 'CS1 errors: DOI',
hidden = false
},
err_embargo_missing_pmc = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|pmc=</code>', -- $1 is parameter name
anchor = 'embargo_missing_pmc',
category = 'CS1 errors: PMC embargo',
hidden = false
},
err_empty_citation = {
message = 'Empty citation',
anchor = 'empty_citation',
category = 'CS1 errors: empty citation',
hidden = false
},
err_etal = {
message = 'Explicit use of et al. in: <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'explicit_et_al',
category = 'CS1 errors: explicit use of et al.',
hidden = false
},
err_extra_text_edition = {
message = '<code class="cs1-code">|edition=</code> has extra text',
anchor = 'extra_text_edition',
category = 'CS1 errors: extra text: edition',
hidden = false,
},
err_extra_text_issue = {
message = '<code class="cs1-code">|$1=</code> has extra text', -- $1 is parameter name
anchor = 'extra_text_issue',
category = 'CS1 errors: extra text: issue',
hidden = false,
},
err_extra_text_pages = {
message = '<code class="cs1-code">|$1=</code> has extra text', -- $1 is parameter name
anchor = 'extra_text_pages',
category = 'CS1 errors: extra text: pages',
hidden = false,
},
err_extra_text_volume = {
message = '<code class="cs1-code">|$1=</code> has extra text', -- $1 is parameter name
anchor = 'extra_text_volume',
category = 'CS1 errors: extra text: volume',
hidden = true,
},
err_first_missing_last = {
message = '<code class="cs1-code">|$1=</code> missing <code class="cs1-code">|$2=</code>', -- $1 is first alias, $2 is matching last alias
anchor = 'first_missing_last',
category = 'CS1 errors: missing name', -- author, contributor, editor, interviewer, translator
hidden = false
},
err_format_missing_url = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|$2=</code>', -- $1 is format parameter $2 is url parameter
anchor = 'format_missing_url',
category = 'CS1 errors: format without URL',
hidden = false
},
err_generic_name = {
message = '<code class="cs1-code">|$1=</code> has generic name', -- $1 is parameter name
anchor = 'generic_name',
category = 'CS1 errors: generic name',
hidden = false,
},
err_generic_title = {
message = 'Cite uses generic title',
anchor = 'generic_title',
category = 'CS1 errors: generic title',
hidden = false,
},
err_invalid_param_val = {
message = 'Invalid <code class="cs1-code">|$1=$2</code>', -- $1 is parameter name $2 is parameter value
anchor = 'invalid_param_val',
category = 'CS1 errors: invalid parameter value',
hidden = false
},
err_invisible_char = {
message = '$1 in $2 at position $3', -- $1 is invisible char $2 is parameter name $3 is position number
anchor = 'invisible_char',
category = 'CS1 errors: invisible characters',
hidden = false
},
err_missing_name = {
message = 'Missing <code class="cs1-code">|$1$2=</code>', -- $1 is modified NameList; $2 is enumerator
anchor = 'missing_name',
category = 'CS1 errors: missing name', -- author, contributor, editor, interviewer, translator
hidden = false
},
err_missing_periodical = {
message = 'Cite $1 requires <code class="cs1-code">|$2=</code>', -- $1 is cs1 template name; $2 is canonical periodical parameter name for cite $1
anchor = 'missing_periodical',
category = 'CS1 errors: missing periodical',
hidden = true
},
err_missing_pipe = {
message = 'Missing pipe in: <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'missing_pipe',
category = 'CS1 errors: missing pipe',
hidden = false
},
err_param_access_requires_param = {
message = '<code class="cs1-code">|$1-access=</code> requires <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'param_access_requires_param',
category = 'CS1 errors: param-access',
hidden = false
},
err_param_has_ext_link = {
message = 'External link in <code class="cs1-code">$1</code>', -- $1 is parameter name
anchor = 'param_has_ext_link',
category = 'CS1 errors: external links',
hidden = false
},
err_parameter_ignored = {
message = 'Unknown parameter <code class="cs1-code">|$1=</code> ignored', -- $1 is parameter name
anchor = 'parameter_ignored',
category = 'CS1 errors: unsupported parameter',
hidden = false
},
err_parameter_ignored_suggest = {
message = 'Unknown parameter <code class="cs1-code">|$1=</code> ignored (<code class="cs1-code">|$2=</code> suggested)', -- $1 is unknown parameter $2 is suggested parameter name
anchor = 'parameter_ignored_suggest',
category = 'CS1 errors: unsupported parameter',
hidden = false
},
err_redundant_parameters = {
message = 'More than one of $1 specified', -- $1 is error message detail
anchor = 'redundant_parameters',
category = 'CS1 errors: redundant parameter',
hidden = false
},
err_script_parameter = {
message = 'Invalid <code class="cs1-code">|$1=</code>: $2', -- $1 is parameter name $2 is script language code or error detail
anchor = 'script_parameter',
category = 'CS1 errors: script parameters',
hidden = false
},
err_ssrn_missing = {
message = '<code class="cs1-code">|ssrn=</code> required',
anchor = 'ssrn_missing',
category = 'CS1 errors: SSRN', -- same as bad arxiv
hidden = false
},
err_text_ignored = {
message = 'Text "$1" ignored', -- $1 is ignored text
anchor = 'text_ignored',
category = 'CS1 errors: unrecognized parameter',
hidden = false
},
err_trans_missing_title = {
message = '<code class="cs1-code">|trans-$1=</code> requires <code class="cs1-code">|$1=</code> or <code class="cs1-code">|script-$1=</code>', -- $1 is base parameter name
anchor = 'trans_missing_title',
category = 'CS1 errors: translated title',
hidden = false
},
err_param_unknown_empty = {
message = 'Cite has empty unknown parameter$1: $2', -- $1 is 's' or empty space; $2 is empty unknown param list
anchor = 'param_unknown_empty',
category = 'CS1 errors: empty unknown parameters',
hidden = false
},
err_vancouver = {
message = 'Vancouver style error: $1 in name $2', -- $1 is error detail, $2 is the nth name
anchor = 'vancouver',
category = 'CS1 errors: Vancouver style',
hidden = false
},
err_wikilink_in_url = {
message = 'URL–wikilink conflict', -- uses ndash
anchor = 'wikilink_in_url',
category = 'CS1 errors: URL–wikilink conflict', -- uses ndash
hidden = false
},
--[[--------------------------< M A I N T >-------------------------------------
maint messages do not have a message (message = nil); otherwise the structure
is the same as error messages
]]
maint_archived_copy = {
message = nil,
anchor = 'archived_copy',
category = 'CS1 maint: archived copy as title',
hidden = true,
},
maint_authors = {
message = nil,
anchor = 'authors',
category = 'CS1 maint: uses authors parameter',
hidden = true,
},
maint_bot_unknown = {
message = nil,
anchor = 'bot:_unknown',
category = 'CS1 maint: bot: original URL status unknown',
hidden = true,
},
maint_date_auto_xlated = { -- date auto-translation not supported by en.wiki
message = nil,
anchor = 'date_auto_xlated',
category = 'CS1 maint: date auto-translated',
hidden = true,
},
maint_date_format = {
message = nil,
anchor = 'date_format',
category = 'CS1 maint: date format',
hidden = true,
},
maint_date_year = {
message = nil,
anchor = 'date_year',
category = 'CS1 maint: date and year',
hidden = true,
},
maint_doi_ignore = {
message = nil,
anchor = 'doi_ignore',
category = 'CS1 maint: ignored DOI errors',
hidden = true,
},
maint_doi_inactive = {
message = nil,
anchor = 'doi_inactive',
category = 'CS1 maint: DOI inactive',
hidden = true,
},
maint_doi_inactive_dated = {
message = nil,
anchor = 'doi_inactive_dated',
category = 'CS1 maint: DOI inactive as of $2$3$1', -- $1 is year, $2 is month-name or empty string, $3 is space or empty string
hidden = true,
},
maint_extra_punct = {
message = nil,
anchor = 'extra_punct',
category = 'CS1 maint: extra punctuation',
hidden = true,
},
maint_isbn_ignore = {
message = nil,
anchor = 'ignore_isbn_err',
category = 'CS1 maint: ignored ISBN errors',
hidden = true,
},
maint_issn_ignore = {
message = nil,
anchor = 'ignore_issn',
category = 'CS1 maint: ignored ISSN errors',
hidden = true,
},
maint_jfm_format = {
message = nil,
anchor = 'jfm_format',
category = 'CS1 maint: JFM format',
hidden = true,
},
maint_location = {
message = nil,
anchor = 'location',
category = 'CS1 maint: location',
hidden = true,
},
maint_mr_format = {
message = nil,
anchor = 'mr_format',
category = 'CS1 maint: MR format',
hidden = true,
},
maint_mult_names = {
message = nil,
anchor = 'mult_names',
category = 'CS1 maint: multiple names: $1', -- $1 is '<name>s list'; gets value from special_case_translation table
hidden = true,
},
maint_numeric_names = {
message = nil,
anchor = 'numeric_names',
category = 'CS1 maint: numeric names: $1', -- $1 is '<name>s list'; gets value from special_case_translation table
hidden = true,
},
maint_others = {
message = nil,
anchor = 'others',
category = 'CS1 maint: others',
hidden = true,
},
maint_others_avm = {
message = nil,
anchor = 'others_avm',
category = 'CS1 maint: others in cite AV media (notes)',
hidden = true,
},
maint_pmc_embargo = {
message = nil,
anchor = 'embargo',
category = 'CS1 maint: PMC embargo expired',
hidden = true,
},
maint_pmc_format = {
message = nil,
anchor = 'pmc_format',
category = 'CS1 maint: PMC format',
hidden = true,
},
maint_postscript = {
message = nil,
anchor = 'postscript',
category = 'CS1 maint: postscript',
hidden = true,
},
maint_ref_duplicates_default = {
message = nil,
anchor = 'ref_default',
category = 'CS1 maint: ref duplicates default',
hidden = true,
},
maint_unfit = {
message = nil,
anchor = 'unfit',
category = 'CS1 maint: unfit URL',
hidden = true,
},
maint_unknown_lang = {
message = nil,
anchor = 'unknown_lang',
category = 'CS1 maint: unrecognized language',
hidden = true,
},
maint_untitled = {
message = nil,
anchor = 'untitled',
category = 'CS1 maint: untitled periodical',
hidden = true,
},
maint_url_status = {
message = nil,
anchor = 'url_status',
category = 'CS1 maint: url-status',
hidden = true,
},
maint_zbl = {
message = nil,
anchor = 'zbl',
category = 'CS1 maint: Zbl',
hidden = true,
},
}
--[[--------------------------< I D _ H A N D L E R S >--------------------------------------------------------
The following contains a list of values for various defined identifiers. For each
identifier we specify a variety of information necessary to properly render the
identifier in the citation.
parameters: a list of parameter aliases for this identifier; first in the list is the canonical form
link: Wikipedia article name
redirect: a local redirect to a local Wikipedia article name; at en.wiki, 'ISBN (identifier)' is a redirect to 'International Standard Book Number'
q: Wikidata q number for the identifier
label: the label preceding the identifier; label is linked to a Wikipedia article (in this order):
redirect from id_handlers['<id>'].redirect when use_identifier_redirects is true
Wikidata-supplied article name for the local wiki from id_handlers['<id>'].q
local article name from id_handlers['<id>'].link
prefix: the first part of a URL that will be concatenated with a second part which usually contains the identifier
suffix: optional third part to be added after the identifier
encode: true if URI should be percent-encoded; otherwise false
COinS: identifier link or keyword for use in COinS:
for identifiers registered at info-uri.info use: info:.... where '...' is the appropriate identifier label
for identifiers that have COinS keywords, use the keyword: rft.isbn, rft.issn, rft.eissn
for |asin= and |ol=, which require assembly, use the keyword: url
for others make a URL using the value in prefix/suffix and #label, use the keyword: pre (not checked; any text other than 'info', 'rft', or 'url' works here)
set to nil to leave the identifier out of the COinS
separator: character or text between label and the identifier in the rendered citation
id_limit: for those identifiers with established limits, this property holds the upper limit
access: use this parameter to set the access level for all instances of this identifier.
the value must be a valid access level for an identifier (see ['id-access'] in this file).
custom_access: to enable custom access level for an identifier, set this parameter
to the parameter that should control it (normally 'id-access')
]]
local id_handlers = {
['ARXIV'] = {
parameters = {'arxiv', 'eprint'},
link = 'arXiv',
redirect = 'arXiv (identifier)',
q = 'Q118398',
label = 'arXiv',
prefix = 'https://arxiv.org/abs/', -- protocol-relative tested 2013-09-04
encode = false,
COinS = 'info:arxiv',
separator = ':',
access = 'free', -- free to read
},
['ASIN'] = {
parameters = { 'asin', 'ASIN' },
link = 'Amazon Standard Identification Number',
redirect = 'ASIN (identifier)',
q = 'Q1753278',
label = 'ASIN',
prefix = 'https://www.amazon.',
COinS = 'url',
separator = ' ',
encode = false;
},
['BIBCODE'] = {
parameters = {'bibcode'},
link = 'Bibcode',
redirect = 'Bibcode (identifier)',
q = 'Q25754',
label = 'Bibcode',
prefix = 'https://ui.adsabs.harvard.edu/abs/',
encode = false,
COinS = 'info:bibcode',
separator = ':',
custom_access = 'bibcode-access',
},
['BIORXIV'] = {
parameters = {'biorxiv'},
link = 'bioRxiv',
redirect = 'bioRxiv (identifier)',
q = 'Q19835482',
label = 'bioRxiv',
prefix = 'https://doi.org/',
COinS = 'pre', -- use prefix value
access = 'free', -- free to read
encode = true,
separator = ' ',
},
['CITESEERX'] = {
parameters = {'citeseerx'},
link = 'CiteSeerX',
redirect = 'CiteSeerX (identifier)',
q = 'Q2715061',
label = 'CiteSeerX',
prefix = 'https://citeseerx.ist.psu.edu/viewdoc/summary?doi=',
COinS = 'pre', -- use prefix value
access = 'free', -- free to read
encode = true,
separator = ' ',
},
['DOI'] = { -- Used by InternetArchiveBot
parameters = { 'doi', 'DOI'},
link = 'Digital object identifier',
redirect = 'doi (identifier)',
q = 'Q25670',
label = 'doi',
prefix = 'https://doi.org/',
COinS = 'info:doi',
separator = ':',
encode = true,
custom_access = 'doi-access',
},
['EISSN'] = {
parameters = {'eissn', 'EISSN'},
link = 'International Standard Serial Number#Electronic ISSN',
redirect = 'eISSN (identifier)',
q = 'Q46339674',
label = 'eISSN',
prefix = 'https://www.worldcat.org/issn/',
COinS = 'rft.eissn',
encode = false,
separator = ' ',
},
['HDL'] = {
parameters = { 'hdl', 'HDL' },
link = 'Handle System',
redirect = 'hdl (identifier)',
q = 'Q3126718',
label = 'hdl',
prefix = 'https://hdl.handle.net/',
COinS = 'info:hdl',
separator = ':',
encode = true,
custom_access = 'hdl-access',
},
['ISBN'] = { -- Used by InternetArchiveBot
parameters = {'isbn', 'ISBN'},
link = 'International Standard Book Number',
redirect = 'ISBN (identifier)',
q = 'Q33057',
label = 'ISBN',
prefix = 'Special:BookSources/',
COinS = 'rft.isbn',
separator = ' ',
},
['ISMN'] = {
parameters = {'ismn', 'ISMN'},
link = 'International Standard Music Number',
redirect = 'ISMN (identifier)',
q = 'Q1666938',
label = 'ISMN',
prefix = '', -- not currently used;
COinS = nil, -- nil because we can't use pre or rft or info:
separator = ' ',
},
['ISSN'] = {
parameters = {'issn', 'ISSN'},
link = 'International Standard Serial Number',
redirect = 'ISSN (identifier)',
q = 'Q131276',
label = 'ISSN',
prefix = 'https://www.worldcat.org/issn/',
COinS = 'rft.issn',
encode = false,
separator = ' ',
},
['JFM'] = {
parameters = {'jfm', 'JFM'},
link = 'Jahrbuch über die Fortschritte der Mathematik',
redirect = 'JFM (identifier)',
q = '',
label = 'JFM',
prefix = 'https://zbmath.org/?format=complete&q=an:',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
['JSTOR'] = {
parameters = {'jstor', 'JSTOR'},
link = 'JSTOR',
redirect = 'JSTOR (identifier)',
q = 'Q1420342',
label = 'JSTOR',
prefix = 'https://www.jstor.org/stable/', -- protocol-relative tested 2013-09-04
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
custom_access = 'jstor-access',
},
['LCCN'] = {
parameters = {'lccn', 'LCCN'},
link = 'Library of Congress Control Number',
redirect = 'LCCN (identifier)',
q = 'Q620946',
label = 'LCCN',
prefix = 'https://lccn.loc.gov/', -- protocol-relative tested 2015-12-28
COinS = 'info:lccn',
encode = false,
separator = ' ',
},
['MR'] = {
parameters = {'mr', 'MR'},
link = 'Mathematical Reviews',
redirect = 'MR (identifier)',
q = 'Q211172',
label = 'MR',
prefix = 'https://mathscinet.ams.org/mathscinet-getitem?mr=',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
['OCLC'] = {
parameters = {'oclc', 'OCLC'},
link = 'OCLC',
redirect = 'OCLC (identifier)',
q = 'Q190593',
label = 'OCLC',
prefix = 'https://www.worldcat.org/oclc/',
COinS = 'info:oclcnum',
encode = true,
separator = ' ',
id_limit = 9999999999, -- 10-digits
},
['OL'] = {
parameters = { 'ol', 'OL' },
link = 'Open Library',
redirect = 'OL (identifier)',
q = 'Q1201876',
label = 'OL',
prefix = 'https://openlibrary.org/',
COinS = 'url',
separator = ' ',
encode = true,
custom_access = 'ol-access',
},
['OSTI'] = {
parameters = {'osti', 'OSTI'},
link = 'Office of Scientific and Technical Information',
redirect = 'OSTI (identifier)',
q = 'Q2015776',
label = 'OSTI',
prefix = 'https://www.osti.gov/biblio/', -- protocol-relative tested 2018-09-12
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
id_limit = 23010000,
custom_access = 'osti-access',
},
['PMC'] = {
parameters = {'pmc', 'PMC'},
link = 'PubMed Central',
redirect = 'PMC (identifier)',
q = 'Q229883',
label = 'PMC',
prefix = 'https://www.ncbi.nlm.nih.gov/pmc/articles/PMC',
suffix = '',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
id_limit = 10500000,
access = 'free', -- free to read
},
['PMID'] = {
parameters = {'pmid', 'PMID'},
link = 'PubMed Identifier',
redirect = 'PMID (identifier)',
q = 'Q2082879',
label = 'PMID',
prefix = 'https://pubmed.ncbi.nlm.nih.gov/',
COinS = 'info:pmid',
encode = false,
separator = ' ',
id_limit = 37900000,
},
['RFC'] = {
parameters = {'rfc', 'RFC'},
link = 'Request for Comments',
redirect = 'RFC (identifier)',
q = 'Q212971',
label = 'RFC',
prefix = 'https://tools.ietf.org/html/rfc',
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
id_limit = 9300,
access = 'free', -- free to read
},
['SBN'] = {
parameters = {'sbn', 'SBN'},
link = 'Standard Book Number', -- redirect to International_Standard_Book_Number#History
redirect = 'SBN (identifier)',
label = 'SBN',
prefix = 'Special:BookSources/0-', -- prefix has leading zero necessary to make 9-digit sbn a 10-digit isbn
COinS = nil, -- nil because we can't use pre or rft or info:
separator = ' ',
},
['SSRN'] = {
parameters = {'ssrn', 'SSRN'},
link = 'Social Science Research Network',
redirect = 'SSRN (identifier)',
q = 'Q7550801',
label = 'SSRN',
prefix = 'https://papers.ssrn.com/sol3/papers.cfm?abstract_id=',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
id_limit = 4600000,
custom_access = 'ssrn-access',
},
['S2CID'] = {
parameters = {'s2cid', 'S2CID'},
link = 'Semantic Scholar',
redirect = 'S2CID (identifier)',
q = 'Q22908627',
label = 'S2CID',
prefix = 'https://api.semanticscholar.org/CorpusID:',
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
id_limit = 262000000,
custom_access = 's2cid-access',
},
['USENETID'] = {
parameters = {'message-id'},
link = 'Usenet',
redirect = 'Usenet (identifier)',
q = 'Q193162',
label = 'Usenet:',
prefix = 'news:',
encode = false,
COinS = 'pre', -- use prefix value
separator = ' ',
},
['ZBL'] = {
parameters = {'zbl', 'ZBL' },
link = 'Zentralblatt MATH',
redirect = 'Zbl (identifier)',
q = 'Q190269',
label = 'Zbl',
prefix = 'https://zbmath.org/?format=complete&q=an:',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
}
--[[--------------------------< E X P O R T S >---------------------------------
]]
return {
use_identifier_redirects = true, -- when true use redirect name for identifier label links; always true at en.wiki
local_lang_cat_enable = false; -- when true categorizes pages where |language=<local wiki's language>; always false at en.wiki
date_name_auto_xlate_enable = false; -- when true translates English month-names to the local-wiki's language month names; always false at en.wiki
date_digit_auto_xlate_enable = false; -- when true translates Western date digit to the local-wiki's language digits (date_names['local_digits']); always false at en.wiki
-- tables and variables created when this module is loaded
global_df = get_date_format (), -- this line can be replaced with "global_df = 'dmy-all'," to have all dates auto translated to dmy format.
punct_skip = build_skip_table (punct_skip, punct_meta_params),
url_skip = build_skip_table (url_skip, url_meta_params),
aliases = aliases,
special_case_translation = special_case_translation,
date_names = date_names,
err_msg_supl = err_msg_supl,
error_conditions = error_conditions,
editor_markup_patterns = editor_markup_patterns,
et_al_patterns = et_al_patterns,
id_handlers = id_handlers,
keywords_lists = keywords_lists,
keywords_xlate = keywords_xlate,
stripmarkers = stripmarkers,
invisible_chars = invisible_chars,
invisible_defs = invisible_defs,
indic_script = indic_script,
emoji_t = emoji_t,
maint_cats = maint_cats,
messages = messages,
presentation = presentation,
prop_cats = prop_cats,
script_lang_codes = script_lang_codes,
lang_code_remap = lang_code_remap,
lang_name_remap = lang_name_remap,
this_wiki_code = this_wiki_code,
title_types = title_types,
uncategorized_namespaces = uncategorized_namespaces_t,
uncategorized_subpages = uncategorized_subpages,
templates_using_volume = templates_using_volume,
templates_using_issue = templates_using_issue,
templates_not_using_page = templates_not_using_page,
vol_iss_pg_patterns = vol_iss_pg_patterns,
single_letter_2nd_lvl_domains_t = single_letter_2nd_lvl_domains_t,
inter_wiki_map = inter_wiki_map,
mw_languages_by_tag_t = mw_languages_by_tag_t,
mw_languages_by_name_t = mw_languages_by_name_t,
citation_class_map_t = citation_class_map_t,
citation_issue_t = citation_issue_t,
citation_no_volume_t = citation_no_volume_t,
}
2cdaf417af636e6e0b4981038bd6c539ee5190a7
Main Page
0
1
1
2023-08-08T16:08:25Z
MediaWiki default
1
Create main page
wikitext
text/x-wiki
__NOTOC__
== Welcome to {{SITENAME}}! ==
This Main Page was created automatically and it seems it hasn't been replaced yet.
=== For the bureaucrat(s) of this wiki ===
Hello, and welcome to your new wiki! Thank you for choosing Miraheze for the hosting of your wiki, we hope you will enjoy our hosting.
You can immediately start working on your wiki or whenever you want.
Need help? No problem! We will help you with your wiki as needed. To start, try checking out these helpful links:
* [[mw:Special:MyLanguage/Help:Contents|MediaWiki guide]] (e.g. navigation, editing, deleting pages, blocking users)
* [[meta:Special:MyLanguage/FAQ|Miraheze FAQ]]
* [[meta:Special:MyLanguage/Request features|Request settings changes on your wiki]]. (Extensions, Skin and Logo/Favicon changes should be done through [[Special:ManageWiki]] on your wiki, see [[meta:Special:MyLanguage/ManageWiki|ManageWiki]] for more information.)
==== I still don't understand X! ====
Well, that's no problem. Even if something isn't explained in the documentation/FAQ, we are still happy to help you. You can find us here:
* [[meta:Special:MyLanguage/Help center|On our own Miraheze wiki]]
* On [[phab:|Phabricator]]
* On [https://miraheze.org/discord Discord]
* On IRC in #miraheze on irc.libera.chat ([irc://irc.libera.chat/%23miraheze direct link]; [https://web.libera.chat/?channel=#miraheze webchat])
=== For visitors of this wiki ===
Hello, the default Main Page of this wiki (this page) has not yet been replaced by the bureaucrat(s) of this wiki. The bureaucrat(s) might still be working on a Main Page, so please check again later!
21236ac3f8d65e5563b6da6b70815ca6bf1e6616
2
1
2023-08-09T15:30:37Z
GeoEditor
3
wikitext
text/x-wiki
__NOTOC__
== Welcome to {{SITENAME}}! ==
This Main Page was created automatically and it seems it hasn't been replaced yet.
=== For the bureaucrat(s) of this wiki ===
Hello, and welcome to your new wiki! Thank you for choosing Miraheze for the hosting of your wiki, we hope you will enjoy our hosting.
You can immediately start working on your wiki or whenever you want.
Need help? No problem! We will help you with your wiki as needed. To start, try checking out these helpful links:
* [[mw:Special:MyLanguage/Help:Contents|MediaWiki guide]] (e.g. navigation, editing, deleting pages, blocking users)
* [[meta:Special:MyLanguage/FAQ|Miraheze FAQ]]
* [[meta:Special:MyLanguage/Request features|Request settings changes on your wiki]]. (Extensions, Skin and Logo/Favicon changes should be done through [[Special:ManageWiki]] on your wiki, see [[meta:Special:MyLanguage/ManageWiki|ManageWiki]] for more information.)
==== I still don't understand X! ====
Well, that's no problem. Even if something isn't explained in the documentation/FAQ, we are still happy to help you. You can find us here:
* [[meta:Special:MyLanguage/Help center|On our own Miraheze wiki]]
* On [[phab:|Phabricator]]
* On [https://miraheze.org/discord Discord]
* On IRC in #miraheze on irc.libera.chat ([irc://irc.libera.chat/%23miraheze direct link]; [https://web.libera.chat/?channel=#miraheze webchat])
=== For visitors of Geotubepedia ===
Hello, the default Main Page of this wiki (this page) has not yet been replaced by the bureaucrat(s) of this wiki. The bureaucrat(s) might still be working on a Main Page, so please check again later!
34a24e9d3cc5cde2f3d9f87bca742af0ee75ea27
5
2
2023-08-09T15:42:11Z
GeoEditor
3
wikitext
text/x-wiki
__NOTOC__
== Welcome to {{SITENAME}}! ==
This Main Page was created automatically and it seems it hasn't been replaced yet.
=== For the bureaucrat(s) of Geotubepedia ===
Hello, and welcome to your new wiki! Thank you for choosing Miraheze for the hosting of your wiki, we hope you will enjoy our hosting.
You can immediately start working on your wiki or whenever you want.
Need help? No problem! We will help you with your wiki as needed. To start, try checking out these helpful links:
* [[mw:Special:MyLanguage/Help:Contents|MediaWiki guide]] (e.g. navigation, editing, deleting pages, blocking users)
* [[meta:Special:MyLanguage/FAQ|Miraheze FAQ]]
* [[meta:Special:MyLanguage/Request features|Request settings changes on your wiki]]. (Extensions, Skin and Logo/Favicon changes should be done through [[Special:ManageWiki]] on your wiki, see [[meta:Special:MyLanguage/ManageWiki|ManageWiki]] for more information.)
==== I still don't understand X! ====
Well, that's no problem. Even if something isn't explained in the documentation/FAQ, we are still happy to help you. You can find us here:
* [[meta:Special:MyLanguage/Help center|On our own Miraheze wiki]]
* On [[phab:|Phabricator]]
* On [https://miraheze.org/discord Discord]
* On IRC in #miraheze on irc.libera.chat ([irc://irc.libera.chat/%23miraheze direct link]; [https://web.libera.chat/?channel=#miraheze webchat])
=== For visitors of Geotubepedia ===
Hello, the default Main Page of this wiki (this page) has not yet been replaced by the bureaucrat(s) of this wiki. The bureaucrat(s) might still be working on a Main Page, so please check again later!
3e642f6c800a9b3e439e2805918b40811e908372
8
5
2023-08-10T11:10:17Z
GeoEditor
3
wikitext
text/x-wiki
__NOTOC__
== Welcome to {{SITENAME}}! ==
This Main Page was created automatically.
=== For the bureaucrat(s) of Geotubepedia ===
Hello, and welcome to your new wiki! Thank you for choosing Miraheze for the hosting of your wiki, we hope you will enjoy our hosting.
You can immediately start working on your wiki or whenever you want.
Need help? No problem! We will help you with your wiki as needed. To start, try checking out these helpful links:
* [[mw:Special:MyLanguage/Help:Contents|MediaWiki guide]] (e.g. navigation, editing, deleting pages, blocking users)
* [[meta:Special:MyLanguage/FAQ|Miraheze FAQ]]
* [[meta:Special:MyLanguage/Request features|Request settings changes on your wiki]]. (Extensions, Skin and Logo/Favicon changes should be done through [[Special:ManageWiki]] on your wiki, see [[meta:Special:MyLanguage/ManageWiki|ManageWiki]] for more information.)
==== I still don't understand X! ====
Well, that's no problem. Even if something isn't explained in the documentation/FAQ, we are still happy to help you. You can find us here:
* [[meta:Special:MyLanguage/Help center|On our own Miraheze wiki]]
* On [[phab:|Phabricator]]
* On [https://miraheze.org/discord Discord]
* On IRC in #miraheze on irc.libera.chat ([irc://irc.libera.chat/%23miraheze direct link]; [https://web.libera.chat/?channel=#miraheze webchat])
=== For visitors of Geotubepedia ===
Hello, the default Main Page of this wiki (this page) has not yet been replaced by the bureaucrat(s) of this wiki. The bureaucrat(s) might still be working on a Main Page, so please check again later!
2a5e4c973e44e41704c530f86a12c07cef37d07f
9
8
2023-08-10T11:32:59Z
GeoEditor
3
wikitext
text/x-wiki
__NOTOC__
== Welcome to {{SITENAME}}! ==
Hey there, Welcome!
=== For the bureaucrat(s) of Geotubepedia ===
Hello, and welcome to your new wiki! Thank you for choosing Miraheze for the hosting of your wiki, we hope you will enjoy our hosting.
You can immediately start working on your wiki or whenever you want.
Need help? No problem! We will help you with your wiki as needed. To start, try checking out these helpful links:
* [[mw:Special:MyLanguage/Help:Contents|MediaWiki guide]] (e.g. navigation, editing, deleting pages, blocking users)
* [[meta:Special:MyLanguage/FAQ|Miraheze FAQ]]
* [[meta:Special:MyLanguage/Request features|Request settings changes on your wiki]]. (Extensions, Skin and Logo/Favicon changes should be done through [[Special:ManageWiki]] on your wiki, see [[meta:Special:MyLanguage/ManageWiki|ManageWiki]] for more information.)
==== I still don't understand X! ====
Well, that's no problem. Even if something isn't explained in the documentation/FAQ, we are still happy to help you. You can find us here:
* [[meta:Special:MyLanguage/Help center|On our own Miraheze wiki]]
* On [[phab:|Phabricator]]
* On [https://miraheze.org/discord Discord]
* On IRC in #miraheze on irc.libera.chat ([irc://irc.libera.chat/%23miraheze direct link]; [https://web.libera.chat/?channel=#miraheze webchat])
=== For visitors of Geotubepedia ===
Hello, the default Main Page of this wiki (this page) has not yet been replaced by the bureaucrat(s) of this wiki. The bureaucrat(s) might still be working on a Main Page, so please check again later!
6d4cc311d0e9dc3ae823cf5db4e3480fdb5a4059
10
9
2023-08-10T13:44:16Z
InsaneX
2
Protected "[[Main Page]]": High traffic page ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
__NOTOC__
== Welcome to {{SITENAME}}! ==
Hey there, Welcome!
=== For the bureaucrat(s) of Geotubepedia ===
Hello, and welcome to your new wiki! Thank you for choosing Miraheze for the hosting of your wiki, we hope you will enjoy our hosting.
You can immediately start working on your wiki or whenever you want.
Need help? No problem! We will help you with your wiki as needed. To start, try checking out these helpful links:
* [[mw:Special:MyLanguage/Help:Contents|MediaWiki guide]] (e.g. navigation, editing, deleting pages, blocking users)
* [[meta:Special:MyLanguage/FAQ|Miraheze FAQ]]
* [[meta:Special:MyLanguage/Request features|Request settings changes on your wiki]]. (Extensions, Skin and Logo/Favicon changes should be done through [[Special:ManageWiki]] on your wiki, see [[meta:Special:MyLanguage/ManageWiki|ManageWiki]] for more information.)
==== I still don't understand X! ====
Well, that's no problem. Even if something isn't explained in the documentation/FAQ, we are still happy to help you. You can find us here:
* [[meta:Special:MyLanguage/Help center|On our own Miraheze wiki]]
* On [[phab:|Phabricator]]
* On [https://miraheze.org/discord Discord]
* On IRC in #miraheze on irc.libera.chat ([irc://irc.libera.chat/%23miraheze direct link]; [https://web.libera.chat/?channel=#miraheze webchat])
=== For visitors of Geotubepedia ===
Hello, the default Main Page of this wiki (this page) has not yet been replaced by the bureaucrat(s) of this wiki. The bureaucrat(s) might still be working on a Main Page, so please check again later!
6d4cc311d0e9dc3ae823cf5db4e3480fdb5a4059
User:GeoEditor
2
2
3
2023-08-09T15:30:40Z
HAWelcome
0
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:GeoEditor
3
3
4
2023-08-09T15:30:40Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:Main Page]] page.
Please leave a message on [[User talk:HAWelcome|my talk page]] if I can help with anything! -- [[User:HAWelcome|HAWelcome]] ([[User talk:HAWelcome|talk]]) 15:30, 9 August 2023
9c6800133fb2d67276f75e49f653c56a5e0dfaaa
Umar Edits
0
4
6
2023-08-09T15:46:03Z
GeoEditor
3
Created page with "'''Umar Edits'''"
wikitext
text/x-wiki
'''Umar Edits'''
47964e30b13755911c7ca8e108450dfa724f2a86
11
6
2023-08-10T13:54:51Z
InsaneX
2
wikitext
text/x-wiki
{{GETSHORTDESC:Bacon}}
'''Umar Edits'''
81ab155fababbfa464b505b808dee55334086c1d
12
11
2023-08-10T13:55:49Z
InsaneX
2
wikitext
text/x-wiki
{{SHORTDESC:UmarEdits is a Youtuber}}
'''Umar Edits'''
7cfd05767287e42ee5b0ead2e9468772b8af53c8
13
12
2023-08-10T13:56:43Z
InsaneX
2
wikitext
text/x-wiki
{{SHORTDESC:UmarEdits is a Youtuber}}
{{GETSHORTDESC:}}
'''Umar Edits'''
962eebdb8345451b63381bfa72bc1bf37229e86c
File:World icon.png
6
5
7
2023-08-09T15:48:50Z
InsaneX
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Template:Template parameter usage
10
72
146
2023-08-10T01:28:48Z
wikipedia>Jonesey95
0
clarify that the linked report applies only to article space
wikitext
text/x-wiki
{{#switch:{{{label|}}}
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|this template}} in articles{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report] for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|[[Template:{{ROOTPAGENAME}}]]}}{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|#default=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{{label|}}}]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
}}<noinclude>
{{documentation}}
</noinclude>
10a89e6a4bc63a1427518ea21bf94b8f623a7391
Template:Short description
10
6
15
14
2023-08-10T14:07:12Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{#ifeq:{{lc:{{{1|}}}}}|none|<nowiki /><!--Prevents whitespace issues when used with adjacent newlines-->|<div class="shortdescription nomobile noexcerpt noprint searchaux" style="display:none">{{{1|}}}{{SHORTDESC:{{{1|}}}|{{{2|}}}}}</div>}}<includeonly>{{#ifeq:{{{pagetype}}}|Disambiguation pages||{{#ifeq:{{pagetype |defaultns = all |user=exclude}}|exclude||{{#ifeq:{{#switch: {{NAMESPACENUMBER}} | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 100 | 101 | 118 | 119 | 828 | 829 | = exclude|#default=}}|exclude||[[Category:{{{pagetype|{{pagetype |defaultns = extended |plural=y}}}}} with short description]]}}}}}}</includeonly><!-- Start tracking
-->{{#invoke:Check for unknown parameters|check|unknown={{Main other|[[Category:Pages using short description with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Short description]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | pagetype | bot |plural }}<!--
-->{{#ifexpr: {{#invoke:String|len|{{{1|}}}}}>100 | [[Category:{{{pagetype|{{pagetype |defaultns = extended |plural=y}}}}} with long short description]]}}<!--
--><includeonly>{{#if:{{{1|}}}||[[Category:Pages with empty short description]]}}</includeonly><!--
-->{{Short description/lowercasecheck|{{{1|}}}}}<!--
-->{{Main other |{{SDcat |sd={{{1|}}} }} }}<noinclude>
{{Documentation}}
</noinclude>
f175a6d61b40a87adb43e2dd4f73c7979759b34c
Module:Yesno
828
7
17
16
2023-08-10T14:07:12Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
f767643e7d12126d020d88d662a3dd057817b9dc
Module:Arguments
828
8
19
18
2023-08-10T14:07:13Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
Template:Mbox
10
9
21
20
2023-08-10T14:07:13Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{#invoke:Message box|mbox}}<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! -->
</noinclude>
5bfb2becf8bed35974b47e3ff8660dc14bee40c7
Template:Tl
10
10
23
22
2023-08-10T14:07:14Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
{{Redirect category shell|
{{R from move}}
}}
d6593bb3b4a866249f55d0f34b047a71fe1f1529
Template:Template link
10
11
25
24
2023-08-10T14:07:14Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
eabbec62efe3044a98ebb3ce9e7d4d43c222351d
Module:Message box
828
12
27
26
2023-08-10T14:07:14Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
require('strict')
local getArgs
local yesno = require('Module:Yesno')
local lang = mw.language.getContentLanguage()
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
-- Find if the box has been wrongly substituted.
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText
if self.isSmall then
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
talkText = string.format('([[%s|talk]])', talkLink)
else
talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <span class='date-container'><i>(<span class='date'>%s</span>)</i></span>", date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage
or 'Imbox notice.png', imageSize)
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
-- set templatestyles
self.base_templatestyles = cfg.templatestyles
self.templatestyles = args.templatestyles
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
local frame = mw.getCurrentFrame()
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.base_templatestyles },
})
-- Add support for a single custom templatestyles sheet. Undocumented as
-- need should be limited and many templates using mbox are substed; we
-- don't want to spread templatestyles sheets around to arbitrary places
if self.templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.templatestyles },
})
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):addClass('mbox-image-div')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:addClass('mbox-invalid-type')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
bdb0ecc9f26f26b9c0ce12a066a183ac9d4f0705
Module:Message box/configuration
828
13
29
28
2023-08-10T14:07:15Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Message box configuration --
-- --
-- This module contains configuration data for [[Module:Message box]]. --
--------------------------------------------------------------------------------
return {
ambox = {
types = {
speedy = {
class = 'ambox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ambox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ambox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ambox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ambox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ambox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ambox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
allowSmall = true,
smallParam = 'left',
smallClass = 'mbox-small-left',
substCheck = true,
classes = {'metadata', 'ambox'},
imageEmptyCell = true,
imageCheckBlank = true,
imageSmallSize = '20x20px',
imageCellDiv = true,
useCollapsibleTextFields = true,
imageRightNone = true,
sectionDefault = 'article',
allowMainspaceCategories = true,
templateCategory = 'Article message templates',
templateCategoryRequireName = true,
templateErrorCategory = 'Article message templates with missing parameters',
templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
removalNotice = '<small>[[Help:Maintenance template removal|Learn how and when to remove this template message]]</small>',
templatestyles = 'Module:Message box/ambox.css'
},
cmbox = {
types = {
speedy = {
class = 'cmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'cmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'cmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'cmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'cmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'cmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'cmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'cmbox'},
imageEmptyCell = true,
templatestyles = 'Module:Message box/cmbox.css'
},
fmbox = {
types = {
warning = {
class = 'fmbox-warning',
image = 'Ambox warning pn.svg'
},
editnotice = {
class = 'fmbox-editnotice',
image = 'Information icon4.svg'
},
system = {
class = 'fmbox-system',
image = 'Information icon4.svg'
}
},
default = 'system',
showInvalidTypeError = true,
classes = {'fmbox'},
imageEmptyCell = false,
imageRightNone = false,
templatestyles = 'Module:Message box/fmbox.css'
},
imbox = {
types = {
speedy = {
class = 'imbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'imbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'imbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'imbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'imbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'imbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
license = {
class = 'imbox-license licensetpl',
image = 'Imbox license.png' -- @todo We need an SVG version of this
},
featured = {
class = 'imbox-featured',
image = 'Cscr-featured.svg'
},
notice = {
class = 'imbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'imbox'},
imageEmptyCell = true,
below = true,
templateCategory = 'File message boxes',
templatestyles = 'Module:Message box/imbox.css'
},
ombox = {
types = {
speedy = {
class = 'ombox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ombox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ombox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ombox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ombox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ombox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ombox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'ombox'},
allowSmall = true,
imageEmptyCell = true,
imageRightNone = true,
templatestyles = 'Module:Message box/ombox.css'
},
tmbox = {
types = {
speedy = {
class = 'tmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'tmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'tmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'tmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'tmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'tmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'tmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'tmbox'},
allowSmall = true,
imageRightNone = true,
imageEmptyCell = true,
templateCategory = 'Talk message boxes',
templatestyles = 'Module:Message box/tmbox.css'
}
}
b6f0151037e6867b577c8cca32ff297e48697a10
Module:Redirect
828
14
31
30
2023-08-10T14:07:15Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- This module provides functions for getting the target of a redirect page.
local p = {}
-- Gets a mw.title object, using pcall to avoid generating script errors if we
-- are over the expensive function count limit (among other possible causes).
local function getTitle(...)
local success, titleObj = pcall(mw.title.new, ...)
if success then
return titleObj
else
return nil
end
end
-- Gets the name of a page that a redirect leads to, or nil if it isn't a
-- redirect.
function p.getTargetFromText(text)
local target = string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)%]%]"
) or string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)|[^%[%]]-%]%]"
)
return target and mw.uri.decode(target, 'PATH')
end
-- Gets the target of a redirect. If the page specified is not a redirect,
-- returns nil.
function p.getTarget(page, fulltext)
-- Get the title object. Both page names and title objects are allowed
-- as input.
local titleObj
if type(page) == 'string' or type(page) == 'number' then
titleObj = getTitle(page)
elseif type(page) == 'table' and type(page.getContent) == 'function' then
titleObj = page
else
error(string.format(
"bad argument #1 to 'getTarget'"
.. " (string, number, or title object expected, got %s)",
type(page)
), 2)
end
if not titleObj then
return nil
end
local targetTitle = titleObj.redirectTarget
if targetTitle then
if fulltext then
return targetTitle.fullText
else
return targetTitle.prefixedText
end
else
return nil
end
end
--[[
-- Given a single page name determines what page it redirects to and returns the
-- target page name, or the passed page name when not a redirect. The passed
-- page name can be given as plain text or as a page link.
--
-- Returns page name as plain text, or when the bracket parameter is given, as a
-- page link. Returns an error message when page does not exist or the redirect
-- target cannot be determined for some reason.
--]]
function p.luaMain(rname, bracket, fulltext)
if type(rname) ~= "string" or not rname:find("%S") then
return nil
end
bracket = bracket and "[[%s]]" or "%s"
rname = rname:match("%[%[(.+)%]%]") or rname
local target = p.getTarget(rname, fulltext)
local ret = target or rname
ret = getTitle(ret)
if ret then
if fulltext then
ret = ret.fullText
else
ret = ret.prefixedText
end
return bracket:format(ret)
else
return nil
end
end
-- Provides access to the luaMain function from wikitext.
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {frameOnly = true})
return p.luaMain(args[1], args.bracket, args.fulltext) or ''
end
-- Returns true if the specified page is a redirect, and false otherwise.
function p.luaIsRedirect(page)
local titleObj = getTitle(page)
if not titleObj then
return false
end
if titleObj.isRedirect then
return true
else
return false
end
end
-- Provides access to the luaIsRedirect function from wikitext, returning 'yes'
-- if the specified page is a redirect, and the blank string otherwise.
function p.isRedirect(frame)
local args = require('Module:Arguments').getArgs(frame, {frameOnly = true})
if p.luaIsRedirect(args[1]) then
return 'yes'
else
return ''
end
end
return p
a224c45940343d66f49a78b0a39b2045e2c45d20
Template:Yesno
10
15
33
32
2023-08-10T14:07:15Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|¬}}} }}
|no
|n
|f
|false
|off
|0 = {{{no|<!-- null -->}}}
| = {{{blank|{{{no|<!-- null -->}}}}}}
|¬ = {{{¬|}}}
|yes
|y
|t
|true
|on
|1 = {{{yes|yes}}}
|#default = {{{def|{{{yes|yes}}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
629c2937bc5cf7cfe13cd2a598582af832782399
Template:Main other
10
16
35
34
2023-08-10T14:07:16Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:0}}
| main
| other
}}
}}
| main = {{{1|}}}
| other
| #default = {{{2|}}}
}}<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! -->
</noinclude>
86ad907ffeea3cc545159e00cd1f2d6433946450
Template:Short description/lowercasecheck
10
17
37
36
2023-08-10T14:07:16Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{#ifeq:<!--test first character for lower-case letter-->{{#invoke:string|find|1={{{1|}}}|2=^%l|plain=false}}|1
|<!-- first character is a lower case letter; test against whitelist
-->{{#switch: {{First word|{{{1|}}}}}<!--begin whitelist-->
|c. <!--for circa-->
|gTLD
|iMac
|iOS
|iOS,
|iPad
|iPhone
|iTunes
|macOS
|none
|pH
|pH-dependent=<!-- end whitelist; short description starts with an allowed lower-case string; whitelist matched; do nothing -->
|#default=<!-- apply category to track lower-case short descriptions -->{{main other|[[Category:Pages with lower-case short description|{{trim|{{{1|}}}}}]]}}{{Testcases other|{{red|CATEGORY APPLIED}}}}<!-- end whitelist test -->}}
|<!-- short description does not start with lower-case letter; do nothing; end lower-case test -->
}}<noinclude>
{{documentation}}
</noinclude>
9a6d4db14b74614625fd234b4f8ee3c8e1a235c0
Module:Check for unknown parameters
828
18
39
38
2023-08-10T14:07:16Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- This module may be used to compare the arguments passed to the parent
-- with a list of arguments, returning a specified result if an argument is
-- not on the list
local p = {}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
local function isnotempty(s)
return s and s:match('%S')
end
local function clean(text)
-- Return text cleaned for display and truncated if too long.
-- Strip markers are replaced with dummy text representing the original wikitext.
local pos, truncated
local function truncate(text)
if truncated then
return ''
end
if mw.ustring.len(text) > 25 then
truncated = true
text = mw.ustring.sub(text, 1, 25) .. '...'
end
return mw.text.nowiki(text)
end
local parts = {}
for before, tag, remainder in text:gmatch('([^\127]*)\127[^\127]*%-(%l+)%-[^\127]*\127()') do
pos = remainder
table.insert(parts, truncate(before) .. '<' .. tag .. '>...</' .. tag .. '>')
end
table.insert(parts, truncate(text:sub(pos or 1)))
return table.concat(parts)
end
function p._check(args, pargs)
if type(args) ~= "table" or type(pargs) ~= "table" then
-- TODO: error handling
return
end
-- create the list of known args, regular expressions, and the return string
local knownargs = {}
local regexps = {}
for k, v in pairs(args) do
if type(k) == 'number' then
v = trim(v)
knownargs[v] = 1
elseif k:find('^regexp[1-9][0-9]*$') then
table.insert(regexps, '^' .. v .. '$')
end
end
-- loop over the parent args, and make sure they are on the list
local ignoreblank = isnotempty(args['ignoreblank'])
local showblankpos = isnotempty(args['showblankpositional'])
local values = {}
for k, v in pairs(pargs) do
if type(k) == 'string' and knownargs[k] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(k, regexp) then
knownflag = true
break
end
end
if not knownflag and ( not ignoreblank or isnotempty(v) ) then
table.insert(values, clean(k))
end
elseif type(k) == 'number' and knownargs[tostring(k)] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(tostring(k), regexp) then
knownflag = true
break
end
end
if not knownflag and ( showblankpos or isnotempty(v) ) then
table.insert(values, k .. ' = ' .. clean(v))
end
end
end
-- add results to the output tables
local res = {}
if #values > 0 then
local unknown_text = args['unknown'] or 'Found _VALUE_, '
if mw.getCurrentFrame():preprocess( "{{REVISIONID}}" ) == "" then
local preview_text = args['preview']
if isnotempty(preview_text) then
preview_text = require('Module:If preview')._warning({preview_text})
elseif preview == nil then
preview_text = unknown_text
end
unknown_text = preview_text
end
for _, v in pairs(values) do
-- Fix odd bug for | = which gets stripped to the empty string and
-- breaks category links
if v == '' then v = ' ' end
-- avoid error with v = 'example%2' ("invalid capture index")
local r = unknown_text:gsub('_VALUE_', {_VALUE_ = v})
table.insert(res, r)
end
end
return table.concat(res)
end
function p.check(frame)
local args = frame.args
local pargs = frame:getParent().args
return p._check(args, pargs)
end
return p
93db6d115d4328d2a5148bb42959105e367b663e
Module:String
828
19
41
40
2023-08-10T14:07:17Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
--[[
This module is intended to provide access to basic string functions.
Most of the functions provided here can be invoked with named parameters,
unnamed parameters, or a mixture. If named parameters are used, Mediawiki will
automatically remove any leading or trailing whitespace from the parameter.
Depending on the intended use, it may be advantageous to either preserve or
remove such whitespace.
Global options
ignore_errors: If set to 'true' or 1, any error condition will result in
an empty string being returned rather than an error message.
error_category: If an error occurs, specifies the name of a category to
include with the error message. The default category is
[Category:Errors reported by Module String].
no_category: If set to 'true' or 1, no category will be added if an error
is generated.
Unit tests for this module are available at Module:String/tests.
]]
local str = {}
--[[
len
This function returns the length of the target string.
Usage:
{{#invoke:String|len|target_string|}}
OR
{{#invoke:String|len|s=target_string}}
Parameters
s: The string whose length to report
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string.
]]
function str.len( frame )
local new_args = str._getParameters( frame.args, {'s'} )
local s = new_args['s'] or ''
return mw.ustring.len( s )
end
--[[
sub
This function returns a substring of the target string at specified indices.
Usage:
{{#invoke:String|sub|target_string|start_index|end_index}}
OR
{{#invoke:String|sub|s=target_string|i=start_index|j=end_index}}
Parameters
s: The string to return a subset of
i: The fist index of the substring to return, defaults to 1.
j: The last index of the string to return, defaults to the last character.
The first character of the string is assigned an index of 1. If either i or j
is a negative value, it is interpreted the same as selecting a character by
counting from the end of the string. Hence, a value of -1 is the same as
selecting the last character of the string.
If the requested indices are out of range for the given string, an error is
reported.
]]
function str.sub( frame )
local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } )
local s = new_args['s'] or ''
local i = tonumber( new_args['i'] ) or 1
local j = tonumber( new_args['j'] ) or -1
local len = mw.ustring.len( s )
-- Convert negatives for range checking
if i < 0 then
i = len + i + 1
end
if j < 0 then
j = len + j + 1
end
if i > len or j > len or i < 1 or j < 1 then
return str._error( 'String subset index out of range' )
end
if j < i then
return str._error( 'String subset indices out of order' )
end
return mw.ustring.sub( s, i, j )
end
--[[
This function implements that features of {{str sub old}} and is kept in order
to maintain these older templates.
]]
function str.sublength( frame )
local i = tonumber( frame.args.i ) or 0
local len = tonumber( frame.args.len )
return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) )
end
--[[
_match
This function returns a substring from the source string that matches a
specified pattern. It is exported for use in other modules
Usage:
strmatch = require("Module:String")._match
sresult = strmatch( s, pattern, start, match, plain, nomatch )
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This sub-routine is exported for use in other modules
function str._match( s, pattern, start, match_index, plain_flag, nomatch )
if s == '' then
return str._error( 'Target string is empty' )
end
if pattern == '' then
return str._error( 'Pattern string is empty' )
end
start = tonumber(start) or 1
if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then
return str._error( 'Requested start is out of range' )
end
if match_index == 0 then
return str._error( 'Match index is out of range' )
end
if plain_flag then
pattern = str._escapePattern( pattern )
end
local result
if match_index == 1 then
-- Find first match is simple case
result = mw.ustring.match( s, pattern, start )
else
if start > 1 then
s = mw.ustring.sub( s, start )
end
local iterator = mw.ustring.gmatch(s, pattern)
if match_index > 0 then
-- Forward search
for w in iterator do
match_index = match_index - 1
if match_index == 0 then
result = w
break
end
end
else
-- Reverse search
local result_table = {}
local count = 1
for w in iterator do
result_table[count] = w
count = count + 1
end
result = result_table[ count + match_index ]
end
end
if result == nil then
if nomatch == nil then
return str._error( 'Match not found' )
else
return nomatch
end
else
return result
end
end
--[[
match
This function returns a substring from the source string that matches a
specified pattern.
Usage:
{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}
OR
{{#invoke:String|match|s=source_string|pattern=pattern_string|start=start_index
|match=match_number|plain=plain_flag|nomatch=nomatch_output}}
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from each string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
If the match_number or start_index are out of range for the string being queried, then
this function generates an error. An error is also generated if no match is found.
If one adds the parameter ignore_errors=true, then the error will be suppressed and
an empty string will be returned on any failure.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This is the entry point for #invoke:String|match
function str.match( frame )
local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} )
local s = new_args['s'] or ''
local start = tonumber( new_args['start'] ) or 1
local plain_flag = str._getBoolean( new_args['plain'] or false )
local pattern = new_args['pattern'] or ''
local match_index = math.floor( tonumber(new_args['match']) or 1 )
local nomatch = new_args['nomatch']
return str._match( s, pattern, start, match_index, plain_flag, nomatch )
end
--[[
pos
This function returns a single character from the target string at position pos.
Usage:
{{#invoke:String|pos|target_string|index_value}}
OR
{{#invoke:String|pos|target=target_string|pos=index_value}}
Parameters
target: The string to search
pos: The index for the character to return
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
The first character has an index value of 1.
If one requests a negative value, this function will select a character by counting backwards
from the end of the string. In other words pos = -1 is the same as asking for the last character.
A requested value of zero, or a value greater than the length of the string returns an error.
]]
function str.pos( frame )
local new_args = str._getParameters( frame.args, {'target', 'pos'} )
local target_str = new_args['target'] or ''
local pos = tonumber( new_args['pos'] ) or 0
if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then
return str._error( 'String index out of range' )
end
return mw.ustring.sub( target_str, pos, pos )
end
--[[
str_find
This function duplicates the behavior of {{str_find}}, including all of its quirks.
This is provided in order to support existing templates, but is NOT RECOMMENDED for
new code and templates. New code is recommended to use the "find" function instead.
Returns the first index in "source" that is a match to "target". Indexing is 1-based,
and the function returns -1 if the "target" string is not present in "source".
Important Note: If the "target" string is empty / missing, this function returns a
value of "1", which is generally unexpected behavior, and must be accounted for
separatetly.
]]
function str.str_find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target'} )
local source_str = new_args['source'] or ''
local target_str = new_args['target'] or ''
if target_str == '' then
return 1
end
local start = mw.ustring.find( source_str, target_str, 1, true )
if start == nil then
start = -1
end
return start
end
--[[
find
This function allows one to search for a target string or pattern within another
string.
Usage:
{{#invoke:String|find|source_str|target_string|start_index|plain_flag}}
OR
{{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}}
Parameters
source: The string to search
target: The string or pattern to find within source
start: The index within the source string to start the search, defaults to 1
plain: Boolean flag indicating that target should be understood as plain
text and not as a Lua style regular expression, defaults to true
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the parameter. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
This function returns the first index >= "start" where "target" can be found
within "source". Indices are 1-based. If "target" is not found, then this
function returns 0. If either "source" or "target" are missing / empty, this
function also returns 0.
This function should be safe for UTF-8 strings.
]]
function str.find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['target'] or ''
local start_pos = tonumber(new_args['start']) or 1
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return 0
end
plain = str._getBoolean( plain )
local start = mw.ustring.find( source_str, pattern, start_pos, plain )
if start == nil then
start = 0
end
return start
end
--[[
replace
This function allows one to replace a target string or pattern within another
string.
Usage:
{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}
OR
{{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string|
count=replacement_count|plain=plain_flag}}
Parameters
source: The string to search
pattern: The string or pattern to find within source
replace: The replacement text
count: The number of occurences to replace, defaults to all.
plain: Boolean flag indicating that pattern should be understood as plain
text and not as a Lua style regular expression, defaults to true
]]
function str.replace( frame )
local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['pattern'] or ''
local replace = new_args['replace'] or ''
local count = tonumber( new_args['count'] )
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return source_str
end
plain = str._getBoolean( plain )
if plain then
pattern = str._escapePattern( pattern )
replace = mw.ustring.gsub( replace, "%%", "%%%%" ) --Only need to escape replacement sequences.
end
local result
if count ~= nil then
result = mw.ustring.gsub( source_str, pattern, replace, count )
else
result = mw.ustring.gsub( source_str, pattern, replace )
end
return result
end
--[[
simple function to pipe string.rep to templates.
]]
function str.rep( frame )
local repetitions = tonumber( frame.args[2] )
if not repetitions then
return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' )
end
return string.rep( frame.args[1] or '', repetitions )
end
--[[
escapePattern
This function escapes special characters from a Lua string pattern. See [1]
for details on how patterns work.
[1] https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
Usage:
{{#invoke:String|escapePattern|pattern_string}}
Parameters
pattern_string: The pattern string to escape.
]]
function str.escapePattern( frame )
local pattern_str = frame.args[1]
if not pattern_str then
return str._error( 'No pattern string specified' )
end
local result = str._escapePattern( pattern_str )
return result
end
--[[
count
This function counts the number of occurrences of one string in another.
]]
function str.count(frame)
local args = str._getParameters(frame.args, {'source', 'pattern', 'plain'})
local source = args.source or ''
local pattern = args.pattern or ''
local plain = str._getBoolean(args.plain or true)
if plain then
pattern = str._escapePattern(pattern)
end
local _, count = mw.ustring.gsub(source, pattern, '')
return count
end
--[[
endswith
This function determines whether a string ends with another string.
]]
function str.endswith(frame)
local args = str._getParameters(frame.args, {'source', 'pattern'})
local source = args.source or ''
local pattern = args.pattern or ''
if pattern == '' then
-- All strings end with the empty string.
return "yes"
end
if mw.ustring.sub(source, -mw.ustring.len(pattern), -1) == pattern then
return "yes"
else
return ""
end
end
--[[
join
Join all non empty arguments together; the first argument is the separator.
Usage:
{{#invoke:String|join|sep|one|two|three}}
]]
function str.join(frame)
local args = {}
local sep
for _, v in ipairs( frame.args ) do
if sep then
if v ~= '' then
table.insert(args, v)
end
else
sep = v
end
end
return table.concat( args, sep or '' )
end
--[[
Helper function that populates the argument list given that user may need to use a mix of
named and unnamed parameters. This is relevant because named parameters are not
identical to unnamed parameters due to string trimming, and when dealing with strings
we sometimes want to either preserve or remove that whitespace depending on the application.
]]
function str._getParameters( frame_args, arg_list )
local new_args = {}
local index = 1
local value
for _, arg in ipairs( arg_list ) do
value = frame_args[arg]
if value == nil then
value = frame_args[index]
index = index + 1
end
new_args[arg] = value
end
return new_args
end
--[[
Helper function to handle error messages.
]]
function str._error( error_str )
local frame = mw.getCurrentFrame()
local error_category = frame.args.error_category or 'Errors reported by Module String'
local ignore_errors = frame.args.ignore_errors or false
local no_category = frame.args.no_category or false
if str._getBoolean(ignore_errors) then
return ''
end
local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>'
if error_category ~= '' and not str._getBoolean( no_category ) then
error_str = '[[Category:' .. error_category .. ']]' .. error_str
end
return error_str
end
--[[
Helper Function to interpret boolean strings
]]
function str._getBoolean( boolean_str )
local boolean_value
if type( boolean_str ) == 'string' then
boolean_str = boolean_str:lower()
if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0'
or boolean_str == '' then
boolean_value = false
else
boolean_value = true
end
elseif type( boolean_str ) == 'boolean' then
boolean_value = boolean_str
else
error( 'No boolean value found' )
end
return boolean_value
end
--[[
Helper function that escapes all pattern characters so that they will be treated
as plain text.
]]
function str._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" )
end
return str
6df794dd52434e0f6a372c9918f5a9dedd15f579
Module:List
828
20
43
42
2023-08-10T14:07:17Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
local libUtil = require('libraryUtil')
local checkType = libUtil.checkType
local mTableTools = require('Module:TableTools')
local p = {}
local listTypes = {
['bulleted'] = true,
['unbulleted'] = true,
['horizontal'] = true,
['ordered'] = true,
['horizontal_ordered'] = true
}
function p.makeListData(listType, args)
-- Constructs a data table to be passed to p.renderList.
local data = {}
-- Classes and TemplateStyles
data.classes = {}
data.templatestyles = ''
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(data.classes, 'hlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Hlist/styles.css' }
}
elseif listType == 'unbulleted' then
table.insert(data.classes, 'plainlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Plainlist/styles.css' }
}
end
table.insert(data.classes, args.class)
-- Main div style
data.style = args.style
-- Indent for horizontal lists
if listType == 'horizontal' or listType == 'horizontal_ordered' then
local indent = tonumber(args.indent)
indent = indent and indent * 1.6 or 0
if indent > 0 then
data.marginLeft = indent .. 'em'
end
end
-- List style types for ordered lists
-- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
-- type is either set by the "type" attribute or the "list-style-type" CSS
-- property.
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listStyleType = args.list_style_type or args['list-style-type']
data.type = args['type']
-- Detect invalid type attributes and attempt to convert them to
-- list-style-type CSS properties.
if data.type
and not data.listStyleType
and not tostring(data.type):find('^%s*[1AaIi]%s*$')
then
data.listStyleType = data.type
data.type = nil
end
end
-- List tag type
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listTag = 'ol'
else
data.listTag = 'ul'
end
-- Start number for ordered lists
data.start = args.start
if listType == 'horizontal_ordered' then
-- Apply fix to get start numbers working with horizontal ordered lists.
local startNum = tonumber(data.start)
if startNum then
data.counterReset = 'listitem ' .. tostring(startNum - 1)
end
end
-- List style
-- ul_style and ol_style are included for backwards compatibility. No
-- distinction is made for ordered or unordered lists.
data.listStyle = args.list_style
-- List items
-- li_style is included for backwards compatibility. item_style was included
-- to be easier to understand for non-coders.
data.itemStyle = args.item_style or args.li_style
data.items = {}
for _, num in ipairs(mTableTools.numKeys(args)) do
local item = {}
item.content = args[num]
item.style = args['item' .. tostring(num) .. '_style']
or args['item_style' .. tostring(num)]
item.value = args['item' .. tostring(num) .. '_value']
or args['item_value' .. tostring(num)]
table.insert(data.items, item)
end
return data
end
function p.renderList(data)
-- Renders the list HTML.
-- Return the blank string if there are no list items.
if type(data.items) ~= 'table' or #data.items < 1 then
return ''
end
-- Render the main div tag.
local root = mw.html.create('div')
for _, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{['margin-left'] = data.marginLeft}
if data.style then
root:cssText(data.style)
end
-- Render the list tag.
local list = root:tag(data.listTag or 'ul')
list
:attr{start = data.start, type = data.type}
:css{
['counter-reset'] = data.counterReset,
['list-style-type'] = data.listStyleType
}
if data.listStyle then
list:cssText(data.listStyle)
end
-- Render the list items
for _, t in ipairs(data.items or {}) do
local item = list:tag('li')
if data.itemStyle then
item:cssText(data.itemStyle)
end
if t.style then
item:cssText(t.style)
end
item
:attr{value = t.value}
:wikitext(t.content)
end
return data.templatestyles .. tostring(root)
end
function p.renderTrackingCategories(args)
local isDeprecated = false -- Tracks deprecated parameters.
for k, v in pairs(args) do
k = tostring(k)
if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
isDeprecated = true
break
end
end
local ret = ''
if isDeprecated then
ret = ret .. '[[Category:List templates with deprecated parameters]]'
end
return ret
end
function p.makeList(listType, args)
if not listType or not listTypes[listType] then
error(string.format(
"bad argument #1 to 'makeList' ('%s' is not a valid list type)",
tostring(listType)
), 2)
end
checkType('makeList', 2, args, 'table')
local data = p.makeListData(listType, args)
local list = p.renderList(data)
local trackingCategories = p.renderTrackingCategories(args)
return list .. trackingCategories
end
for listType in pairs(listTypes) do
p[listType] = function (frame)
local mArguments = require('Module:Arguments')
local origArgs = mArguments.getArgs(frame, {
valueFunc = function (key, value)
if not value or not mw.ustring.find(value, '%S') then return nil end
if mw.ustring.find(value, '^%s*[%*#;:]') then
return value
else
return value:match('^%s*(.-)%s*$')
end
return nil
end
})
-- Copy all the arguments to a new table, for faster indexing.
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.makeList(listType, args)
end
end
return p
7a4f36a6e9cd56370bdd8207d23694124821dc1a
Module:TableTools
828
21
45
44
2023-08-10T14:07:18Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should not --
-- be called directly from #invoke. --
------------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
function p.isPositiveInteger(v)
return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity
end
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false if
-- not. Although it doesn't operate on tables, it is included here as it is useful
-- for determining whether a value can be a valid table key. Lua will generate an
-- error if a NaN is used as a table key.
------------------------------------------------------------------------------------
function p.isNan(v)
return type(v) == 'number' and v ~= v
end
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
function p.shallowClone(t)
checkType('shallowClone', 1, t, 'table')
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
function p.removeDuplicates(arr)
checkType('removeDuplicates', 1, arr, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for _, v in ipairs(arr) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will return
-- {1, 3, 6}.
------------------------------------------------------------------------------------
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like {"foo1", "bar1", "foo2", "baz2"}, returns a table
-- of subtables in the format
-- {[1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'}}.
-- Keys that don't end with an integer are stored in a subtable named "other". The
-- compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for _ in pairs(t) do
i = i + 1
end
return i
end
local function defaultKeySort(item1, item2)
-- "number" < "string", so numbers will be sorted before strings.
local type1, type2 = type(item1), type(item2)
if type1 ~= type2 then
return type1 < type2
elseif type1 == 'table' or type1 == 'boolean' or type1 == 'function' then
return tostring(item1) < tostring(item2)
else
return item1 < item2
end
end
------------------------------------------------------------------------------------
-- keysToList
--
-- Returns an array of the keys in a table, sorted using either a default
-- comparison function or a custom keySort function.
------------------------------------------------------------------------------------
function p.keysToList(t, keySort, checked)
if not checked then
checkType('keysToList', 1, t, 'table')
checkTypeMulti('keysToList', 2, keySort, {'function', 'boolean', 'nil'})
end
local arr = {}
local index = 1
for k in pairs(t) do
arr[index] = k
index = index + 1
end
if keySort ~= false then
keySort = type(keySort) == 'function' and keySort or defaultKeySort
table.sort(arr, keySort)
end
return arr
end
------------------------------------------------------------------------------------
-- sortedPairs
--
-- Iterates through a table, with the keys sorted using the keysToList function.
-- If there are only numerical keys, sparseIpairs is probably more efficient.
------------------------------------------------------------------------------------
function p.sortedPairs(t, keySort)
checkType('sortedPairs', 1, t, 'table')
checkType('sortedPairs', 2, keySort, 'function', true)
local arr = p.keysToList(t, keySort, true)
local i = 0
return function ()
i = i + 1
local key = arr[i]
if key ~= nil then
return key, t[key]
else
return nil, nil
end
end
end
------------------------------------------------------------------------------------
-- isArray
--
-- Returns true if the given value is a table and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArray(v)
if type(v) ~= 'table' then
return false
end
local i = 0
for _ in pairs(v) do
i = i + 1
if v[i] == nil then
return false
end
end
return true
end
------------------------------------------------------------------------------------
-- isArrayLike
--
-- Returns true if the given value is iterable and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArrayLike(v)
if not pcall(pairs, v) then
return false
end
local i = 0
for _ in pairs(v) do
i = i + 1
if v[i] == nil then
return false
end
end
return true
end
------------------------------------------------------------------------------------
-- invert
--
-- Transposes the keys and values in an array. For example, {"a", "b", "c"} ->
-- {a = 1, b = 2, c = 3}. Duplicates are not supported (result values refer to
-- the index of the last duplicate) and NaN values are ignored.
------------------------------------------------------------------------------------
function p.invert(arr)
checkType("invert", 1, arr, "table")
local isNan = p.isNan
local map = {}
for i, v in ipairs(arr) do
if not isNan(v) then
map[v] = i
end
end
return map
end
------------------------------------------------------------------------------------
-- listToSet
--
-- Creates a set from the array part of the table. Indexing the set by any of the
-- values of the array returns true. For example, {"a", "b", "c"} ->
-- {a = true, b = true, c = true}. NaN values are ignored as Lua considers them
-- never equal to any value (including other NaNs or even themselves).
------------------------------------------------------------------------------------
function p.listToSet(arr)
checkType("listToSet", 1, arr, "table")
local isNan = p.isNan
local set = {}
for _, v in ipairs(arr) do
if not isNan(v) then
set[v] = true
end
end
return set
end
------------------------------------------------------------------------------------
-- deepCopy
--
-- Recursive deep copy function. Preserves identities of subtables.
------------------------------------------------------------------------------------
local function _deepCopy(orig, includeMetatable, already_seen)
-- Stores copies of tables indexed by the original table.
already_seen = already_seen or {}
local copy = already_seen[orig]
if copy ~= nil then
return copy
end
if type(orig) == 'table' then
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[_deepCopy(orig_key, includeMetatable, already_seen)] = _deepCopy(orig_value, includeMetatable, already_seen)
end
already_seen[orig] = copy
if includeMetatable then
local mt = getmetatable(orig)
if mt ~= nil then
local mt_copy = _deepCopy(mt, includeMetatable, already_seen)
setmetatable(copy, mt_copy)
already_seen[mt] = mt_copy
end
end
else -- number, string, boolean, etc
copy = orig
end
return copy
end
function p.deepCopy(orig, noMetatable, already_seen)
checkType("deepCopy", 3, already_seen, "table", true)
return _deepCopy(orig, not noMetatable, already_seen)
end
------------------------------------------------------------------------------------
-- sparseConcat
--
-- Concatenates all values in the table that are indexed by a number, in order.
-- sparseConcat{a, nil, c, d} => "acd"
-- sparseConcat{nil, b, c, d} => "bcd"
------------------------------------------------------------------------------------
function p.sparseConcat(t, sep, i, j)
local arr = {}
local arr_i = 0
for _, v in p.sparseIpairs(t) do
arr_i = arr_i + 1
arr[arr_i] = v
end
return table.concat(arr, sep, i, j)
end
------------------------------------------------------------------------------------
-- length
--
-- Finds the length of an array, or of a quasi-array with keys such as "data1",
-- "data2", etc., using an exponential search algorithm. It is similar to the
-- operator #, but may return a different value when there are gaps in the array
-- portion of the table. Intended to be used on data loaded with mw.loadData. For
-- other tables, use #.
-- Note: #frame.args in frame object always be set to 0, regardless of the number
-- of unnamed template parameters, so use this function for frame.args.
------------------------------------------------------------------------------------
function p.length(t, prefix)
-- requiring module inline so that [[Module:Exponential search]] which is
-- only needed by this one function doesn't get millions of transclusions
local expSearch = require("Module:Exponential search")
checkType('length', 1, t, 'table')
checkType('length', 2, prefix, 'string', true)
return expSearch(function (i)
local key
if prefix then
key = prefix .. tostring(i)
else
key = i
end
return t[key] ~= nil
end) or 0
end
------------------------------------------------------------------------------------
-- inArray
--
-- Returns true if valueToFind is a member of the array, and false otherwise.
------------------------------------------------------------------------------------
function p.inArray(arr, valueToFind)
checkType("inArray", 1, arr, "table")
-- if valueToFind is nil, error?
for _, v in ipairs(arr) do
if v == valueToFind then
return true
end
end
return false
end
return p
085e7094ac84eb0132ee65822cf3f69cd8ba3d81
Template:Tlx
10
22
47
46
2023-08-10T14:07:18Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
#REDIRECT [[Template:Template link expanded]]
{{Redirect category shell|
{{R from move}}
}}
1fec988ceb46cb324af228aac45d7cd25fcc9008
Template:Template link expanded
10
23
49
48
2023-08-10T14:07:18Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{#Invoke:Template link general|main|code=on}}<noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlx}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
6c99696fee02f1da368ed20d2504e19bc15b1c13
Module:Template link general
828
24
51
50
2023-08-10T14:07:19Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- This implements Template:Tlg
local getArgs = require('Module:Arguments').getArgs
local p = {}
-- Is a string non-empty?
local function _ne(s)
return s ~= nil and s ~= ""
end
local nw = mw.text.nowiki
local function addTemplate(s)
local i, _ = s:find(':', 1, true)
if i == nil then
return 'Template:' .. s
end
local ns = s:sub(1, i - 1)
if ns == '' or mw.site.namespaces[ns] then
return s
else
return 'Template:' .. s
end
end
local function trimTemplate(s)
local needle = 'template:'
if s:sub(1, needle:len()):lower() == needle then
return s:sub(needle:len() + 1)
else
return s
end
end
local function linkTitle(args)
if _ne(args.nolink) then
return args['1']
end
local titleObj
local titlePart = '[['
if args['1'] then
-- This handles :Page and other NS
titleObj = mw.title.new(args['1'], 'Template')
else
titleObj = mw.title.getCurrentTitle()
end
titlePart = titlePart .. (titleObj ~= nil and titleObj.fullText or
addTemplate(args['1']))
local textPart = args.alttext
if not _ne(textPart) then
if titleObj ~= nil then
textPart = titleObj:inNamespace("Template") and args['1'] or titleObj.fullText
else
-- redlink
textPart = args['1']
end
end
if _ne(args.subst) then
-- HACK: the ns thing above is probably broken
textPart = 'subst:' .. textPart
end
if _ne(args.brace) then
textPart = nw('{{') .. textPart .. nw('}}')
elseif _ne(args.braceinside) then
textPart = nw('{') .. textPart .. nw('}')
end
titlePart = titlePart .. '|' .. textPart .. ']]'
if _ne(args.braceinside) then
titlePart = nw('{') .. titlePart .. nw('}')
end
return titlePart
end
function p.main(frame)
local args = getArgs(frame, {
trim = true,
removeBlanks = false
})
return p._main(args)
end
function p._main(args)
local bold = _ne(args.bold) or _ne(args.boldlink) or _ne(args.boldname)
local italic = _ne(args.italic) or _ne(args.italics)
local dontBrace = _ne(args.brace) or _ne(args.braceinside)
local code = _ne(args.code) or _ne(args.tt)
local show_result = _ne(args._show_result)
local expand = _ne(args._expand)
-- Build the link part
local titlePart = linkTitle(args)
if bold then titlePart = "'''" .. titlePart .. "'''" end
if _ne(args.nowrapname) then titlePart = '<span class="nowrap">' .. titlePart .. '</span>' end
-- Build the arguments
local textPart = ""
local textPartBuffer = "|"
local codeArguments = {}
local codeArgumentsString = ""
local i = 2
local j = 1
while args[i] do
local val = args[i]
if val ~= "" then
if _ne(args.nowiki) then
-- Unstrip nowiki tags first because calling nw on something that already contains nowiki tags will
-- mangle the nowiki strip marker and result in literal UNIQ...QINU showing up
val = nw(mw.text.unstripNoWiki(val))
end
local k, v = string.match(val, "(.*)=(.*)")
if not k then
codeArguments[j] = val
j = j + 1
else
codeArguments[k] = v
end
codeArgumentsString = codeArgumentsString .. textPartBuffer .. val
if italic then
val = '<span style="font-style:italic;">' .. val .. '</span>'
end
textPart = textPart .. textPartBuffer .. val
end
i = i + 1
end
-- final wrap
local ret = titlePart .. textPart
if not dontBrace then ret = nw('{{') .. ret .. nw('}}') end
if _ne(args.a) then ret = nw('*') .. ' ' .. ret end
if _ne(args.kbd) then ret = '<kbd>' .. ret .. '</kbd>' end
if code then
ret = '<code>' .. ret .. '</code>'
elseif _ne(args.plaincode) then
ret = '<code style="border:none;background:transparent;">' .. ret .. '</code>'
end
if _ne(args.nowrap) then ret = '<span class="nowrap">' .. ret .. '</span>' end
--[[ Wrap as html??
local span = mw.html.create('span')
span:wikitext(ret)
--]]
if _ne(args.debug) then ret = ret .. '\n<pre>' .. mw.text.encode(mw.dumpObject(args)) .. '</pre>' end
if show_result then
local result = mw.getCurrentFrame():expandTemplate{title = addTemplate(args[1]), args = codeArguments}
ret = ret .. " → " .. result
end
if expand then
local query = mw.text.encode('{{' .. addTemplate(args[1]) .. string.gsub(codeArgumentsString, textPartBuffer, "|") .. '}}')
local url = mw.uri.fullUrl('special:ExpandTemplates', 'wpInput=' .. query)
mw.log()
ret = ret .. " [" .. tostring(url) .. "]"
end
return ret
end
return p
c7307fa3959d308a2dd7fd2f5009c1ce6db3d122
Template:Template other
10
25
53
52
2023-08-10T14:07:20Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Template}}
| template
| other
}}
}}
| template = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
06fb13d264df967b5232141067eb7d2b67372d76
Module:Effective protection expiry
828
26
55
54
2023-08-10T14:07:20Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
local p = {}
-- Returns the expiry of a restriction of an action on a given title, or unknown if it cannot be known.
-- If no title is specified, the title of the page being displayed is used.
function p._main(action, pagename)
local title
if type(pagename) == 'table' and pagename.prefixedText then
title = pagename
elseif pagename then
title = mw.title.new(pagename)
else
title = mw.title.getCurrentTitle()
end
pagename = title.prefixedText
if action == 'autoreview' then
local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title)
return stabilitySettings and stabilitySettings.expiry or 'unknown'
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then
error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )
end
local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename)
if rawExpiry == 'infinity' then
return 'infinity'
elseif rawExpiry == '' then
return 'unknown'
else
local year, month, day, hour, minute, second = rawExpiry:match(
'^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$'
)
if year then
return string.format(
'%s-%s-%sT%s:%s:%s',
year, month, day, hour, minute, second
)
else
error('internal error in Module:Effective protection expiry; malformed expiry timestamp')
end
end
end
setmetatable(p, { __index = function(t, k)
return function(frame)
return t._main(k, frame.args[1])
end
end })
return p
9a8c58dc2667232ed08a9b206a5d89ca8150312b
Module:Effective protection level
828
27
57
56
2023-08-10T14:07:21Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
local p = {}
-- Returns the permission required to perform a given action on a given title.
-- If no title is specified, the title of the page being displayed is used.
function p._main(action, pagename)
local title
if type(pagename) == 'table' and pagename.prefixedText then
title = pagename
elseif pagename then
title = mw.title.new(pagename)
else
title = mw.title.getCurrentTitle()
end
pagename = title.prefixedText
if action == 'autoreview' then
local level = mw.ext.FlaggedRevs.getStabilitySettings(title)
level = level and level.autoreview
if level == 'review' then
return 'reviewer'
elseif level ~= '' then
return level
else
return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review
end
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' and action ~= 'undelete' then
error( 'First parameter must be one of edit, move, create, upload, undelete, autoreview', 2 )
end
if title.namespace == 8 then -- MediaWiki namespace
if title.text:sub(-3) == '.js' or title.text:sub(-4) == '.css' or title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page
return 'interfaceadmin'
else -- any non-JS/CSS MediaWiki page
return 'sysop'
end
elseif title.namespace == 2 and title.isSubpage then
if title.contentModel == 'javascript' or title.contentModel == 'css' then -- user JS or CSS page
return 'interfaceadmin'
elseif title.contentModel == 'json' then -- user JSON page
return 'sysop'
end
end
if action == 'undelete' then
return 'sysop'
end
local level = title.protectionLevels[action] and title.protectionLevels[action][1]
if level == 'sysop' or level == 'editprotected' then
return 'sysop'
elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page
return 'sysop'
elseif level == 'templateeditor' then
return 'templateeditor'
elseif action == 'move' then
local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move.
if blacklistentry and not blacklistentry.params.autoconfirmed then
return 'templateeditor'
elseif title.namespace == 6 then
return 'filemover'
elseif level == 'extendedconfirmed' then
return 'extendedconfirmed'
else
return 'autoconfirmed'
end
end
local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)
if blacklistentry then
if not blacklistentry.params.autoconfirmed then
return 'templateeditor'
elseif level == 'extendedconfirmed' then
return 'extendedconfirmed'
else
return 'autoconfirmed'
end
elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason
return 'autoconfirmed'
elseif level then
return level
elseif action == 'upload' then
return 'autoconfirmed'
elseif action == 'create' and title.namespace % 2 == 0 and title.namespace ~= 118 then -- You need to be registered, but not autoconfirmed, to create non-talk pages other than drafts
return 'user'
else
return '*'
end
end
setmetatable(p, { __index = function(t, k)
return function(frame)
return t._main(k, frame.args[1])
end
end })
return p
70256a489edf6be9808031b14a7e3ef3e025da97
Module:File link
828
28
59
58
2023-08-10T14:07:21Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- This module provides a library for formatting file wikilinks.
local yesno = require('Module:Yesno')
local checkType = require('libraryUtil').checkType
local p = {}
function p._main(args)
checkType('_main', 1, args, 'table')
-- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our
-- own function to get the right error level.
local function checkArg(key, val, level)
if type(val) ~= 'string' then
error(string.format(
"type error in '%s' parameter of '_main' (expected string, got %s)",
key, type(val)
), level)
end
end
local ret = {}
-- Adds a positional parameter to the buffer.
local function addPositional(key)
local val = args[key]
if not val then
return nil
end
checkArg(key, val, 4)
ret[#ret + 1] = val
end
-- Adds a named parameter to the buffer. We assume that the parameter name
-- is the same as the argument key.
local function addNamed(key)
local val = args[key]
if not val then
return nil
end
checkArg(key, val, 4)
ret[#ret + 1] = key .. '=' .. val
end
-- Filename
checkArg('file', args.file, 3)
ret[#ret + 1] = 'File:' .. args.file
-- Format
if args.format then
checkArg('format', args.format)
if args.formatfile then
checkArg('formatfile', args.formatfile)
ret[#ret + 1] = args.format .. '=' .. args.formatfile
else
ret[#ret + 1] = args.format
end
end
-- Border
if yesno(args.border) then
ret[#ret + 1] = 'border'
end
addPositional('location')
addPositional('alignment')
addPositional('size')
addNamed('upright')
addNamed('link')
addNamed('alt')
addNamed('page')
addNamed('class')
addNamed('lang')
addNamed('start')
addNamed('end')
addNamed('thumbtime')
addPositional('caption')
return string.format('[[%s]]', table.concat(ret, '|'))
end
function p.main(frame)
local origArgs = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:File link'
})
if not origArgs.file then
error("'file' parameter missing from [[Template:File link]]", 0)
end
-- Copy the arguments that were passed to a new table to avoid looking up
-- every possible parameter in the frame object.
local args = {}
for k, v in pairs(origArgs) do
-- Make _BLANK a special argument to add a blank parameter. For use in
-- conditional templates etc. it is useful for blank arguments to be
-- ignored, but we still need a way to specify them so that we can do
-- things like [[File:Example.png|link=]].
if v == '_BLANK' then
v = ''
end
args[k] = v
end
return p._main(args)
end
return p
66925f088d11530f2482f04181a3baaaa0ad3d0c
Module:Hatnote
828
29
61
60
2023-08-10T14:07:21Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote --
-- --
-- This module produces hatnote links and links to related articles. It --
-- implements the {{hatnote}} and {{format link}} meta-templates and includes --
-- helper functions for other Lua hatnote modules. --
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local yesno -- lazily initialise [[Module:Yesno]]
local formatLink -- lazily initialise [[Module:Format link]] ._formatLink
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
function p.defaultClasses(inline)
-- Provides the default hatnote classes as a space-separated string; useful
-- for hatnote-manipulation modules like [[Module:Hatnote group]].
return
(inline == 1 and 'hatnote-inline' or 'hatnote') .. ' ' ..
'navigation-not-searchable'
end
function p.disambiguate(page, disambiguator)
-- Formats a page title with a disambiguation parenthetical,
-- i.e. "Example" → "Example (disambiguation)".
checkType('disambiguate', 1, page, 'string')
checkType('disambiguate', 2, disambiguator, 'string', true)
disambiguator = disambiguator or 'disambiguation'
return mw.ustring.format('%s (%s)', page, disambiguator)
end
function p.findNamespaceId(link, removeColon)
-- Finds the namespace id (namespace number) of a link or a pagename. This
-- function will not work if the link is enclosed in double brackets. Colons
-- are trimmed from the start of the link by default. To skip colon
-- trimming, set the removeColon parameter to false.
checkType('findNamespaceId', 1, link, 'string')
checkType('findNamespaceId', 2, removeColon, 'boolean', true)
if removeColon ~= false then
link = removeInitialColon(link)
end
local namespace = link:match('^(.-):')
if namespace then
local nsTable = mw.site.namespaces[namespace]
if nsTable then
return nsTable.id
end
end
return 0
end
function p.makeWikitextError(msg, helpLink, addTrackingCategory, title)
-- Formats an error message to be returned to wikitext. If
-- addTrackingCategory is not false after being returned from
-- [[Module:Yesno]], and if we are not on a talk page, a tracking category
-- is added.
checkType('makeWikitextError', 1, msg, 'string')
checkType('makeWikitextError', 2, helpLink, 'string', true)
yesno = require('Module:Yesno')
title = title or mw.title.getCurrentTitle()
-- Make the help link text.
local helpText
if helpLink then
helpText = ' ([[' .. helpLink .. '|help]])'
else
helpText = ''
end
-- Make the category text.
local category
if not title.isTalkPage -- Don't categorise talk pages
and title.namespace ~= 2 -- Don't categorise userspace
and yesno(addTrackingCategory) ~= false -- Allow opting out
then
category = 'Hatnote templates with errors'
category = mw.ustring.format(
'[[%s:%s]]',
mw.site.namespaces[14].name,
category
)
else
category = ''
end
return mw.ustring.format(
'<strong class="error">Error: %s%s.</strong>%s',
msg,
helpText,
category
)
end
local curNs = mw.title.getCurrentTitle().namespace
p.missingTargetCat =
--Default missing target category, exported for use in related modules
((curNs == 0) or (curNs == 14)) and
'Articles with hatnote templates targeting a nonexistent page' or nil
function p.quote(title)
--Wraps titles in quotation marks. If the title starts/ends with a quotation
--mark, kerns that side as with {{-'}}
local quotationMarks = {
["'"]=true, ['"']=true, ['“']=true, ["‘"]=true, ['”']=true, ["’"]=true
}
local quoteLeft, quoteRight = -- Test if start/end are quotation marks
quotationMarks[string.sub(title, 1, 1)],
quotationMarks[string.sub(title, -1, -1)]
if quoteLeft or quoteRight then
title = mw.html.create("span"):wikitext(title)
end
if quoteLeft then title:css("padding-left", "0.15em") end
if quoteRight then title:css("padding-right", "0.15em") end
return '"' .. tostring(title) .. '"'
end
--------------------------------------------------------------------------------
-- Hatnote
--
-- Produces standard hatnote text. Implements the {{hatnote}} template.
--------------------------------------------------------------------------------
function p.hatnote(frame)
local args = getArgs(frame)
local s = args[1]
if not s then
return p.makeWikitextError(
'no text specified',
'Template:Hatnote#Errors',
args.category
)
end
return p._hatnote(s, {
extraclasses = args.extraclasses,
selfref = args.selfref
})
end
function p._hatnote(s, options)
checkType('_hatnote', 1, s, 'string')
checkType('_hatnote', 2, options, 'table', true)
options = options or {}
local inline = options.inline
local hatnote = mw.html.create(inline == 1 and 'span' or 'div')
local extraclasses
if type(options.extraclasses) == 'string' then
extraclasses = options.extraclasses
end
hatnote
:attr('role', 'note')
:addClass(p.defaultClasses(inline))
:addClass(extraclasses)
:addClass(options.selfref and 'selfref' or nil)
:wikitext(s)
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Hatnote/styles.css' }
} .. tostring(hatnote)
end
return p
3ae1ed7094c5005ca0896395ec9a587287a0bef1
Module:Hatnote/styles.css
828
30
63
62
2023-08-10T14:07:22Z
InsaneX
2
1 revision imported: Importing Short description
text
text/plain
/* {{pp|small=y}} */
.hatnote {
font-style: italic;
}
/* Limit structure CSS to divs because of [[Module:Hatnote inline]] */
div.hatnote {
/* @noflip */
padding-left: 1.6em;
margin-bottom: 0.5em;
}
.hatnote i {
font-style: normal;
}
/* The templatestyles element inserts a link element before hatnotes.
* TODO: Remove link if/when WMF resolves T200206 */
.hatnote + link + .hatnote {
margin-top: -0.5em;
}
44680ffd6e888866df2cdfa0341af9c7b97da94c
Module:Wd
828
31
65
64
2023-08-10T14:07:23Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- Original module located at [[:en:Module:Wd]] and [[:en:Module:Wd/i18n]].
require("strict")
local p = {}
local arg = ...
local i18n
local function loadI18n(aliasesP, frame)
local title
if frame then
-- current module invoked by page/template, get its title from frame
title = frame:getTitle()
else
-- current module included by other module, get its title from ...
title = arg
end
if not i18n then
i18n = require(title .. "/i18n").init(aliasesP)
end
end
p.claimCommands = {
property = "property",
properties = "properties",
qualifier = "qualifier",
qualifiers = "qualifiers",
reference = "reference",
references = "references"
}
p.generalCommands = {
label = "label",
title = "title",
description = "description",
alias = "alias",
aliases = "aliases",
badge = "badge",
badges = "badges"
}
p.flags = {
linked = "linked",
short = "short",
raw = "raw",
multilanguage = "multilanguage",
unit = "unit",
-------------
preferred = "preferred",
normal = "normal",
deprecated = "deprecated",
best = "best",
future = "future",
current = "current",
former = "former",
edit = "edit",
editAtEnd = "edit@end",
mdy = "mdy",
single = "single",
sourced = "sourced"
}
p.args = {
eid = "eid",
page = "page",
date = "date"
}
local aliasesP = {
coord = "P625",
-----------------------
image = "P18",
author = "P50",
authorNameString = "P2093",
publisher = "P123",
importedFrom = "P143",
wikimediaImportURL = "P4656",
statedIn = "P248",
pages = "P304",
language = "P407",
hasPart = "P527",
publicationDate = "P577",
startTime = "P580",
endTime = "P582",
chapter = "P792",
retrieved = "P813",
referenceURL = "P854",
sectionVerseOrParagraph = "P958",
archiveURL = "P1065",
title = "P1476",
formatterURL = "P1630",
quote = "P1683",
shortName = "P1813",
definingFormula = "P2534",
archiveDate = "P2960",
inferredFrom = "P3452",
typeOfReference = "P3865",
column = "P3903",
subjectNamedAs = "P1810",
wikidataProperty = "P1687",
publishedIn = "P1433"
}
local aliasesQ = {
percentage = "Q11229",
prolepticJulianCalendar = "Q1985786",
citeWeb = "Q5637226",
citeQ = "Q22321052"
}
local parameters = {
property = "%p",
qualifier = "%q",
reference = "%r",
alias = "%a",
badge = "%b",
separator = "%s",
general = "%x"
}
local formats = {
property = "%p[%s][%r]",
qualifier = "%q[%s][%r]",
reference = "%r",
propertyWithQualifier = "%p[ <span style=\"font-size:85\\%\">(%q)</span>][%s][%r]",
alias = "%a[%s]",
badge = "%b[%s]"
}
local hookNames = { -- {level_1, level_2}
[parameters.property] = {"getProperty"},
[parameters.reference] = {"getReferences", "getReference"},
[parameters.qualifier] = {"getAllQualifiers"},
[parameters.qualifier.."\\d"] = {"getQualifiers", "getQualifier"},
[parameters.alias] = {"getAlias"},
[parameters.badge] = {"getBadge"}
}
-- default value objects, should NOT be mutated but instead copied
local defaultSeparators = {
["sep"] = {" "},
["sep%s"] = {","},
["sep%q"] = {"; "},
["sep%q\\d"] = {", "},
["sep%r"] = nil, -- none
["punc"] = nil -- none
}
local rankTable = {
["preferred"] = 1,
["normal"] = 2,
["deprecated"] = 3
}
local function replaceAlias(id)
if aliasesP[id] then
id = aliasesP[id]
end
return id
end
local function errorText(code, param)
local text = i18n["errors"][code]
if param then text = mw.ustring.gsub(text, "$1", param) end
return text
end
local function throwError(errorMessage, param)
error(errorText(errorMessage, param))
end
local function replaceDecimalMark(num)
return mw.ustring.gsub(num, "[.]", i18n['numeric']['decimal-mark'], 1)
end
local function padZeros(num, numDigits)
local numZeros
local negative = false
if num < 0 then
negative = true
num = num * -1
end
num = tostring(num)
numZeros = numDigits - num:len()
for _ = 1, numZeros do
num = "0"..num
end
if negative then
num = "-"..num
end
return num
end
local function replaceSpecialChar(chr)
if chr == '_' then
-- replace underscores with spaces
return ' '
else
return chr
end
end
local function replaceSpecialChars(str)
local chr
local esc = false
local strOut = ""
for i = 1, #str do
chr = str:sub(i,i)
if not esc then
if chr == '\\' then
esc = true
else
strOut = strOut .. replaceSpecialChar(chr)
end
else
strOut = strOut .. chr
esc = false
end
end
return strOut
end
local function buildWikilink(target, label)
if not label or target == label then
return "[[" .. target .. "]]"
else
return "[[" .. target .. "|" .. label .. "]]"
end
end
-- used to make frame.args mutable, to replace #frame.args (which is always 0)
-- with the actual amount and to simply copy tables
local function copyTable(tIn)
if not tIn then
return nil
end
local tOut = {}
for i, v in pairs(tIn) do
tOut[i] = v
end
return tOut
end
-- used to merge output arrays together;
-- note that it currently mutates the first input array
local function mergeArrays(a1, a2)
for i = 1, #a2 do
a1[#a1 + 1] = a2[i]
end
return a1
end
local function split(str, del)
local out = {}
local i, j = str:find(del)
if i and j then
out[1] = str:sub(1, i - 1)
out[2] = str:sub(j + 1)
else
out[1] = str
end
return out
end
local function parseWikidataURL(url)
local id
if url:match('^http[s]?://') then
id = split(url, "Q")
if id[2] then
return "Q" .. id[2]
end
end
return nil
end
local function parseDate(dateStr, precision)
precision = precision or "d"
local i, j, index, ptr
local parts = {nil, nil, nil}
if dateStr == nil then
return parts[1], parts[2], parts[3] -- year, month, day
end
-- 'T' for snak values, '/' for outputs with '/Julian' attached
i, j = dateStr:find("[T/]")
if i then
dateStr = dateStr:sub(1, i-1)
end
local from = 1
if dateStr:sub(1,1) == "-" then
-- this is a negative number, look further ahead
from = 2
end
index = 1
ptr = 1
i, j = dateStr:find("-", from)
if i then
-- year
parts[index] = tonumber(dateStr:sub(ptr, i-1), 10) -- explicitly give base 10 to prevent error
if parts[index] == -0 then
parts[index] = tonumber("0") -- for some reason, 'parts[index] = 0' may actually store '-0', so parse from string instead
end
if precision == "y" then
-- we're done
return parts[1], parts[2], parts[3] -- year, month, day
end
index = index + 1
ptr = i + 1
i, j = dateStr:find("-", ptr)
if i then
-- month
parts[index] = tonumber(dateStr:sub(ptr, i-1), 10)
if precision == "m" then
-- we're done
return parts[1], parts[2], parts[3] -- year, month, day
end
index = index + 1
ptr = i + 1
end
end
if dateStr:sub(ptr) ~= "" then
-- day if we have month, month if we have year, or year
parts[index] = tonumber(dateStr:sub(ptr), 10)
end
return parts[1], parts[2], parts[3] -- year, month, day
end
local function datePrecedesDate(aY, aM, aD, bY, bM, bD)
if aY == nil or bY == nil then
return nil
end
aM = aM or 1
aD = aD or 1
bM = bM or 1
bD = bD or 1
if aY < bY then
return true
end
if aY > bY then
return false
end
if aM < bM then
return true
end
if aM > bM then
return false
end
if aD < bD then
return true
end
return false
end
local function getHookName(param, index)
if hookNames[param] then
return hookNames[param][index]
elseif param:len() > 2 then
return hookNames[param:sub(1, 2).."\\d"][index]
else
return nil
end
end
local function alwaysTrue()
return true
end
-- The following function parses a format string.
--
-- The example below shows how a parsed string is structured in memory.
-- Variables other than 'str' and 'child' are left out for clarity's sake.
--
-- Example:
-- "A %p B [%s[%q1]] C [%r] D"
--
-- Structure:
-- [
-- {
-- str = "A "
-- },
-- {
-- str = "%p"
-- },
-- {
-- str = " B ",
-- child =
-- [
-- {
-- str = "%s",
-- child =
-- [
-- {
-- str = "%q1"
-- }
-- ]
-- }
-- ]
-- },
-- {
-- str = " C ",
-- child =
-- [
-- {
-- str = "%r"
-- }
-- ]
-- },
-- {
-- str = " D"
-- }
-- ]
--
local function parseFormat(str)
local chr, esc, param, root, cur, prev, new
local params = {}
local function newObject(array)
local obj = {} -- new object
obj.str = ""
array[#array + 1] = obj -- array{object}
obj.parent = array
return obj
end
local function endParam()
if param > 0 then
if cur.str ~= "" then
cur.str = "%"..cur.str
cur.param = true
params[cur.str] = true
cur.parent.req[cur.str] = true
prev = cur
cur = newObject(cur.parent)
end
param = 0
end
end
root = {} -- array
root.req = {}
cur = newObject(root)
prev = nil
esc = false
param = 0
for i = 1, #str do
chr = str:sub(i,i)
if not esc then
if chr == '\\' then
endParam()
esc = true
elseif chr == '%' then
endParam()
if cur.str ~= "" then
cur = newObject(cur.parent)
end
param = 2
elseif chr == '[' then
endParam()
if prev and cur.str == "" then
table.remove(cur.parent)
cur = prev
end
cur.child = {} -- new array
cur.child.req = {}
cur.child.parent = cur
cur = newObject(cur.child)
elseif chr == ']' then
endParam()
if cur.parent.parent then
new = newObject(cur.parent.parent.parent)
if cur.str == "" then
table.remove(cur.parent)
end
cur = new
end
else
if param > 1 then
param = param - 1
elseif param == 1 then
if not chr:match('%d') then
endParam()
end
end
cur.str = cur.str .. replaceSpecialChar(chr)
end
else
cur.str = cur.str .. chr
esc = false
end
prev = nil
end
endParam()
-- make sure that at least one required parameter has been defined
if not next(root.req) then
throwError("missing-required-parameter")
end
-- make sure that the separator parameter "%s" is not amongst the required parameters
if root.req[parameters.separator] then
throwError("extra-required-parameter", parameters.separator)
end
return root, params
end
local function sortOnRank(claims)
local rankPos
local ranks = {{}, {}, {}, {}} -- preferred, normal, deprecated, (default)
local sorted = {}
for _, v in ipairs(claims) do
rankPos = rankTable[v.rank] or 4
ranks[rankPos][#ranks[rankPos] + 1] = v
end
sorted = ranks[1]
sorted = mergeArrays(sorted, ranks[2])
sorted = mergeArrays(sorted, ranks[3])
return sorted
end
local Config = {}
-- allows for recursive calls
function Config:new()
local cfg = {}
setmetatable(cfg, self)
self.__index = self
cfg.separators = {
-- single value objects wrapped in arrays so that we can pass by reference
["sep"] = {copyTable(defaultSeparators["sep"])},
["sep%s"] = {copyTable(defaultSeparators["sep%s"])},
["sep%q"] = {copyTable(defaultSeparators["sep%q"])},
["sep%r"] = {copyTable(defaultSeparators["sep%r"])},
["punc"] = {copyTable(defaultSeparators["punc"])}
}
cfg.entity = nil
cfg.entityID = nil
cfg.propertyID = nil
cfg.propertyValue = nil
cfg.qualifierIDs = {}
cfg.qualifierIDsAndValues = {}
cfg.bestRank = true
cfg.ranks = {true, true, false} -- preferred = true, normal = true, deprecated = false
cfg.foundRank = #cfg.ranks
cfg.flagBest = false
cfg.flagRank = false
cfg.periods = {true, true, true} -- future = true, current = true, former = true
cfg.flagPeriod = false
cfg.atDate = {parseDate(os.date('!%Y-%m-%d'))} -- today as {year, month, day}
cfg.mdyDate = false
cfg.singleClaim = false
cfg.sourcedOnly = false
cfg.editable = false
cfg.editAtEnd = false
cfg.inSitelinks = false
cfg.langCode = mw.language.getContentLanguage().code
cfg.langName = mw.language.fetchLanguageName(cfg.langCode, cfg.langCode)
cfg.langObj = mw.language.new(cfg.langCode)
cfg.siteID = mw.wikibase.getGlobalSiteId()
cfg.states = {}
cfg.states.qualifiersCount = 0
cfg.curState = nil
cfg.prefetchedRefs = nil
return cfg
end
local State = {}
function State:new(cfg, type)
local stt = {}
setmetatable(stt, self)
self.__index = self
stt.conf = cfg
stt.type = type
stt.results = {}
stt.parsedFormat = {}
stt.separator = {}
stt.movSeparator = {}
stt.puncMark = {}
stt.linked = false
stt.rawValue = false
stt.shortName = false
stt.anyLanguage = false
stt.unitOnly = false
stt.singleValue = false
return stt
end
-- if id == nil then item connected to current page is used
function Config:getLabel(id, raw, link, short)
local label = nil
local prefix, title= "", nil
if not id then
id = mw.wikibase.getEntityIdForCurrentPage()
if not id then
return ""
end
end
id = id:upper() -- just to be sure
if raw then
-- check if given id actually exists
if mw.wikibase.isValidEntityId(id) and mw.wikibase.entityExists(id) then
label = id
end
prefix, title = "d:Special:EntityPage/", label -- may be nil
else
-- try short name first if requested
if short then
label = p._property{aliasesP.shortName, [p.args.eid] = id} -- get short name
if label == "" then
label = nil
end
end
-- get label
if not label then
label = mw.wikibase.getLabelByLang(id, self.langCode) -- XXX: should use fallback labels?
end
end
if not label then
label = ""
elseif link then
-- build a link if requested
if not title then
if id:sub(1,1) == "Q" then
title = mw.wikibase.getSitelink(id)
elseif id:sub(1,1) == "P" then
-- properties have no sitelink, link to Wikidata instead
prefix, title = "d:Special:EntityPage/", id
end
end
label = mw.text.nowiki(label) -- escape raw label text so it cannot be wikitext markup
if title then
label = buildWikilink(prefix .. title, label)
end
end
return label
end
function Config:getEditIcon()
local value = ""
local prefix = ""
local front = " "
local back = ""
if self.entityID:sub(1,1) == "P" then
prefix = "Property:"
end
if self.editAtEnd then
front = '<span style="float:'
if self.langObj:isRTL() then
front = front .. 'left'
else
front = front .. 'right'
end
front = front .. '">'
back = '</span>'
end
value = "[[File:OOjs UI icon edit-ltr-progressive.svg|frameless|text-top|10px|alt=" .. i18n['info']['edit-on-wikidata'] .. "|link=https://www.wikidata.org/wiki/" .. prefix .. self.entityID .. "?uselang=" .. self.langCode
if self.propertyID then
value = value .. "#" .. self.propertyID
elseif self.inSitelinks then
value = value .. "#sitelinks-wikipedia"
end
value = value .. "|" .. i18n['info']['edit-on-wikidata'] .. "]]"
return front .. value .. back
end
-- used to create the final output string when it's all done, so that for references the
-- function extensionTag("ref", ...) is only called when they really ended up in the final output
function Config:concatValues(valuesArray)
local outString = ""
local j, skip
for i = 1, #valuesArray do
-- check if this is a reference
if valuesArray[i].refHash then
j = i - 1
skip = false
-- skip this reference if it is part of a continuous row of references that already contains the exact same reference
while valuesArray[j] and valuesArray[j].refHash do
if valuesArray[i].refHash == valuesArray[j].refHash then
skip = true
break
end
j = j - 1
end
if not skip then
-- add <ref> tag with the reference's hash as its name (to deduplicate references)
outString = outString .. mw.getCurrentFrame():extensionTag("ref", valuesArray[i][1], {name = valuesArray[i].refHash})
end
else
outString = outString .. valuesArray[i][1]
end
end
return outString
end
function Config:convertUnit(unit, raw, link, short, unitOnly)
local space = " "
local label = ""
local itemID
if unit == "" or unit == "1" then
return nil
end
if unitOnly then
space = ""
end
itemID = parseWikidataURL(unit)
if itemID then
if itemID == aliasesQ.percentage then
return "%"
else
label = self:getLabel(itemID, raw, link, short)
if label ~= "" then
return space .. label
end
end
end
return ""
end
function State:getValue(snak)
return self.conf:getValue(snak, self.rawValue, self.linked, self.shortName, self.anyLanguage, self.unitOnly, false, self.type:sub(1,2))
end
function Config:getValue(snak, raw, link, short, anyLang, unitOnly, noSpecial, type)
if snak.snaktype == 'value' then
local datatype = snak.datavalue.type
local subtype = snak.datatype
local datavalue = snak.datavalue.value
if datatype == 'string' then
if subtype == 'url' and link then
-- create link explicitly
if raw then
-- will render as a linked number like [1]
return "[" .. datavalue .. "]"
else
return "[" .. datavalue .. " " .. datavalue .. "]"
end
elseif subtype == 'commonsMedia' then
if link then
return buildWikilink("c:File:" .. datavalue, datavalue)
elseif not raw then
return "[[File:" .. datavalue .. "]]"
else
return datavalue
end
elseif subtype == 'geo-shape' and link then
return buildWikilink("c:" .. datavalue, datavalue)
elseif subtype == 'math' and not raw then
local attribute = nil
if (type == parameters.property or (type == parameters.qualifier and self.propertyID == aliasesP.hasPart)) and snak.property == aliasesP.definingFormula then
attribute = {qid = self.entityID}
end
return mw.getCurrentFrame():extensionTag("math", datavalue, attribute)
elseif subtype == 'external-id' and link then
local url = p._property{aliasesP.formatterURL, [p.args.eid] = snak.property} -- get formatter URL
if url ~= "" then
url = mw.ustring.gsub(url, "$1", datavalue)
return "[" .. url .. " " .. datavalue .. "]"
else
return datavalue
end
else
return datavalue
end
elseif datatype == 'monolingualtext' then
if anyLang or datavalue['language'] == self.langCode then
return datavalue['text']
else
return nil
end
elseif datatype == 'quantity' then
local value = ""
local unit
if not unitOnly then
-- get value and strip + signs from front
value = mw.ustring.gsub(datavalue['amount'], "^%+(.+)$", "%1")
if raw then
return value
end
-- replace decimal mark based on locale
value = replaceDecimalMark(value)
-- add delimiters for readability
value = i18n.addDelimiters(value)
end
unit = self:convertUnit(datavalue['unit'], raw, link, short, unitOnly)
if unit then
value = value .. unit
end
return value
elseif datatype == 'time' then
local y, m, d, p, yDiv, yRound, yFull, value, calendarID, dateStr
local yFactor = 1
local sign = 1
local prefix = ""
local suffix = ""
local mayAddCalendar = false
local calendar = ""
local precision = datavalue['precision']
if precision == 11 then
p = "d"
elseif precision == 10 then
p = "m"
else
p = "y"
yFactor = 10^(9-precision)
end
y, m, d = parseDate(datavalue['time'], p)
if y < 0 then
sign = -1
y = y * sign
end
-- if precision is tens/hundreds/thousands/millions/billions of years
if precision <= 8 then
yDiv = y / yFactor
-- if precision is tens/hundreds/thousands of years
if precision >= 6 then
mayAddCalendar = true
if precision <= 7 then
-- round centuries/millenniums up (e.g. 20th century or 3rd millennium)
yRound = math.ceil(yDiv)
if not raw then
if precision == 6 then
suffix = i18n['datetime']['suffixes']['millennium']
else
suffix = i18n['datetime']['suffixes']['century']
end
suffix = i18n.getOrdinalSuffix(yRound) .. suffix
else
-- if not verbose, take the first year of the century/millennium
-- (e.g. 1901 for 20th century or 2001 for 3rd millennium)
yRound = (yRound - 1) * yFactor + 1
end
else
-- precision == 8
-- round decades down (e.g. 2010s)
yRound = math.floor(yDiv) * yFactor
if not raw then
prefix = i18n['datetime']['prefixes']['decade-period']
suffix = i18n['datetime']['suffixes']['decade-period']
end
end
if raw and sign < 0 then
-- if BCE then compensate for "counting backwards"
-- (e.g. -2019 for 2010s BCE, -2000 for 20th century BCE or -3000 for 3rd millennium BCE)
yRound = yRound + yFactor - 1
end
else
local yReFactor, yReDiv, yReRound
-- round to nearest for tens of thousands of years or more
yRound = math.floor(yDiv + 0.5)
if yRound == 0 then
if precision <= 2 and y ~= 0 then
yReFactor = 1e6
yReDiv = y / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to millions of years only if we have a whole number of them
precision = 3
yFactor = yReFactor
yRound = yReRound
end
end
if yRound == 0 then
-- otherwise, take the unrounded (original) number of years
precision = 5
yFactor = 1
yRound = y
mayAddCalendar = true
end
end
if precision >= 1 and y ~= 0 then
yFull = yRound * yFactor
yReFactor = 1e9
yReDiv = yFull / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to billions of years if we're in that range
precision = 0
yFactor = yReFactor
yRound = yReRound
else
yReFactor = 1e6
yReDiv = yFull / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to millions of years if we're in that range
precision = 3
yFactor = yReFactor
yRound = yReRound
end
end
end
if not raw then
if precision == 3 then
suffix = i18n['datetime']['suffixes']['million-years']
elseif precision == 0 then
suffix = i18n['datetime']['suffixes']['billion-years']
else
yRound = yRound * yFactor
if yRound == 1 then
suffix = i18n['datetime']['suffixes']['year']
else
suffix = i18n['datetime']['suffixes']['years']
end
end
else
yRound = yRound * yFactor
end
end
else
yRound = y
mayAddCalendar = true
end
if mayAddCalendar then
calendarID = parseWikidataURL(datavalue['calendarmodel'])
if calendarID and calendarID == aliasesQ.prolepticJulianCalendar then
if not raw then
if link then
calendar = " ("..buildWikilink(i18n['datetime']['julian-calendar'], i18n['datetime']['julian'])..")"
else
calendar = " ("..i18n['datetime']['julian']..")"
end
else
calendar = "/"..i18n['datetime']['julian']
end
end
end
if not raw then
local ce = nil
if sign < 0 then
ce = i18n['datetime']['BCE']
elseif precision <= 5 then
ce = i18n['datetime']['CE']
end
if ce then
if link then
ce = buildWikilink(i18n['datetime']['common-era'], ce)
end
suffix = suffix .. " " .. ce
end
value = tostring(yRound)
if m then
dateStr = self.langObj:formatDate("F", "1-"..m.."-1")
if d then
if self.mdyDate then
dateStr = dateStr .. " " .. d .. ","
else
dateStr = d .. " " .. dateStr
end
end
value = dateStr .. " " .. value
end
value = prefix .. value .. suffix .. calendar
else
value = padZeros(yRound * sign, 4)
if m then
value = value .. "-" .. padZeros(m, 2)
if d then
value = value .. "-" .. padZeros(d, 2)
end
end
value = value .. calendar
end
return value
elseif datatype == 'globecoordinate' then
-- logic from https://github.com/DataValues/Geo (v4.0.1)
local precision, unitsPerDegree, numDigits, strFormat, value, globe
local latitude, latConv, latValue, latLink
local longitude, lonConv, lonValue, lonLink
local latDirection, latDirectionN, latDirectionS, latDirectionEN
local lonDirection, lonDirectionE, lonDirectionW, lonDirectionEN
local degSymbol, minSymbol, secSymbol, separator
local latDegrees = nil
local latMinutes = nil
local latSeconds = nil
local lonDegrees = nil
local lonMinutes = nil
local lonSeconds = nil
local latDegSym = ""
local latMinSym = ""
local latSecSym = ""
local lonDegSym = ""
local lonMinSym = ""
local lonSecSym = ""
local latDirectionEN_N = "N"
local latDirectionEN_S = "S"
local lonDirectionEN_E = "E"
local lonDirectionEN_W = "W"
if not raw then
latDirectionN = i18n['coord']['latitude-north']
latDirectionS = i18n['coord']['latitude-south']
lonDirectionE = i18n['coord']['longitude-east']
lonDirectionW = i18n['coord']['longitude-west']
degSymbol = i18n['coord']['degrees']
minSymbol = i18n['coord']['minutes']
secSymbol = i18n['coord']['seconds']
separator = i18n['coord']['separator']
else
latDirectionN = latDirectionEN_N
latDirectionS = latDirectionEN_S
lonDirectionE = lonDirectionEN_E
lonDirectionW = lonDirectionEN_W
degSymbol = "/"
minSymbol = "/"
secSymbol = "/"
separator = "/"
end
latitude = datavalue['latitude']
longitude = datavalue['longitude']
if latitude < 0 then
latDirection = latDirectionS
latDirectionEN = latDirectionEN_S
latitude = math.abs(latitude)
else
latDirection = latDirectionN
latDirectionEN = latDirectionEN_N
end
if longitude < 0 then
lonDirection = lonDirectionW
lonDirectionEN = lonDirectionEN_W
longitude = math.abs(longitude)
else
lonDirection = lonDirectionE
lonDirectionEN = lonDirectionEN_E
end
precision = datavalue['precision']
if not precision or precision <= 0 then
precision = 1 / 3600 -- precision not set (correctly), set to arcsecond
end
-- remove insignificant detail
latitude = math.floor(latitude / precision + 0.5) * precision
longitude = math.floor(longitude / precision + 0.5) * precision
if precision >= 1 - (1 / 60) and precision < 1 then
precision = 1
elseif precision >= (1 / 60) - (1 / 3600) and precision < (1 / 60) then
precision = 1 / 60
end
if precision >= 1 then
unitsPerDegree = 1
elseif precision >= (1 / 60) then
unitsPerDegree = 60
else
unitsPerDegree = 3600
end
numDigits = math.ceil(-math.log10(unitsPerDegree * precision))
if numDigits <= 0 then
numDigits = tonumber("0") -- for some reason, 'numDigits = 0' may actually store '-0', so parse from string instead
end
strFormat = "%." .. numDigits .. "f"
if precision >= 1 then
latDegrees = strFormat:format(latitude)
lonDegrees = strFormat:format(longitude)
if not raw then
latDegSym = replaceDecimalMark(latDegrees) .. degSymbol
lonDegSym = replaceDecimalMark(lonDegrees) .. degSymbol
else
latDegSym = latDegrees .. degSymbol
lonDegSym = lonDegrees .. degSymbol
end
else
latConv = math.floor(latitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits
lonConv = math.floor(longitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits
if precision >= (1 / 60) then
latMinutes = latConv
lonMinutes = lonConv
else
latSeconds = latConv
lonSeconds = lonConv
latMinutes = math.floor(latSeconds / 60)
lonMinutes = math.floor(lonSeconds / 60)
latSeconds = strFormat:format(latSeconds - (latMinutes * 60))
lonSeconds = strFormat:format(lonSeconds - (lonMinutes * 60))
if not raw then
latSecSym = replaceDecimalMark(latSeconds) .. secSymbol
lonSecSym = replaceDecimalMark(lonSeconds) .. secSymbol
else
latSecSym = latSeconds .. secSymbol
lonSecSym = lonSeconds .. secSymbol
end
end
latDegrees = math.floor(latMinutes / 60)
lonDegrees = math.floor(lonMinutes / 60)
latDegSym = latDegrees .. degSymbol
lonDegSym = lonDegrees .. degSymbol
latMinutes = latMinutes - (latDegrees * 60)
lonMinutes = lonMinutes - (lonDegrees * 60)
if precision >= (1 / 60) then
latMinutes = strFormat:format(latMinutes)
lonMinutes = strFormat:format(lonMinutes)
if not raw then
latMinSym = replaceDecimalMark(latMinutes) .. minSymbol
lonMinSym = replaceDecimalMark(lonMinutes) .. minSymbol
else
latMinSym = latMinutes .. minSymbol
lonMinSym = lonMinutes .. minSymbol
end
else
latMinSym = latMinutes .. minSymbol
lonMinSym = lonMinutes .. minSymbol
end
end
latValue = latDegSym .. latMinSym .. latSecSym .. latDirection
lonValue = lonDegSym .. lonMinSym .. lonSecSym .. lonDirection
value = latValue .. separator .. lonValue
if link then
globe = parseWikidataURL(datavalue['globe'])
if globe then
globe = mw.wikibase.getLabelByLang(globe, "en"):lower()
else
globe = "earth"
end
latLink = table.concat({latDegrees, latMinutes, latSeconds}, "_")
lonLink = table.concat({lonDegrees, lonMinutes, lonSeconds}, "_")
value = "[https://geohack.toolforge.org/geohack.php?language="..self.langCode.."¶ms="..latLink.."_"..latDirectionEN.."_"..lonLink.."_"..lonDirectionEN.."_globe:"..globe.." "..value.."]"
end
return value
elseif datatype == 'wikibase-entityid' then
local label
local itemID = datavalue['numeric-id']
if subtype == 'wikibase-item' then
itemID = "Q" .. itemID
elseif subtype == 'wikibase-property' then
itemID = "P" .. itemID
else
return '<strong class="error">' .. errorText('unknown-data-type', subtype) .. '</strong>'
end
label = self:getLabel(itemID, raw, link, short)
if label == "" then
label = nil
end
return label
else
return '<strong class="error">' .. errorText('unknown-data-type', datatype) .. '</strong>'
end
elseif snak.snaktype == 'somevalue' and not noSpecial then
if raw then
return " " -- single space represents 'somevalue'
else
return i18n['values']['unknown']
end
elseif snak.snaktype == 'novalue' and not noSpecial then
if raw then
return "" -- empty string represents 'novalue'
else
return i18n['values']['none']
end
else
return nil
end
end
function Config:getSingleRawQualifier(claim, qualifierID)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[qualifierID] end
if qualifiers and qualifiers[1] then
return self:getValue(qualifiers[1], true) -- raw = true
else
return nil
end
end
function Config:snakEqualsValue(snak, value)
local snakValue = self:getValue(snak, true) -- raw = true
if snakValue and snak.snaktype == 'value' and snak.datavalue.type == 'wikibase-entityid' then value = value:upper() end
return snakValue == value
end
function Config:setRank(rank)
local rankPos
if rank == p.flags.best then
self.bestRank = true
self.flagBest = true -- mark that 'best' flag was given
return
end
if rank:sub(1,9) == p.flags.preferred then
rankPos = 1
elseif rank:sub(1,6) == p.flags.normal then
rankPos = 2
elseif rank:sub(1,10) == p.flags.deprecated then
rankPos = 3
else
return
end
-- one of the rank flags was given, check if another one was given before
if not self.flagRank then
self.ranks = {false, false, false} -- no other rank flag given before, so unset ranks
self.bestRank = self.flagBest -- unsets bestRank only if 'best' flag was not given before
self.flagRank = true -- mark that a rank flag was given
end
if rank:sub(-1) == "+" then
for i = rankPos, 1, -1 do
self.ranks[i] = true
end
elseif rank:sub(-1) == "-" then
for i = rankPos, #self.ranks do
self.ranks[i] = true
end
else
self.ranks[rankPos] = true
end
end
function Config:setPeriod(period)
local periodPos
if period == p.flags.future then
periodPos = 1
elseif period == p.flags.current then
periodPos = 2
elseif period == p.flags.former then
periodPos = 3
else
return
end
-- one of the period flags was given, check if another one was given before
if not self.flagPeriod then
self.periods = {false, false, false} -- no other period flag given before, so unset periods
self.flagPeriod = true -- mark that a period flag was given
end
self.periods[periodPos] = true
end
function Config:qualifierMatches(claim, id, value)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[id] end
if qualifiers then
for _, v in pairs(qualifiers) do
if self:snakEqualsValue(v, value) then
return true
end
end
elseif value == "" then
-- if the qualifier is not present then treat it the same as the special value 'novalue'
return true
end
return false
end
function Config:rankMatches(rankPos)
if self.bestRank then
return (self.ranks[rankPos] and self.foundRank >= rankPos)
else
return self.ranks[rankPos]
end
end
function Config:timeMatches(claim)
local startTime = nil
local startTimeY = nil
local startTimeM = nil
local startTimeD = nil
local endTime = nil
local endTimeY = nil
local endTimeM = nil
local endTimeD = nil
if self.periods[1] and self.periods[2] and self.periods[3] then
-- any time
return true
end
startTime = self:getSingleRawQualifier(claim, aliasesP.startTime)
if startTime and startTime ~= "" and startTime ~= " " then
startTimeY, startTimeM, startTimeD = parseDate(startTime)
end
endTime = self:getSingleRawQualifier(claim, aliasesP.endTime)
if endTime and endTime ~= "" and endTime ~= " " then
endTimeY, endTimeM, endTimeD = parseDate(endTime)
end
if startTimeY ~= nil and endTimeY ~= nil and datePrecedesDate(endTimeY, endTimeM, endTimeD, startTimeY, startTimeM, startTimeD) then
-- invalidate end time if it precedes start time
endTimeY = nil
endTimeM = nil
endTimeD = nil
end
if self.periods[1] then
-- future
if startTimeY and datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD) then
return true
end
end
if self.periods[2] then
-- current
if (startTimeY == nil or not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD)) and
(endTimeY == nil or datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD)) then
return true
end
end
if self.periods[3] then
-- former
if endTimeY and not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD) then
return true
end
end
return false
end
function Config:processFlag(flag)
if not flag then
return false
end
if flag == p.flags.linked then
self.curState.linked = true
return true
elseif flag == p.flags.raw then
self.curState.rawValue = true
if self.curState == self.states[parameters.reference] then
-- raw reference values end with periods and require a separator (other than none)
self.separators["sep%r"][1] = {" "}
end
return true
elseif flag == p.flags.short then
self.curState.shortName = true
return true
elseif flag == p.flags.multilanguage then
self.curState.anyLanguage = true
return true
elseif flag == p.flags.unit then
self.curState.unitOnly = true
return true
elseif flag == p.flags.mdy then
self.mdyDate = true
return true
elseif flag == p.flags.single then
self.singleClaim = true
return true
elseif flag == p.flags.sourced then
self.sourcedOnly = true
return true
elseif flag == p.flags.edit then
self.editable = true
return true
elseif flag == p.flags.editAtEnd then
self.editable = true
self.editAtEnd = true
return true
elseif flag == p.flags.best or flag:match('^'..p.flags.preferred..'[+-]?$') or flag:match('^'..p.flags.normal..'[+-]?$') or flag:match('^'..p.flags.deprecated..'[+-]?$') then
self:setRank(flag)
return true
elseif flag == p.flags.future or flag == p.flags.current or flag == p.flags.former then
self:setPeriod(flag)
return true
elseif flag == "" then
-- ignore empty flags and carry on
return true
else
return false
end
end
function Config:processFlagOrCommand(flag)
local param = ""
if not flag then
return false
end
if flag == p.claimCommands.property or flag == p.claimCommands.properties then
param = parameters.property
elseif flag == p.claimCommands.qualifier or flag == p.claimCommands.qualifiers then
self.states.qualifiersCount = self.states.qualifiersCount + 1
param = parameters.qualifier .. self.states.qualifiersCount
self.separators["sep"..param] = {copyTable(defaultSeparators["sep%q\\d"])}
elseif flag == p.claimCommands.reference or flag == p.claimCommands.references then
param = parameters.reference
else
return self:processFlag(flag)
end
if self.states[param] then
return false
end
-- create a new state for each command
self.states[param] = State:new(self, param)
-- use "%x" as the general parameter name
self.states[param].parsedFormat = parseFormat(parameters.general) -- will be overwritten for param=="%p"
-- set the separator
self.states[param].separator = self.separators["sep"..param] -- will be nil for param=="%p", which will be set separately
if flag == p.claimCommands.property or flag == p.claimCommands.qualifier or flag == p.claimCommands.reference then
self.states[param].singleValue = true
end
self.curState = self.states[param]
return true
end
function Config:processSeparators(args)
local sep
for i, v in pairs(self.separators) do
if args[i] then
sep = replaceSpecialChars(args[i])
if sep ~= "" then
self.separators[i][1] = {sep}
else
self.separators[i][1] = nil
end
end
end
end
function Config:setFormatAndSeparators(state, parsedFormat)
state.parsedFormat = parsedFormat
state.separator = self.separators["sep"]
state.movSeparator = self.separators["sep"..parameters.separator]
state.puncMark = self.separators["punc"]
end
-- determines if a claim has references by prefetching them from the claim using getReferences,
-- which applies some filtering that determines if a reference is actually returned,
-- and caches the references for later use
function State:isSourced(claim)
self.conf.prefetchedRefs = self:getReferences(claim)
return (#self.conf.prefetchedRefs > 0)
end
function State:resetCaches()
-- any prefetched references of the previous claim must not be used
self.conf.prefetchedRefs = nil
end
function State:claimMatches(claim)
local matches, rankPos
-- first of all, reset any cached values used for the previous claim
self:resetCaches()
-- if a property value was given, check if it matches the claim's property value
if self.conf.propertyValue then
matches = self.conf:snakEqualsValue(claim.mainsnak, self.conf.propertyValue)
else
matches = true
end
-- if any qualifier values were given, check if each matches one of the claim's qualifier values
for i, v in pairs(self.conf.qualifierIDsAndValues) do
matches = (matches and self.conf:qualifierMatches(claim, i, v))
end
-- check if the claim's rank and time period match
rankPos = rankTable[claim.rank] or 4
matches = (matches and self.conf:rankMatches(rankPos) and self.conf:timeMatches(claim))
-- if only claims with references must be returned, check if this one has any
if self.conf.sourcedOnly then
matches = (matches and self:isSourced(claim)) -- prefetches and caches references
end
return matches, rankPos
end
function State:out()
local result -- collection of arrays with value objects
local valuesArray -- array with value objects
local sep = nil -- value object
local out = {} -- array with value objects
local function walk(formatTable, result)
local valuesArray = {} -- array with value objects
for i, v in pairs(formatTable.req) do
if not result[i] or not result[i][1] then
-- we've got no result for a parameter that is required on this level,
-- so skip this level (and its children) by returning an empty result
return {}
end
end
for _, v in ipairs(formatTable) do
if v.param then
valuesArray = mergeArrays(valuesArray, result[v.str])
elseif v.str ~= "" then
valuesArray[#valuesArray + 1] = {v.str}
end
if v.child then
valuesArray = mergeArrays(valuesArray, walk(v.child, result))
end
end
return valuesArray
end
-- iterate through the results from back to front, so that we know when to add separators
for i = #self.results, 1, -1 do
result = self.results[i]
-- if there is already some output, then add the separators
if #out > 0 then
sep = self.separator[1] -- fixed separator
result[parameters.separator] = {self.movSeparator[1]} -- movable separator
else
sep = nil
result[parameters.separator] = {self.puncMark[1]} -- optional punctuation mark
end
valuesArray = walk(self.parsedFormat, result)
if #valuesArray > 0 then
if sep then
valuesArray[#valuesArray + 1] = sep
end
out = mergeArrays(valuesArray, out)
end
end
-- reset state before next iteration
self.results = {}
return out
end
-- level 1 hook
function State:getProperty(claim)
local value = {self:getValue(claim.mainsnak)} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getQualifiers(claim, param)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[self.conf.qualifierIDs[param]] end
if qualifiers then
-- iterate through claim's qualifier statements to collect their values;
-- return array with multiple value objects
return self.conf.states[param]:iterate(qualifiers, {[parameters.general] = hookNames[parameters.qualifier.."\\d"][2], count = 1}) -- pass qualifier state with level 2 hook
else
return {} -- return empty array
end
end
-- level 2 hook
function State:getQualifier(snak)
local value = {self:getValue(snak)} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getAllQualifiers(claim, param, result, hooks)
local out = {} -- array with value objects
local sep = self.conf.separators["sep"..parameters.qualifier][1] -- value object
-- iterate through the output of the separate "qualifier(s)" commands
for i = 1, self.conf.states.qualifiersCount do
-- if a hook has not been called yet, call it now
if not result[parameters.qualifier..i] then
self:callHook(parameters.qualifier..i, hooks, claim, result)
end
-- if there is output for this particular "qualifier(s)" command, then add it
if result[parameters.qualifier..i] and result[parameters.qualifier..i][1] then
-- if there is already some output, then add the separator
if #out > 0 and sep then
out[#out + 1] = sep
end
out = mergeArrays(out, result[parameters.qualifier..i])
end
end
return out
end
-- level 1 hook
function State:getReferences(claim)
if self.conf.prefetchedRefs then
-- return references that have been prefetched by isSourced
return self.conf.prefetchedRefs
end
if claim.references then
-- iterate through claim's reference statements to collect their values;
-- return array with multiple value objects
return self.conf.states[parameters.reference]:iterate(claim.references, {[parameters.general] = hookNames[parameters.reference][2], count = 1}) -- pass reference state with level 2 hook
else
return {} -- return empty array
end
end
-- level 2 hook
function State:getReference(statement)
local key, citeWeb, citeQ, label
local params = {}
local citeParams = {['web'] = {}, ['q'] = {}}
local citeMismatch = {}
local useCite = nil
local useParams = nil
local value = ""
local ref = {}
local referenceEmpty = true -- will be set to false if at least one parameter is left unremoved
local numAuthorParameters = 0
local numAuthorNameStringParameters = 0
local tempLink
local additionalRefProperties = {} -- will hold properties of the reference which are not in statement.snaks, namely backup title from "subject named as" and URL from an external ID
local wikidataPropertiesOfSource -- will contain "Wikidata property" properties of the item in stated in, if any
local version = 4 -- increment this each time the below logic is changed to avoid conflict errors
if statement.snaks then
-- don't include "imported from", which is added by a bot
if statement.snaks[aliasesP.importedFrom] then
statement.snaks[aliasesP.importedFrom] = nil
end
-- don't include "Wikimedia import URL"
if statement.snaks[aliasesP.wikimediaImportURL] then
statement.snaks[aliasesP.wikimediaImportURL] = nil
-- don't include "retrieved" if no "referenceURL" is present,
-- as "retrieved" probably belongs to "Wikimedia import URL"
if statement.snaks[aliasesP.retrieved] and not statement.snaks[aliasesP.referenceURL] then
statement.snaks[aliasesP.retrieved] = nil
end
end
-- don't include "inferred from", which is added by a bot
if statement.snaks[aliasesP.inferredFrom] then
statement.snaks[aliasesP.inferredFrom] = nil
end
-- don't include "type of reference"
if statement.snaks[aliasesP.typeOfReference] then
statement.snaks[aliasesP.typeOfReference] = nil
end
-- don't include "image" to prevent littering
if statement.snaks[aliasesP.image] then
statement.snaks[aliasesP.image] = nil
end
-- don't include "language" if it is equal to the local one
if self:getReferenceDetail(statement.snaks, aliasesP.language) == self.conf.langName then
statement.snaks[aliasesP.language] = nil
end
if statement.snaks[aliasesP.statedIn] and not statement.snaks[aliasesP.referenceURL] then
-- "stated in" was given but "reference URL" was not.
-- get "Wikidata property" properties from the item in "stated in"
-- if any of the returned properties of the external-id datatype is in statement.snaks, generate a URL from it and use the URL in the reference
-- find the "Wikidata property" properties in the item from "stated in"
wikidataPropertiesOfSource = mw.text.split(p._properties{p.flags.raw, aliasesP.wikidataProperty, [p.args.eid] = self.conf:getValue(statement.snaks[aliasesP.statedIn][1], true, false)}, ", ", true)
for i, wikidataPropertyOfSource in pairs(wikidataPropertiesOfSource) do
if statement.snaks[wikidataPropertyOfSource] and statement.snaks[wikidataPropertyOfSource][1].datatype == "external-id" then
tempLink = self.conf:getValue(statement.snaks[wikidataPropertyOfSource][1], false, true) -- not raw, linked
if mw.ustring.match(tempLink, "^%[%Z- %Z+%]$") then -- getValue returned a URL.
additionalRefProperties[aliasesP.referenceURL] = mw.ustring.gsub(tempLink, "^%[(%Z-) %Z+%]$", "%1") -- the URL is in wiki markup, so strip the square brackets and the display text
statement.snaks[wikidataPropertyOfSource] = nil
break
end
end
end
end
-- don't include "subject named as", but use it as the title when "title" is not present but a URL is
if statement.snaks[aliasesP.subjectNamedAs] then
if not statement.snaks[aliasesP.title] and (statement.snaks[aliasesP.referenceURL] or additionalRefProperties[aliasesP.referenceURL]) then
additionalRefProperties[aliasesP.title] = statement.snaks[aliasesP.subjectNamedAs][1].datavalue.value
end
statement.snaks[aliasesP.subjectNamedAs] = nil
end
-- retrieve all the parameters
for i in pairs(statement.snaks) do
label = ""
-- multiple authors may be given
if i == aliasesP.author or i == aliasesP.authorNameString then
params[i] = self:getReferenceDetails(statement.snaks, i, false, self.linked, true) -- link = true/false, anyLang = true
else
params[i] = {self:getReferenceDetail(statement.snaks, i, false, (self.linked or (i == aliasesP.statedIn)) and (statement.snaks[i][1].datatype ~= 'url'), true)} -- link = true/false, anyLang = true
end
if #params[i] == 0 then
params[i] = nil
else
referenceEmpty = false
if statement.snaks[i][1].datatype == 'external-id' then
key = "external-id"
label = self.conf:getLabel(i)
if label ~= "" then
label = label .. " "
end
else
key = i
end
-- add the parameter to each matching type of citation
for j in pairs(citeParams) do
-- do so if there was no mismatch with a previous parameter
if not citeMismatch[j] then
-- check if this parameter is not mismatching itself
if i18n['cite'][j][key] then
-- continue if an option is available in the corresponding cite template
if i18n['cite'][j][key] ~= "" then
-- handle non-author properties (and author properties ("author" and "author name string"), if they don't use the same template parameter)
if (i ~= aliasesP.author and i ~= aliasesP.authorNameString) or (i18n['cite'][j][aliasesP.author] ~= i18n['cite'][j][aliasesP.authorNameString]) then
citeParams[j][i18n['cite'][j][key]] = label .. params[i][1]
-- to avoid problems with non-author multiple parameters (if existent), the following old code is retained
for k=2, #params[i] do
citeParams[j][i18n['cite'][j][key]..k] = label .. params[i][k]
end
-- handle "author" and "author name string" specially if they use the same template parameter
elseif i == aliasesP.author or i == aliasesP.authorNameString then
if params[aliasesP.author] ~= nil then
numAuthorParameters = #params[aliasesP.author]
else
numAuthorParameters = 0
end
if params[aliasesP.authorNameString] ~= nil then
numAuthorNameStringParameters = #params[aliasesP.authorNameString]
else
numAuthorNameStringParameters = 0
end
-- execute only if both "author" and "author name string" satisfy this condition: the property is both in params and in statement.snaks or it is neither in params nor in statement.snaks
-- reason: parameters are added to params each iteration of the loop, not before the loop
if ((statement.snaks[aliasesP.author] == nil) == (numAuthorParameters == 0)) and ((statement.snaks[aliasesP.authorNameString] == nil) == (numAuthorNameStringParameters == 0)) then
for k=1, numAuthorParameters + numAuthorNameStringParameters do
if k <= numAuthorParameters then -- now handling the authors from the "author" property
citeParams[j][i18n['cite'][j][aliasesP.author]..k] = label .. params[aliasesP.author][k]
else -- now handling the authors from "author name string"
citeParams[j][i18n['cite'][j][aliasesP.authorNameString]..k] = label .. params[aliasesP.authorNameString][k - numAuthorParameters]
end
end
end
end
end
else
citeMismatch[j] = true
end
end
end
end
end
-- use additional properties
for i in pairs(additionalRefProperties) do
for j in pairs(citeParams) do
if not citeMismatch[j] and i18n["cite"][j][i] then
citeParams[j][i18n["cite"][j][i]] = additionalRefProperties[i]
else
citeMismatch[j] = true
end
end
end
-- get title of general template for citing web references
citeWeb = split(mw.wikibase.getSitelink(aliasesQ.citeWeb) or "", ":")[2] -- split off namespace from front
-- get title of template that expands stated-in references into citations
citeQ = split(mw.wikibase.getSitelink(aliasesQ.citeQ) or "", ":")[2] -- split off namespace from front
-- (1) use the general template for citing web references if there is a match and if at least both "reference URL" and "title" are present
if citeWeb and not citeMismatch['web'] and citeParams['web'][i18n['cite']['web'][aliasesP.referenceURL]] and citeParams['web'][i18n['cite']['web'][aliasesP.title]] then
useCite = citeWeb
useParams = citeParams['web']
-- (2) use the template that expands stated-in references into citations if there is a match and if at least "stated in" is present
elseif citeQ and not citeMismatch['q'] and citeParams['q'][i18n['cite']['q'][aliasesP.statedIn]] then
-- we need the raw "stated in" Q-identifier for the this template
citeParams['q'][i18n['cite']['q'][aliasesP.statedIn]] = self:getReferenceDetail(statement.snaks, aliasesP.statedIn, true) -- raw = true
useCite = citeQ
useParams = citeParams['q']
end
if useCite and useParams then
-- if this module is being substituted then build a regular template call, otherwise expand the template
if mw.isSubsting() then
for i, v in pairs(useParams) do
value = value .. "|" .. i .. "=" .. v
end
value = "{{" .. useCite .. value .. "}}"
else
value = mw.getCurrentFrame():expandTemplate{title=useCite, args=useParams}
end
-- (3) if the citation couldn't be displayed using Cite web or Cite Q, but has properties other than the removed ones, throw an error
elseif not referenceEmpty then
value = "<span style=\"color: crimson\">" .. errorText("malformed-reference") .. "</span>"
end
if value ~= "" then
value = {value} -- create one value object
if not self.rawValue then
-- this should become a <ref> tag, so save the reference's hash for later
value.refHash = "wikidata-" .. statement.hash .. "-v" .. (tonumber(i18n['cite']['version']) + version)
end
ref = {value} -- wrap the value object in an array
end
end
return ref
end
-- gets a detail of one particular type for a reference
function State:getReferenceDetail(snaks, dType, raw, link, anyLang)
local switchLang = anyLang
local value = nil
if not snaks[dType] then
return nil
end
-- if anyLang, first try the local language and otherwise any language
repeat
for _, v in ipairs(snaks[dType]) do
value = self.conf:getValue(v, raw, link, false, anyLang and not switchLang, false, true) -- noSpecial = true
if value then
break
end
end
if value or not anyLang then
break
end
switchLang = not switchLang
until anyLang and switchLang
return value
end
-- gets the details of one particular type for a reference
function State:getReferenceDetails(snaks, dType, raw, link, anyLang)
local values = {}
if not snaks[dType] then
return {}
end
for _, v in ipairs(snaks[dType]) do
-- if nil is returned then it will not be added to the table
values[#values + 1] = self.conf:getValue(v, raw, link, false, anyLang, false, true) -- noSpecial = true
end
return values
end
-- level 1 hook
function State:getAlias(object)
local value = object.value
local title = nil
if value and self.linked then
if self.conf.entityID:sub(1,1) == "Q" then
title = mw.wikibase.getSitelink(self.conf.entityID)
elseif self.conf.entityID:sub(1,1) == "P" then
title = "d:Property:" .. self.conf.entityID
end
if title then
value = buildWikilink(title, value)
end
end
value = {value} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getBadge(value)
value = self.conf:getLabel(value, self.rawValue, self.linked, self.shortName)
if value == "" then
value = nil
end
value = {value} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
function State:callHook(param, hooks, statement, result)
local valuesArray, refHash
-- call a parameter's hook if it has been defined and if it has not been called before
if not result[param] and hooks[param] then
valuesArray = self[hooks[param]](self, statement, param, result, hooks) -- array with value objects
-- add to the result
if #valuesArray > 0 then
result[param] = valuesArray
result.count = result.count + 1
else
result[param] = {} -- an empty array to indicate that we've tried this hook already
return true -- miss == true
end
end
return false
end
-- iterate through claims, claim's qualifiers or claim's references to collect values
function State:iterate(statements, hooks, matchHook)
matchHook = matchHook or alwaysTrue
local matches = false
local rankPos = nil
local result, gotRequired
for _, v in ipairs(statements) do
-- rankPos will be nil for non-claim statements (e.g. qualifiers, references, etc.)
matches, rankPos = matchHook(self, v)
if matches then
result = {count = 0} -- collection of arrays with value objects
local function walk(formatTable)
local miss
for i2, v2 in pairs(formatTable.req) do
-- call a hook, adding its return value to the result
miss = self:callHook(i2, hooks, v, result)
if miss then
-- we miss a required value for this level, so return false
return false
end
if result.count == hooks.count then
-- we're done if all hooks have been called;
-- returning at this point breaks the loop
return true
end
end
for _, v2 in ipairs(formatTable) do
if result.count == hooks.count then
-- we're done if all hooks have been called;
-- returning at this point prevents further childs from being processed
return true
end
if v2.child then
walk(v2.child)
end
end
return true
end
gotRequired = walk(self.parsedFormat)
-- only append the result if we got values for all required parameters on the root level
if gotRequired then
-- if we have a rankPos (only with matchHook() for complete claims), then update the foundRank
if rankPos and self.conf.foundRank > rankPos then
self.conf.foundRank = rankPos
end
-- append the result
self.results[#self.results + 1] = result
-- break if we only need a single value
if self.singleValue then
break
end
end
end
end
return self:out()
end
local function getEntityId(arg, eid, page, allowOmitPropPrefix)
local id = nil
local prop = nil
if arg then
if arg:sub(1,1) == ":" then
page = arg
eid = nil
elseif arg:sub(1,1):upper() == "Q" or arg:sub(1,9):lower() == "property:" or allowOmitPropPrefix then
eid = arg
page = nil
else
prop = arg
end
end
if eid then
if eid:sub(1,9):lower() == "property:" then
id = replaceAlias(mw.text.trim(eid:sub(10)))
if id:sub(1,1):upper() ~= "P" then
id = ""
end
else
id = replaceAlias(eid)
end
elseif page then
if page:sub(1,1) == ":" then
page = mw.text.trim(page:sub(2))
end
id = mw.wikibase.getEntityIdForTitle(page) or ""
end
if not id then
id = mw.wikibase.getEntityIdForCurrentPage() or ""
end
id = id:upper()
if not mw.wikibase.isValidEntityId(id) then
id = ""
end
return id, prop
end
local function nextArg(args)
local arg = args[args.pointer]
if arg then
args.pointer = args.pointer + 1
return mw.text.trim(arg)
else
return nil
end
end
local function claimCommand(args, funcName)
local cfg = Config:new()
cfg:processFlagOrCommand(funcName) -- process first command (== function name)
local lastArg, parsedFormat, formatParams, claims, value
local hooks = {count = 0}
-- set the date if given;
-- must come BEFORE processing the flags
if args[p.args.date] then
cfg.atDate = {parseDate(args[p.args.date])}
cfg.periods = {false, true, false} -- change default time constraint to 'current'
end
-- process flags and commands
repeat
lastArg = nextArg(args)
until not cfg:processFlagOrCommand(lastArg)
-- get the entity ID from either the positional argument, the eid argument or the page argument
cfg.entityID, cfg.propertyID = getEntityId(lastArg, args[p.args.eid], args[p.args.page])
if cfg.entityID == "" then
return "" -- we cannot continue without a valid entity ID
end
cfg.entity = mw.wikibase.getEntity(cfg.entityID)
if not cfg.propertyID then
cfg.propertyID = nextArg(args)
end
cfg.propertyID = replaceAlias(cfg.propertyID)
if not cfg.entity or not cfg.propertyID then
return "" -- we cannot continue without an entity or a property ID
end
cfg.propertyID = cfg.propertyID:upper()
if not cfg.entity.claims or not cfg.entity.claims[cfg.propertyID] then
return "" -- there is no use to continue without any claims
end
claims = cfg.entity.claims[cfg.propertyID]
if cfg.states.qualifiersCount > 0 then
-- do further processing if "qualifier(s)" command was given
if #args - args.pointer + 1 > cfg.states.qualifiersCount then
-- claim ID or literal value has been given
cfg.propertyValue = nextArg(args)
end
for i = 1, cfg.states.qualifiersCount do
-- check if given qualifier ID is an alias and add it
cfg.qualifierIDs[parameters.qualifier..i] = replaceAlias(nextArg(args) or ""):upper()
end
elseif cfg.states[parameters.reference] then
-- do further processing if "reference(s)" command was given
cfg.propertyValue = nextArg(args)
end
-- check for special property value 'somevalue' or 'novalue'
if cfg.propertyValue then
cfg.propertyValue = replaceSpecialChars(cfg.propertyValue)
if cfg.propertyValue ~= "" and mw.text.trim(cfg.propertyValue) == "" then
cfg.propertyValue = " " -- single space represents 'somevalue', whereas empty string represents 'novalue'
else
cfg.propertyValue = mw.text.trim(cfg.propertyValue)
end
end
-- parse the desired format, or choose an appropriate format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
elseif cfg.states.qualifiersCount > 0 then -- "qualifier(s)" command given
if cfg.states[parameters.property] then -- "propert(y|ies)" command given
parsedFormat, formatParams = parseFormat(formats.propertyWithQualifier)
else
parsedFormat, formatParams = parseFormat(formats.qualifier)
end
elseif cfg.states[parameters.property] then -- "propert(y|ies)" command given
parsedFormat, formatParams = parseFormat(formats.property)
else -- "reference(s)" command given
parsedFormat, formatParams = parseFormat(formats.reference)
end
-- if a "qualifier(s)" command and no "propert(y|ies)" command has been given, make the movable separator a semicolon
if cfg.states.qualifiersCount > 0 and not cfg.states[parameters.property] then
cfg.separators["sep"..parameters.separator][1] = {";"}
end
-- if only "reference(s)" has been given, set the default separator to none (except when raw)
if cfg.states[parameters.reference] and not cfg.states[parameters.property] and cfg.states.qualifiersCount == 0
and not cfg.states[parameters.reference].rawValue then
cfg.separators["sep"][1] = nil
end
-- if exactly one "qualifier(s)" command has been given, make "sep%q" point to "sep%q1" to make them equivalent
if cfg.states.qualifiersCount == 1 then
cfg.separators["sep"..parameters.qualifier] = cfg.separators["sep"..parameters.qualifier.."1"]
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hooks that should be called (getProperty, getQualifiers, getReferences);
-- only define a hook if both its command ("propert(y|ies)", "reference(s)", "qualifier(s)") and its parameter ("%p", "%r", "%q1", "%q2", "%q3") have been given
for i, v in pairs(cfg.states) do
-- e.g. 'formatParams["%q1"] or formatParams["%q"]' to define hook even if "%q1" was not defined to be able to build a complete value for "%q"
if formatParams[i] or formatParams[i:sub(1, 2)] then
hooks[i] = getHookName(i, 1)
hooks.count = hooks.count + 1
end
end
-- the "%q" parameter is not attached to a state, but is a collection of the results of multiple states (attached to "%q1", "%q2", "%q3", ...);
-- so if this parameter is given then this hook must be defined separately, but only if at least one "qualifier(s)" command has been given
if formatParams[parameters.qualifier] and cfg.states.qualifiersCount > 0 then
hooks[parameters.qualifier] = getHookName(parameters.qualifier, 1)
hooks.count = hooks.count + 1
end
-- create a state for "properties" if it doesn't exist yet, which will be used as a base configuration for each claim iteration;
-- must come AFTER defining the hooks
if not cfg.states[parameters.property] then
cfg.states[parameters.property] = State:new(cfg, parameters.property)
-- if the "single" flag has been given then this state should be equivalent to "property" (singular)
if cfg.singleClaim then
cfg.states[parameters.property].singleValue = true
end
end
-- if the "sourced" flag has been given then create a state for "reference" if it doesn't exist yet, using default values,
-- which must exist in order to be able to determine if a claim has any references;
-- must come AFTER defining the hooks
if cfg.sourcedOnly and not cfg.states[parameters.reference] then
cfg:processFlagOrCommand(p.claimCommands.reference) -- use singular "reference" to minimize overhead
end
-- set the parsed format and the separators (and optional punctuation mark);
-- must come AFTER creating the additonal states
cfg:setFormatAndSeparators(cfg.states[parameters.property], parsedFormat)
-- process qualifier matching values, analogous to cfg.propertyValue
for i, v in pairs(args) do
i = tostring(i)
if i:match('^[Pp]%d+$') or aliasesP[i] then
v = replaceSpecialChars(v)
-- check for special qualifier value 'somevalue'
if v ~= "" and mw.text.trim(v) == "" then
v = " " -- single space represents 'somevalue'
end
cfg.qualifierIDsAndValues[replaceAlias(i):upper()] = v
end
end
-- first sort the claims on rank to pre-define the order of output (preferred first, then normal, then deprecated)
claims = sortOnRank(claims)
-- then iterate through the claims to collect values
value = cfg:concatValues(cfg.states[parameters.property]:iterate(claims, hooks, State.claimMatches)) -- pass property state with level 1 hooks and matchHook
-- if desired, add a clickable icon that may be used to edit the returned values on Wikidata
if cfg.editable and value ~= "" then
value = value .. cfg:getEditIcon()
end
return value
end
local function generalCommand(args, funcName)
local cfg = Config:new()
cfg.curState = State:new(cfg)
local lastArg
local value = nil
repeat
lastArg = nextArg(args)
until not cfg:processFlag(lastArg)
-- get the entity ID from either the positional argument, the eid argument or the page argument
cfg.entityID = getEntityId(lastArg, args[p.args.eid], args[p.args.page], true)
if cfg.entityID == "" or not mw.wikibase.entityExists(cfg.entityID) then
return "" -- we cannot continue without an entity
end
-- serve according to the given command
if funcName == p.generalCommands.label then
value = cfg:getLabel(cfg.entityID, cfg.curState.rawValue, cfg.curState.linked, cfg.curState.shortName)
elseif funcName == p.generalCommands.title then
cfg.inSitelinks = true
if cfg.entityID:sub(1,1) == "Q" then
value = mw.wikibase.getSitelink(cfg.entityID)
end
if cfg.curState.linked and value then
value = buildWikilink(value)
end
elseif funcName == p.generalCommands.description then
value = mw.wikibase.getDescription(cfg.entityID)
else
local parsedFormat, formatParams
local hooks = {count = 0}
cfg.entity = mw.wikibase.getEntity(cfg.entityID)
if funcName == p.generalCommands.alias or funcName == p.generalCommands.badge then
cfg.curState.singleValue = true
end
if funcName == p.generalCommands.alias or funcName == p.generalCommands.aliases then
if not cfg.entity.aliases or not cfg.entity.aliases[cfg.langCode] then
return "" -- there is no use to continue without any aliasses
end
local aliases = cfg.entity.aliases[cfg.langCode]
-- parse the desired format, or parse the default aliases format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
else
parsedFormat, formatParams = parseFormat(formats.alias)
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hook that should be called (getAlias);
-- only define the hook if the parameter ("%a") has been given
if formatParams[parameters.alias] then
hooks[parameters.alias] = getHookName(parameters.alias, 1)
hooks.count = hooks.count + 1
end
-- set the parsed format and the separators (and optional punctuation mark)
cfg:setFormatAndSeparators(cfg.curState, parsedFormat)
-- iterate to collect values
value = cfg:concatValues(cfg.curState:iterate(aliases, hooks))
elseif funcName == p.generalCommands.badge or funcName == p.generalCommands.badges then
if not cfg.entity.sitelinks or not cfg.entity.sitelinks[cfg.siteID] or not cfg.entity.sitelinks[cfg.siteID].badges then
return "" -- there is no use to continue without any badges
end
local badges = cfg.entity.sitelinks[cfg.siteID].badges
cfg.inSitelinks = true
-- parse the desired format, or parse the default aliases format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
else
parsedFormat, formatParams = parseFormat(formats.badge)
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hook that should be called (getBadge);
-- only define the hook if the parameter ("%b") has been given
if formatParams[parameters.badge] then
hooks[parameters.badge] = getHookName(parameters.badge, 1)
hooks.count = hooks.count + 1
end
-- set the parsed format and the separators (and optional punctuation mark)
cfg:setFormatAndSeparators(cfg.curState, parsedFormat)
-- iterate to collect values
value = cfg:concatValues(cfg.curState:iterate(badges, hooks))
end
end
value = value or ""
if cfg.editable and value ~= "" then
-- if desired, add a clickable icon that may be used to edit the returned value on Wikidata
value = value .. cfg:getEditIcon()
end
return value
end
-- modules that include this module should call the functions with an underscore prepended, e.g.: p._property(args)
local function establishCommands(commandList, commandFunc)
for _, commandName in pairs(commandList) do
local function wikitextWrapper(frame)
local args = copyTable(frame.args)
args.pointer = 1
loadI18n(aliasesP, frame)
return commandFunc(args, commandName)
end
p[commandName] = wikitextWrapper
local function luaWrapper(args)
args = copyTable(args)
args.pointer = 1
loadI18n(aliasesP)
return commandFunc(args, commandName)
end
p["_" .. commandName] = luaWrapper
end
end
establishCommands(p.claimCommands, claimCommand)
establishCommands(p.generalCommands, generalCommand)
-- main function that is supposed to be used by wrapper templates
function p.main(frame)
if not mw.wikibase then return nil end
local f, args
loadI18n(aliasesP, frame)
-- get the parent frame to take the arguments that were passed to the wrapper template
frame = frame:getParent() or frame
if not frame.args[1] then
throwError("no-function-specified")
end
f = mw.text.trim(frame.args[1])
if f == "main" then
throwError("main-called-twice")
end
assert(p["_"..f], errorText('no-such-function', f))
-- copy arguments from immutable to mutable table
args = copyTable(frame.args)
-- remove the function name from the list
table.remove(args, 1)
return p["_"..f](args)
end
return p
a84f46cf7d14594003fea6e756cf41b723dd67cd
Module:Wd/i18n
828
32
67
66
2023-08-10T14:07:24Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- The values and functions in this submodule should be localized per wiki.
local p = {}
function p.init(aliasesP)
p = {
["errors"] = {
["unknown-data-type"] = "Unknown or unsupported datatype '$1'.",
["missing-required-parameter"] = "No required parameters defined, needing at least one",
["extra-required-parameter"] = "Parameter '$1' must be defined as optional",
["no-function-specified"] = "You must specify a function to call", -- equal to the standard module error message
["main-called-twice"] = 'The function "main" cannot be called twice',
["no-such-function"] = 'The function "$1" does not exist', -- equal to the standard module error message
["malformed-reference"] = "Error: Unable to display the reference properly. See [[Module:wd/doc#References|the documentation]] for details.[[Category:Module:Wd reference errors]]"
},
["info"] = {
["edit-on-wikidata"] = "Edit this on Wikidata"
},
["numeric"] = {
["decimal-mark"] = ".",
["delimiter"] = ","
},
["datetime"] = {
["prefixes"] = {
["decade-period"] = ""
},
["suffixes"] = {
["decade-period"] = "s",
["millennium"] = " millennium",
["century"] = " century",
["million-years"] = " million years",
["billion-years"] = " billion years",
["year"] = " year",
["years"] = " years"
},
["julian-calendar"] = "Julian calendar", -- linked page title
["julian"] = "Julian",
["BCE"] = "BCE",
["CE"] = "CE",
["common-era"] = "Common Era" -- linked page title
},
["coord"] = {
["latitude-north"] = "N",
["latitude-south"] = "S",
["longitude-east"] = "E",
["longitude-west"] = "W",
["degrees"] = "°",
["minutes"] = "'",
["seconds"] = '"',
["separator"] = ", "
},
["values"] = {
["unknown"] = "unknown",
["none"] = "none"
},
["cite"] = {
["version"] = "4", -- increment this each time the below parameters are changed to avoid conflict errors
["web"] = {
-- <= left side: all allowed reference properties for *web page sources* per https://www.wikidata.org/wiki/Help:Sources
-- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite web]] (if non-existent, keep empty i.e. "")
[aliasesP.statedIn] = "website",
[aliasesP.referenceURL] = "url",
[aliasesP.publicationDate] = "date",
[aliasesP.retrieved] = "access-date",
[aliasesP.title] = "title",
[aliasesP.archiveURL] = "archive-url",
[aliasesP.archiveDate] = "archive-date",
[aliasesP.language] = "language",
[aliasesP.author] = "author", -- existence of author1, author2, author3, etc. is assumed
[aliasesP.authorNameString] = "author",
[aliasesP.publisher] = "publisher",
[aliasesP.quote] = "quote",
[aliasesP.pages] = "pages", -- extra option
[aliasesP.publishedIn] = "website"
},
["q"] = {
-- <= left side: all allowed reference properties for *sources other than web pages* per https://www.wikidata.org/wiki/Help:Sources
-- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite Q]] (if non-existent, keep empty i.e. "")
[aliasesP.statedIn] = "1",
[aliasesP.pages] = "pages",
[aliasesP.column] = "at",
[aliasesP.chapter] = "chapter",
[aliasesP.sectionVerseOrParagraph] = "section",
["external-id"] = "id", -- used for any type of database property ID
[aliasesP.title] = "title",
[aliasesP.publicationDate] = "date",
[aliasesP.retrieved] = "access-date"
}
}
}
p.getOrdinalSuffix = function(num)
if tostring(num):sub(-2,-2) == '1' then
return "th" -- 10th, 11th, 12th, 13th, ... 19th
end
num = tostring(num):sub(-1)
if num == '1' then
return "st"
elseif num == '2' then
return "nd"
elseif num == '3' then
return "rd"
else
return "th"
end
end
p.addDelimiters = function(n)
local left, num, right = string.match(n, "^([^%d]*%d)(%d*)(.-)$")
if left and num and right then
return left .. (num:reverse():gsub("(%d%d%d)", "%1" .. p['numeric']['delimiter']):reverse()) .. right
else
return n
end
end
return p
end
return p
a860785cf3b9ad3ba0c8096d5627eae877d4e9ab
Module:Protection banner
828
33
69
68
2023-08-10T14:07:24Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- This module implements {{pp-meta}} and its daughter templates such as
-- {{pp-dispute}}, {{pp-vandalism}} and {{pp-sock}}.
-- Initialise necessary modules.
require('strict')
local makeFileLink = require('Module:File link')._main
local effectiveProtectionLevel = require('Module:Effective protection level')._main
local effectiveProtectionExpiry = require('Module:Effective protection expiry')._main
local yesno = require('Module:Yesno')
-- Lazily initialise modules and objects we don't always need.
local getArgs, makeMessageBox, lang
-- Set constants.
local CONFIG_MODULE = 'Module:Protection banner/config'
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function makeCategoryLink(cat, sort)
if cat then
return string.format(
'[[%s:%s|%s]]',
mw.site.namespaces[14].name,
cat,
sort
)
end
end
-- Validation function for the expiry and the protection date
local function validateDate(dateString, dateType)
if not lang then
lang = mw.language.getContentLanguage()
end
local success, result = pcall(lang.formatDate, lang, 'U', dateString)
if success then
result = tonumber(result)
if result then
return result
end
end
error(string.format(
'invalid %s: %s',
dateType,
tostring(dateString)
), 4)
end
local function makeFullUrl(page, query, display)
return string.format(
'[%s %s]',
tostring(mw.uri.fullUrl(page, query)),
display
)
end
-- Given a directed graph formatted as node -> table of direct successors,
-- get a table of all nodes reachable from a given node (though always
-- including the given node).
local function getReachableNodes(graph, start)
local toWalk, retval = {[start] = true}, {}
while true do
-- Can't use pairs() since we're adding and removing things as we're iterating
local k = next(toWalk) -- This always gets the "first" key
if k == nil then
return retval
end
toWalk[k] = nil
retval[k] = true
for _,v in ipairs(graph[k]) do
if not retval[v] then
toWalk[v] = true
end
end
end
end
--------------------------------------------------------------------------------
-- Protection class
--------------------------------------------------------------------------------
local Protection = {}
Protection.__index = Protection
Protection.supportedActions = {
edit = true,
move = true,
autoreview = true,
upload = true
}
Protection.bannerConfigFields = {
'text',
'explanation',
'tooltip',
'alt',
'link',
'image'
}
function Protection.new(args, cfg, title)
local obj = {}
obj._cfg = cfg
obj.title = title or mw.title.getCurrentTitle()
-- Set action
if not args.action then
obj.action = 'edit'
elseif Protection.supportedActions[args.action] then
obj.action = args.action
else
error(string.format(
'invalid action: %s',
tostring(args.action)
), 3)
end
-- Set level
obj.level = args.demolevel or effectiveProtectionLevel(obj.action, obj.title)
if not obj.level or (obj.action == 'move' and obj.level == 'autoconfirmed') then
-- Users need to be autoconfirmed to move pages anyway, so treat
-- semi-move-protected pages as unprotected.
obj.level = '*'
end
-- Set expiry
local effectiveExpiry = effectiveProtectionExpiry(obj.action, obj.title)
if effectiveExpiry == 'infinity' then
obj.expiry = 'indef'
elseif effectiveExpiry ~= 'unknown' then
obj.expiry = validateDate(effectiveExpiry, 'expiry date')
end
-- Set reason
if args[1] then
obj.reason = mw.ustring.lower(args[1])
if obj.reason:find('|') then
error('reasons cannot contain the pipe character ("|")', 3)
end
end
-- Set protection date
if args.date then
obj.protectionDate = validateDate(args.date, 'protection date')
end
-- Set banner config
do
obj.bannerConfig = {}
local configTables = {}
if cfg.banners[obj.action] then
configTables[#configTables + 1] = cfg.banners[obj.action][obj.reason]
end
if cfg.defaultBanners[obj.action] then
configTables[#configTables + 1] = cfg.defaultBanners[obj.action][obj.level]
configTables[#configTables + 1] = cfg.defaultBanners[obj.action].default
end
configTables[#configTables + 1] = cfg.masterBanner
for i, field in ipairs(Protection.bannerConfigFields) do
for j, t in ipairs(configTables) do
if t[field] then
obj.bannerConfig[field] = t[field]
break
end
end
end
end
return setmetatable(obj, Protection)
end
function Protection:isUserScript()
-- Whether the page is a user JavaScript or CSS page.
local title = self.title
return title.namespace == 2 and (
title.contentModel == 'javascript' or title.contentModel == 'css'
)
end
function Protection:isProtected()
return self.level ~= '*'
end
function Protection:shouldShowLock()
-- Whether we should output a banner/padlock
return self:isProtected() and not self:isUserScript()
end
-- Whether this page needs a protection category.
Protection.shouldHaveProtectionCategory = Protection.shouldShowLock
function Protection:isTemporary()
return type(self.expiry) == 'number'
end
function Protection:makeProtectionCategory()
if not self:shouldHaveProtectionCategory() then
return ''
end
local cfg = self._cfg
local title = self.title
-- Get the expiry key fragment.
local expiryFragment
if self.expiry == 'indef' then
expiryFragment = self.expiry
elseif type(self.expiry) == 'number' then
expiryFragment = 'temp'
end
-- Get the namespace key fragment.
local namespaceFragment = cfg.categoryNamespaceKeys[title.namespace]
if not namespaceFragment and title.namespace % 2 == 1 then
namespaceFragment = 'talk'
end
-- Define the order that key fragments are tested in. This is done with an
-- array of tables containing the value to be tested, along with its
-- position in the cfg.protectionCategories table.
local order = {
{val = expiryFragment, keypos = 1},
{val = namespaceFragment, keypos = 2},
{val = self.reason, keypos = 3},
{val = self.level, keypos = 4},
{val = self.action, keypos = 5}
}
--[[
-- The old protection templates used an ad-hoc protection category system,
-- with some templates prioritising namespaces in their categories, and
-- others prioritising the protection reason. To emulate this in this module
-- we use the config table cfg.reasonsWithNamespacePriority to set the
-- reasons for which namespaces have priority over protection reason.
-- If we are dealing with one of those reasons, move the namespace table to
-- the end of the order table, i.e. give it highest priority. If not, the
-- reason should have highest priority, so move that to the end of the table
-- instead.
--]]
table.insert(order, table.remove(order, self.reason and cfg.reasonsWithNamespacePriority[self.reason] and 2 or 3))
--[[
-- Define the attempt order. Inactive subtables (subtables with nil "value"
-- fields) are moved to the end, where they will later be given the key
-- "all". This is to cut down on the number of table lookups in
-- cfg.protectionCategories, which grows exponentially with the number of
-- non-nil keys. We keep track of the number of active subtables with the
-- noActive parameter.
--]]
local noActive, attemptOrder
do
local active, inactive = {}, {}
for i, t in ipairs(order) do
if t.val then
active[#active + 1] = t
else
inactive[#inactive + 1] = t
end
end
noActive = #active
attemptOrder = active
for i, t in ipairs(inactive) do
attemptOrder[#attemptOrder + 1] = t
end
end
--[[
-- Check increasingly generic key combinations until we find a match. If a
-- specific category exists for the combination of key fragments we are
-- given, that match will be found first. If not, we keep trying different
-- key fragment combinations until we match using the key
-- "all-all-all-all-all".
--
-- To generate the keys, we index the key subtables using a binary matrix
-- with indexes i and j. j is only calculated up to the number of active
-- subtables. For example, if there were three active subtables, the matrix
-- would look like this, with 0 corresponding to the key fragment "all", and
-- 1 corresponding to other key fragments.
--
-- j 1 2 3
-- i
-- 1 1 1 1
-- 2 0 1 1
-- 3 1 0 1
-- 4 0 0 1
-- 5 1 1 0
-- 6 0 1 0
-- 7 1 0 0
-- 8 0 0 0
--
-- Values of j higher than the number of active subtables are set
-- to the string "all".
--
-- A key for cfg.protectionCategories is constructed for each value of i.
-- The position of the value in the key is determined by the keypos field in
-- each subtable.
--]]
local cats = cfg.protectionCategories
for i = 1, 2^noActive do
local key = {}
for j, t in ipairs(attemptOrder) do
if j > noActive then
key[t.keypos] = 'all'
else
local quotient = i / 2 ^ (j - 1)
quotient = math.ceil(quotient)
if quotient % 2 == 1 then
key[t.keypos] = t.val
else
key[t.keypos] = 'all'
end
end
end
key = table.concat(key, '|')
local attempt = cats[key]
if attempt then
return makeCategoryLink(attempt, title.text)
end
end
return ''
end
function Protection:isIncorrect()
local expiry = self.expiry
return not self:shouldHaveProtectionCategory()
or type(expiry) == 'number' and expiry < os.time()
end
function Protection:isTemplateProtectedNonTemplate()
local action, namespace = self.action, self.title.namespace
return self.level == 'templateeditor'
and (
(action ~= 'edit' and action ~= 'move')
or (namespace ~= 10 and namespace ~= 828)
)
end
function Protection:makeCategoryLinks()
local msg = self._cfg.msg
local ret = {self:makeProtectionCategory()}
if self:isIncorrect() then
ret[#ret + 1] = makeCategoryLink(
msg['tracking-category-incorrect'],
self.title.text
)
end
if self:isTemplateProtectedNonTemplate() then
ret[#ret + 1] = makeCategoryLink(
msg['tracking-category-template'],
self.title.text
)
end
return table.concat(ret)
end
--------------------------------------------------------------------------------
-- Blurb class
--------------------------------------------------------------------------------
local Blurb = {}
Blurb.__index = Blurb
Blurb.bannerTextFields = {
text = true,
explanation = true,
tooltip = true,
alt = true,
link = true
}
function Blurb.new(protectionObj, args, cfg)
return setmetatable({
_cfg = cfg,
_protectionObj = protectionObj,
_args = args
}, Blurb)
end
-- Private methods --
function Blurb:_formatDate(num)
-- Formats a Unix timestamp into dd Month, YYYY format.
lang = lang or mw.language.getContentLanguage()
local success, date = pcall(
lang.formatDate,
lang,
self._cfg.msg['expiry-date-format'] or 'j F Y',
'@' .. tostring(num)
)
if success then
return date
end
end
function Blurb:_getExpandedMessage(msgKey)
return self:_substituteParameters(self._cfg.msg[msgKey])
end
function Blurb:_substituteParameters(msg)
if not self._params then
local parameterFuncs = {}
parameterFuncs.CURRENTVERSION = self._makeCurrentVersionParameter
parameterFuncs.EDITREQUEST = self._makeEditRequestParameter
parameterFuncs.EXPIRY = self._makeExpiryParameter
parameterFuncs.EXPLANATIONBLURB = self._makeExplanationBlurbParameter
parameterFuncs.IMAGELINK = self._makeImageLinkParameter
parameterFuncs.INTROBLURB = self._makeIntroBlurbParameter
parameterFuncs.INTROFRAGMENT = self._makeIntroFragmentParameter
parameterFuncs.PAGETYPE = self._makePagetypeParameter
parameterFuncs.PROTECTIONBLURB = self._makeProtectionBlurbParameter
parameterFuncs.PROTECTIONDATE = self._makeProtectionDateParameter
parameterFuncs.PROTECTIONLEVEL = self._makeProtectionLevelParameter
parameterFuncs.PROTECTIONLOG = self._makeProtectionLogParameter
parameterFuncs.TALKPAGE = self._makeTalkPageParameter
parameterFuncs.TOOLTIPBLURB = self._makeTooltipBlurbParameter
parameterFuncs.TOOLTIPFRAGMENT = self._makeTooltipFragmentParameter
parameterFuncs.VANDAL = self._makeVandalTemplateParameter
self._params = setmetatable({}, {
__index = function (t, k)
local param
if parameterFuncs[k] then
param = parameterFuncs[k](self)
end
param = param or ''
t[k] = param
return param
end
})
end
msg = msg:gsub('${(%u+)}', self._params)
return msg
end
function Blurb:_makeCurrentVersionParameter()
-- A link to the page history or the move log, depending on the kind of
-- protection.
local pagename = self._protectionObj.title.prefixedText
if self._protectionObj.action == 'move' then
-- We need the move log link.
return makeFullUrl(
'Special:Log',
{type = 'move', page = pagename},
self:_getExpandedMessage('current-version-move-display')
)
else
-- We need the history link.
return makeFullUrl(
pagename,
{action = 'history'},
self:_getExpandedMessage('current-version-edit-display')
)
end
end
function Blurb:_makeEditRequestParameter()
local mEditRequest = require('Module:Submit an edit request')
local action = self._protectionObj.action
local level = self._protectionObj.level
-- Get the edit request type.
local requestType
if action == 'edit' then
if level == 'autoconfirmed' then
requestType = 'semi'
elseif level == 'extendedconfirmed' then
requestType = 'extended'
elseif level == 'templateeditor' then
requestType = 'template'
end
end
requestType = requestType or 'full'
-- Get the display value.
local display = self:_getExpandedMessage('edit-request-display')
return mEditRequest._link{type = requestType, display = display}
end
function Blurb:_makeExpiryParameter()
local expiry = self._protectionObj.expiry
if type(expiry) == 'number' then
return self:_formatDate(expiry)
else
return expiry
end
end
function Blurb:_makeExplanationBlurbParameter()
-- Cover special cases first.
if self._protectionObj.title.namespace == 8 then
-- MediaWiki namespace
return self:_getExpandedMessage('explanation-blurb-nounprotect')
end
-- Get explanation blurb table keys
local action = self._protectionObj.action
local level = self._protectionObj.level
local talkKey = self._protectionObj.title.isTalkPage and 'talk' or 'subject'
-- Find the message in the explanation blurb table and substitute any
-- parameters.
local explanations = self._cfg.explanationBlurbs
local msg
if explanations[action][level] and explanations[action][level][talkKey] then
msg = explanations[action][level][talkKey]
elseif explanations[action][level] and explanations[action][level].default then
msg = explanations[action][level].default
elseif explanations[action].default and explanations[action].default[talkKey] then
msg = explanations[action].default[talkKey]
elseif explanations[action].default and explanations[action].default.default then
msg = explanations[action].default.default
else
error(string.format(
'could not find explanation blurb for action "%s", level "%s" and talk key "%s"',
action,
level,
talkKey
), 8)
end
return self:_substituteParameters(msg)
end
function Blurb:_makeImageLinkParameter()
local imageLinks = self._cfg.imageLinks
local action = self._protectionObj.action
local level = self._protectionObj.level
local msg
if imageLinks[action][level] then
msg = imageLinks[action][level]
elseif imageLinks[action].default then
msg = imageLinks[action].default
else
msg = imageLinks.edit.default
end
return self:_substituteParameters(msg)
end
function Blurb:_makeIntroBlurbParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('intro-blurb-expiry')
else
return self:_getExpandedMessage('intro-blurb-noexpiry')
end
end
function Blurb:_makeIntroFragmentParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('intro-fragment-expiry')
else
return self:_getExpandedMessage('intro-fragment-noexpiry')
end
end
function Blurb:_makePagetypeParameter()
local pagetypes = self._cfg.pagetypes
return pagetypes[self._protectionObj.title.namespace]
or pagetypes.default
or error('no default pagetype defined', 8)
end
function Blurb:_makeProtectionBlurbParameter()
local protectionBlurbs = self._cfg.protectionBlurbs
local action = self._protectionObj.action
local level = self._protectionObj.level
local msg
if protectionBlurbs[action][level] then
msg = protectionBlurbs[action][level]
elseif protectionBlurbs[action].default then
msg = protectionBlurbs[action].default
elseif protectionBlurbs.edit.default then
msg = protectionBlurbs.edit.default
else
error('no protection blurb defined for protectionBlurbs.edit.default', 8)
end
return self:_substituteParameters(msg)
end
function Blurb:_makeProtectionDateParameter()
local protectionDate = self._protectionObj.protectionDate
if type(protectionDate) == 'number' then
return self:_formatDate(protectionDate)
else
return protectionDate
end
end
function Blurb:_makeProtectionLevelParameter()
local protectionLevels = self._cfg.protectionLevels
local action = self._protectionObj.action
local level = self._protectionObj.level
local msg
if protectionLevels[action][level] then
msg = protectionLevels[action][level]
elseif protectionLevels[action].default then
msg = protectionLevels[action].default
elseif protectionLevels.edit.default then
msg = protectionLevels.edit.default
else
error('no protection level defined for protectionLevels.edit.default', 8)
end
return self:_substituteParameters(msg)
end
function Blurb:_makeProtectionLogParameter()
local pagename = self._protectionObj.title.prefixedText
if self._protectionObj.action == 'autoreview' then
-- We need the pending changes log.
return makeFullUrl(
'Special:Log',
{type = 'stable', page = pagename},
self:_getExpandedMessage('pc-log-display')
)
else
-- We need the protection log.
return makeFullUrl(
'Special:Log',
{type = 'protect', page = pagename},
self:_getExpandedMessage('protection-log-display')
)
end
end
function Blurb:_makeTalkPageParameter()
return string.format(
'[[%s:%s#%s|%s]]',
mw.site.namespaces[self._protectionObj.title.namespace].talk.name,
self._protectionObj.title.text,
self._args.section or 'top',
self:_getExpandedMessage('talk-page-link-display')
)
end
function Blurb:_makeTooltipBlurbParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('tooltip-blurb-expiry')
else
return self:_getExpandedMessage('tooltip-blurb-noexpiry')
end
end
function Blurb:_makeTooltipFragmentParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('tooltip-fragment-expiry')
else
return self:_getExpandedMessage('tooltip-fragment-noexpiry')
end
end
function Blurb:_makeVandalTemplateParameter()
return mw.getCurrentFrame():expandTemplate{
title="vandal-m",
args={self._args.user or self._protectionObj.title.baseText}
}
end
-- Public methods --
function Blurb:makeBannerText(key)
-- Validate input.
if not key or not Blurb.bannerTextFields[key] then
error(string.format(
'"%s" is not a valid banner config field',
tostring(key)
), 2)
end
-- Generate the text.
local msg = self._protectionObj.bannerConfig[key]
if type(msg) == 'string' then
return self:_substituteParameters(msg)
elseif type(msg) == 'function' then
msg = msg(self._protectionObj, self._args)
if type(msg) ~= 'string' then
error(string.format(
'bad output from banner config function with key "%s"'
.. ' (expected string, got %s)',
tostring(key),
type(msg)
), 4)
end
return self:_substituteParameters(msg)
end
end
--------------------------------------------------------------------------------
-- BannerTemplate class
--------------------------------------------------------------------------------
local BannerTemplate = {}
BannerTemplate.__index = BannerTemplate
function BannerTemplate.new(protectionObj, cfg)
local obj = {}
obj._cfg = cfg
-- Set the image filename.
local imageFilename = protectionObj.bannerConfig.image
if imageFilename then
obj._imageFilename = imageFilename
else
-- If an image filename isn't specified explicitly in the banner config,
-- generate it from the protection status and the namespace.
local action = protectionObj.action
local level = protectionObj.level
local namespace = protectionObj.title.namespace
local reason = protectionObj.reason
-- Deal with special cases first.
if (
namespace == 10
or namespace == 828
or reason and obj._cfg.indefImageReasons[reason]
)
and action == 'edit'
and level == 'sysop'
and not protectionObj:isTemporary()
then
-- Fully protected modules and templates get the special red "indef"
-- padlock.
obj._imageFilename = obj._cfg.msg['image-filename-indef']
else
-- Deal with regular protection types.
local images = obj._cfg.images
if images[action] then
if images[action][level] then
obj._imageFilename = images[action][level]
elseif images[action].default then
obj._imageFilename = images[action].default
end
end
end
end
return setmetatable(obj, BannerTemplate)
end
function BannerTemplate:renderImage()
local filename = self._imageFilename
or self._cfg.msg['image-filename-default']
or 'Transparent.gif'
return makeFileLink{
file = filename,
size = (self.imageWidth or 20) .. 'px',
alt = self._imageAlt,
link = self._imageLink,
caption = self.imageCaption
}
end
--------------------------------------------------------------------------------
-- Banner class
--------------------------------------------------------------------------------
local Banner = setmetatable({}, BannerTemplate)
Banner.__index = Banner
function Banner.new(protectionObj, blurbObj, cfg)
local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
obj.imageWidth = 40
obj.imageCaption = blurbObj:makeBannerText('alt') -- Large banners use the alt text for the tooltip.
obj._reasonText = blurbObj:makeBannerText('text')
obj._explanationText = blurbObj:makeBannerText('explanation')
obj._page = protectionObj.title.prefixedText -- Only makes a difference in testing.
return setmetatable(obj, Banner)
end
function Banner:__tostring()
-- Renders the banner.
makeMessageBox = makeMessageBox or require('Module:Message box').main
local reasonText = self._reasonText or error('no reason text set', 2)
local explanationText = self._explanationText
local mbargs = {
page = self._page,
type = 'protection',
image = self:renderImage(),
text = string.format(
"'''%s'''%s",
reasonText,
explanationText and '<br />' .. explanationText or ''
)
}
return makeMessageBox('mbox', mbargs)
end
--------------------------------------------------------------------------------
-- Padlock class
--------------------------------------------------------------------------------
local Padlock = setmetatable({}, BannerTemplate)
Padlock.__index = Padlock
function Padlock.new(protectionObj, blurbObj, cfg)
local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
obj.imageWidth = 20
obj.imageCaption = blurbObj:makeBannerText('tooltip')
obj._imageAlt = blurbObj:makeBannerText('alt')
obj._imageLink = blurbObj:makeBannerText('link')
obj._indicatorName = cfg.padlockIndicatorNames[protectionObj.action]
or cfg.padlockIndicatorNames.default
or 'pp-default'
return setmetatable(obj, Padlock)
end
function Padlock:__tostring()
local frame = mw.getCurrentFrame()
-- The nowiki tag helps prevent whitespace at the top of articles.
return frame:extensionTag{name = 'nowiki'} .. frame:extensionTag{
name = 'indicator',
args = {name = self._indicatorName},
content = self:renderImage()
}
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p = {}
function p._exportClasses()
-- This is used for testing purposes.
return {
Protection = Protection,
Blurb = Blurb,
BannerTemplate = BannerTemplate,
Banner = Banner,
Padlock = Padlock,
}
end
function p._main(args, cfg, title)
args = args or {}
cfg = cfg or require(CONFIG_MODULE)
local protectionObj = Protection.new(args, cfg, title)
local ret = {}
-- If a page's edit protection is equally or more restrictive than its
-- protection from some other action, then don't bother displaying anything
-- for the other action (except categories).
if not yesno(args.catonly) and (protectionObj.action == 'edit' or
args.demolevel or
not getReachableNodes(
cfg.hierarchy,
protectionObj.level
)[effectiveProtectionLevel('edit', protectionObj.title)])
then
-- Initialise the blurb object
local blurbObj = Blurb.new(protectionObj, args, cfg)
-- Render the banner
if protectionObj:shouldShowLock() then
ret[#ret + 1] = tostring(
(yesno(args.small) and Padlock or Banner)
.new(protectionObj, blurbObj, cfg)
)
end
end
-- Render the categories
if yesno(args.category) ~= false then
ret[#ret + 1] = protectionObj:makeCategoryLinks()
end
return table.concat(ret)
end
function p.main(frame, cfg)
cfg = cfg or require(CONFIG_MODULE)
-- Find default args, if any.
local parent = frame.getParent and frame:getParent()
local defaultArgs = parent and cfg.wrappers[parent:getTitle():gsub('/sandbox$', '')]
-- Find user args, and use the parent frame if we are being called from a
-- wrapper template.
getArgs = getArgs or require('Module:Arguments').getArgs
local userArgs = getArgs(frame, {
parentOnly = defaultArgs,
frameOnly = not defaultArgs
})
-- Build the args table. User-specified args overwrite default args.
local args = {}
for k, v in pairs(defaultArgs or {}) do
args[k] = v
end
for k, v in pairs(userArgs) do
args[k] = v
end
return p._main(args, cfg)
end
return p
894f0884d4c2da1ce19d385b96f59af654b0946a
Module:Protection banner/config
828
34
71
70
2023-08-10T14:07:25Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- This module provides configuration data for [[Module:Protection banner]].
return {
--------------------------------------------------------------------------------
--
-- BANNER DATA
--
--------------------------------------------------------------------------------
--[[
-- Banner data consists of six fields:
-- * text - the main protection text that appears at the top of protection
-- banners.
-- * explanation - the text that appears below the main protection text, used
-- to explain the details of the protection.
-- * tooltip - the tooltip text you see when you move the mouse over a small
-- padlock icon.
-- * link - the page that the small padlock icon links to.
-- * alt - the alt text for the small padlock icon. This is also used as tooltip
-- text for the large protection banners.
-- * image - the padlock image used in both protection banners and small padlock
-- icons.
--
-- The module checks in three separate tables to find a value for each field.
-- First it checks the banners table, which has values specific to the reason
-- for the page being protected. Then the module checks the defaultBanners
-- table, which has values specific to each protection level. Finally, the
-- module checks the masterBanner table, which holds data for protection
-- templates to use if no data has been found in the previous two tables.
--
-- The values in the banner data can take parameters. These are specified
-- using ${TEXTLIKETHIS} (a dollar sign preceding a parameter name
-- enclosed in curly braces).
--
-- Available parameters:
--
-- ${CURRENTVERSION} - a link to the page history or the move log, with the
-- display message "current-version-edit-display" or
-- "current-version-move-display".
--
-- ${EDITREQUEST} - a link to create an edit request for the current page.
--
-- ${EXPLANATIONBLURB} - an explanation blurb, e.g. "Please discuss any changes
-- on the talk page; you may submit a request to ask an administrator to make
-- an edit if it is minor or supported by consensus."
--
-- ${IMAGELINK} - a link to set the image to, depending on the protection
-- action and protection level.
--
-- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry
-- is set. E.g. "Editing of this page by new or unregistered users is currently
-- disabled until dd Month YYYY."
--
-- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation
-- so that it can be used in run-on sentences.
--
-- ${PAGETYPE} - the type of the page, e.g. "article" or "template".
-- Defined in the cfg.pagetypes table.
--
-- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g.
-- "Editing of this page by new or unregistered users is currently disabled"
--
-- ${PROTECTIONDATE} - the protection date, if it has been supplied to the
-- template.
--
-- ${PROTECTIONLEVEL} - the protection level, e.g. "fully protected" or
-- "semi-protected".
--
-- ${PROTECTIONLOG} - a link to the protection log or the pending changes log,
-- depending on the protection action.
--
-- ${TALKPAGE} - a link to the talk page. If a section is specified, links
-- straight to that talk page section.
--
-- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to
-- create a blurb like "This template is semi-protected", or "This article is
-- move-protected until DD Month YYYY".
--
-- ${VANDAL} - links for the specified username (or the root page name)
-- using Module:Vandal-m.
--
-- Functions
--
-- For advanced users, it is possible to use Lua functions instead of strings
-- in the banner config tables. Using functions gives flexibility that is not
-- possible just by using parameters. Functions take two arguments, the
-- protection object and the template arguments, and they must output a string.
--
-- For example:
--
-- text = function (protectionObj, args)
-- if protectionObj.level == 'autoconfirmed' then
-- return 'foo'
-- else
-- return 'bar'
-- end
-- end
--
-- Some protection object properties and methods that may be useful:
-- protectionObj.action - the protection action
-- protectionObj.level - the protection level
-- protectionObj.reason - the protection reason
-- protectionObj.expiry - the expiry. Nil if unset, the string "indef" if set
-- to indefinite, and the protection time in unix time if temporary.
-- protectionObj.protectionDate - the protection date in unix time, or nil if
-- unspecified.
-- protectionObj.bannerConfig - the banner config found by the module. Beware
-- of editing the config field used by the function, as it could create an
-- infinite loop.
-- protectionObj:isProtected - returns a boolean showing whether the page is
-- protected.
-- protectionObj:isTemporary - returns a boolean showing whether the expiry is
-- temporary.
-- protectionObj:isIncorrect - returns a boolean showing whether the protection
-- template is incorrect.
--]]
-- The master banner data, used if no values have been found in banners or
-- defaultBanners.
masterBanner = {
text = '${INTROBLURB}',
explanation = '${EXPLANATIONBLURB}',
tooltip = '${TOOLTIPBLURB}',
link = '${IMAGELINK}',
alt = 'Page ${PROTECTIONLEVEL}'
},
-- The default banner data. This holds banner data for different protection
-- levels.
-- *required* - this table needs edit, move, autoreview and upload subtables.
defaultBanners = {
edit = {},
move = {},
autoreview = {
default = {
alt = 'Page protected with pending changes',
tooltip = 'All edits by unregistered and new users are subject to review prior to becoming visible to unregistered users',
image = 'Pending-protection-shackle.svg'
}
},
upload = {}
},
-- The banner data. This holds banner data for different protection reasons.
-- In fact, the reasons specified in this table control which reasons are
-- valid inputs to the first positional parameter.
--
-- There is also a non-standard "description" field that can be used for items
-- in this table. This is a description of the protection reason for use in the
-- module documentation.
--
-- *required* - this table needs edit, move, autoreview and upload subtables.
banners = {
edit = {
blp = {
description = 'For pages protected to promote compliance with the'
.. ' [[Wikipedia:Biographies of living persons'
.. '|biographies of living persons]] policy',
text = '${INTROFRAGMENT} to promote compliance with'
.. ' [[Wikipedia:Biographies of living persons'
.. "|Wikipedia's policy on the biographies"
.. ' of living people]].',
tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on'
.. ' biographies of living persons',
},
dmca = {
description = 'For pages protected by the Wikimedia Foundation'
.. ' due to [[Digital Millennium Copyright Act]] takedown requests',
explanation = function (protectionObj, args)
local ret = 'Pursuant to a rights owner notice under the Digital'
.. ' Millennium Copyright Act (DMCA) regarding some content'
.. ' in this article, the Wikimedia Foundation acted under'
.. ' applicable law and took down and restricted the content'
.. ' in question.'
if args.notice then
ret = ret .. ' A copy of the received notice can be found here: '
.. args.notice .. '.'
end
ret = ret .. ' For more information, including websites discussing'
.. ' how to file a counter-notice, please see'
.. " [[Wikipedia:Office actions]] and the article's ${TALKPAGE}."
.. "'''Do not remove this template from the article until the"
.. " restrictions are withdrawn'''."
return ret
end,
image = 'Office-protection-shackle.svg',
},
dispute = {
description = 'For pages protected due to editing disputes',
text = function (protectionObj, args)
-- Find the value of "disputes".
local display = 'disputes'
local disputes
if args.section then
disputes = string.format(
'[[%s:%s#%s|%s]]',
mw.site.namespaces[protectionObj.title.namespace].talk.name,
protectionObj.title.text,
args.section,
display
)
else
disputes = display
end
-- Make the blurb, depending on the expiry.
local msg
if type(protectionObj.expiry) == 'number' then
msg = '${INTROFRAGMENT} or until editing %s have been resolved.'
else
msg = '${INTROFRAGMENT} until editing %s have been resolved.'
end
return string.format(msg, disputes)
end,
explanation = "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
tooltip = '${TOOLTIPFRAGMENT} due to editing disputes',
},
ecp = {
description = 'For articles in topic areas authorized by'
.. ' [[Wikipedia:Arbitration Committee|ArbCom]] or'
.. ' meets the criteria for community use',
tooltip = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
alt = 'Extended-protected ${PAGETYPE}',
},
mainpage = {
description = 'For pages protected for being displayed on the [[Main Page]]',
text = 'This file is currently'
.. ' [[Wikipedia:This page is protected|protected]] from'
.. ' editing because it is currently or will soon be displayed'
.. ' on the [[Main Page]].',
explanation = 'Images on the Main Page are protected due to their high'
.. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.'
.. '<br /><span style="font-size:90%;">'
.. "'''Administrators:''' Once this image is definitely off the Main Page,"
.. ' please unprotect this file, or reduce to semi-protection,'
.. ' as appropriate.</span>',
},
office = {
description = 'For pages protected by the Wikimedia Foundation',
text = function (protectionObj, args)
local ret = 'This ${PAGETYPE} is currently under the'
.. ' scrutiny of the'
.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
.. ' and is protected.'
if protectionObj.protectionDate then
ret = ret .. ' It has been protected since ${PROTECTIONDATE}.'
end
return ret
end,
explanation = "If you can edit this page, please discuss all changes and"
.. " additions on the ${TALKPAGE} first. '''Do not remove protection from this"
.. " page unless you are authorized by the Wikimedia Foundation to do"
.. " so.'''",
image = 'Office-protection-shackle.svg',
},
reset = {
description = 'For pages protected by the Wikimedia Foundation and'
.. ' "reset" to a bare-bones version',
text = 'This ${PAGETYPE} is currently under the'
.. ' scrutiny of the'
.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
.. ' and is protected.',
explanation = function (protectionObj, args)
local ret = ''
if protectionObj.protectionDate then
ret = ret .. 'On ${PROTECTIONDATE} this ${PAGETYPE} was'
else
ret = ret .. 'This ${PAGETYPE} has been'
end
ret = ret .. ' reduced to a'
.. ' simplified, "bare bones" version so that it may be completely'
.. ' rewritten to ensure it meets the policies of'
.. ' [[WP:NPOV|Neutral Point of View]] and [[WP:V|Verifiability]].'
.. ' Standard Wikipedia policies will apply to its rewriting—which'
.. ' will eventually be open to all editors—and will be strictly'
.. ' enforced. The ${PAGETYPE} has been ${PROTECTIONLEVEL} while'
.. ' it is being rebuilt.\n\n'
.. 'Any insertion of material directly from'
.. ' pre-protection revisions of the ${PAGETYPE} will be removed, as'
.. ' will any material added to the ${PAGETYPE} that is not properly'
.. ' sourced. The associated talk page(s) were also cleared on the'
.. " same date.\n\n"
.. "If you can edit this page, please discuss all changes and"
.. " additions on the ${TALKPAGE} first. '''Do not override"
.. " this action, and do not remove protection from this page,"
.. " unless you are authorized by the Wikimedia Foundation"
.. " to do so. No editor may remove this notice.'''"
return ret
end,
image = 'Office-protection-shackle.svg',
},
sock = {
description = 'For pages protected due to'
.. ' [[Wikipedia:Sock puppetry|sock puppetry]]',
text = '${INTROFRAGMENT} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
.. ' [[Wikipedia:Blocking policy|blocked]] or'
.. ' [[Wikipedia:Banning policy|banned users]]'
.. ' from editing it.',
tooltip = '${TOOLTIPFRAGMENT} to prevent sock puppets of blocked or banned users from'
.. ' editing it',
},
template = {
description = 'For [[Wikipedia:High-risk templates|high-risk]]'
.. ' templates and Lua modules',
text = 'This is a permanently [[Help:Protection|protected]] ${PAGETYPE},'
.. ' as it is [[Wikipedia:High-risk templates|high-risk]].',
explanation = 'Please discuss any changes on the ${TALKPAGE}; you may'
.. ' ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] or'
.. ' [[Wikipedia:Template editor|template editor]] to make an edit if'
.. ' it is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by'
.. ' [[Wikipedia:Consensus|consensus]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.',
tooltip = 'This high-risk ${PAGETYPE} is permanently ${PROTECTIONLEVEL}'
.. ' to prevent vandalism',
alt = 'Permanently protected ${PAGETYPE}',
},
usertalk = {
description = 'For pages protected against disruptive edits by a'
.. ' particular user',
text = '${INTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,'
.. ' such as abusing the'
.. ' {{[[Template:unblock|unblock]]}} template.',
explanation = 'If you cannot edit this user talk page and you need to'
.. ' make a change or leave a message, you can'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for edits to a protected page'
.. '|request an edit]],'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]],'
.. ' [[Special:Userlogin|log in]],'
.. ' or [[Special:UserLogin/signup|create an account]].',
},
vandalism = {
description = 'For pages protected against'
.. ' [[Wikipedia:Vandalism|vandalism]]',
text = '${INTROFRAGMENT} due to [[Wikipedia:Vandalism|vandalism]].',
explanation = function (protectionObj, args)
local ret = ''
if protectionObj.level == 'sysop' then
ret = ret .. "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. '
end
return ret .. '${EXPLANATIONBLURB}'
end,
tooltip = '${TOOLTIPFRAGMENT} due to vandalism',
}
},
move = {
dispute = {
description = 'For pages protected against page moves due to'
.. ' disputes over the page title',
explanation = "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
image = 'Move-protection-shackle.svg'
},
vandalism = {
description = 'For pages protected against'
.. ' [[Wikipedia:Vandalism#Page-move vandalism'
.. ' |page-move vandalism]]'
}
},
autoreview = {},
upload = {}
},
--------------------------------------------------------------------------------
--
-- GENERAL DATA TABLES
--
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Protection blurbs
--------------------------------------------------------------------------------
-- This table produces the protection blurbs available with the
-- ${PROTECTIONBLURB} parameter. It is sorted by protection action and
-- protection level, and is checked by the module in the following order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
-- 3. "edit" protection action, default protection level
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
protectionBlurbs = {
edit = {
default = 'This ${PAGETYPE} is currently [[Help:Protection|'
.. 'protected]] from editing',
autoconfirmed = 'Editing of this ${PAGETYPE} by [[Wikipedia:User access'
.. ' levels#New users|new]] or [[Wikipedia:User access levels#Unregistered'
.. ' users|unregistered]] users is currently [[Help:Protection|disabled]]',
extendedconfirmed = 'This ${PAGETYPE} is currently under extended confirmed protection',
},
move = {
default = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'
.. ' from [[Help:Moving a page|page moves]]'
},
autoreview = {
default = 'All edits made to this ${PAGETYPE} by'
.. ' [[Wikipedia:User access levels#New users|new]] or'
.. ' [[Wikipedia:User access levels#Unregistered users|unregistered]]'
.. ' users are currently'
.. ' [[Wikipedia:Pending changes|subject to review]]'
},
upload = {
default = 'Uploading new versions of this ${PAGETYPE} is currently disabled'
}
},
--------------------------------------------------------------------------------
-- Explanation blurbs
--------------------------------------------------------------------------------
-- This table produces the explanation blurbs available with the
-- ${EXPLANATIONBLURB} parameter. It is sorted by protection action,
-- protection level, and whether the page is a talk page or not. If the page is
-- a talk page it will have a talk key of "talk"; otherwise it will have a talk
-- key of "subject". The table is checked in the following order:
-- 1. page's protection action, page's protection level, page's talk key
-- 2. page's protection action, page's protection level, default talk key
-- 3. page's protection action, default protection level, page's talk key
-- 4. page's protection action, default protection level, default talk key
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
explanationBlurbs = {
edit = {
autoconfirmed = {
subject = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
.. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
.. ' ${EDITREQUEST}, discuss changes on the ${TALKPAGE},'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]], [[Special:Userlogin|log in]], or'
.. ' [[Special:UserLogin/signup|create an account]].',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
.. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]], [[Special:Userlogin|log in]], or'
.. ' [[Special:UserLogin/signup|create an account]].',
},
extendedconfirmed = {
default = 'Extended confirmed protection prevents edits from all unregistered editors'
.. ' and registered users with fewer than 30 days tenure and 500 edits.'
.. ' The [[Wikipedia:Protection policy#extended|policy on community use]]'
.. ' specifies that extended confirmed protection can be applied to combat'
.. ' disruption, if semi-protection has proven to be ineffective.'
.. ' Extended confirmed protection may also be applied to enforce'
.. ' [[Wikipedia:Arbitration Committee|arbitration sanctions]].'
.. ' Please discuss any changes on the ${TALKPAGE}; you may'
.. ' ${EDITREQUEST} to ask for uncontroversial changes supported by'
.. ' [[Wikipedia:Consensus|consensus]].'
},
default = {
subject = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Please discuss any changes on the ${TALKPAGE}; you'
.. ' may ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
.. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
.. '|consensus]]. You may also [[Wikipedia:Requests for'
.. ' page protection#Current requests for reduction in protection level'
.. '|request]] that this page be unprotected.',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' You may [[Wikipedia:Requests for page'
.. ' protection#Current requests for edits to a protected page|request an'
.. ' edit]] to this page, or [[Wikipedia:Requests for'
.. ' page protection#Current requests for reduction in protection level'
.. '|ask]] for it to be unprotected.'
}
},
move = {
default = {
subject = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' The page may still be edited but cannot be moved'
.. ' until unprotected. Please discuss any suggested moves on the'
.. ' ${TALKPAGE} or at [[Wikipedia:Requested moves]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' The page may still be edited but cannot be moved'
.. ' until unprotected. Please discuss any suggested moves at'
.. ' [[Wikipedia:Requested moves]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.'
}
},
autoreview = {
default = {
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Edits to this ${PAGETYPE} by new and unregistered users'
.. ' will not be visible to readers until they are accepted by'
.. ' a reviewer. To avoid the need for your edits to be'
.. ' reviewed, you may'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]], [[Special:Userlogin|log in]], or'
.. ' [[Special:UserLogin/signup|create an account]].'
},
},
upload = {
default = {
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' The page may still be edited but new versions of the file'
.. ' cannot be uploaded until it is unprotected. You can'
.. ' request that a new version be uploaded by using a'
.. ' [[Wikipedia:Edit requests|protected edit request]], or you'
.. ' can [[Wikipedia:Requests for page protection|request]]'
.. ' that the file be unprotected.'
}
}
},
--------------------------------------------------------------------------------
-- Protection levels
--------------------------------------------------------------------------------
-- This table provides the data for the ${PROTECTIONLEVEL} parameter, which
-- produces a short label for different protection levels. It is sorted by
-- protection action and protection level, and is checked in the following
-- order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
-- 3. "edit" protection action, default protection level
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
protectionLevels = {
edit = {
default = 'protected',
templateeditor = 'template-protected',
extendedconfirmed = 'extended-protected',
autoconfirmed = 'semi-protected',
},
move = {
default = 'move-protected'
},
autoreview = {
},
upload = {
default = 'upload-protected'
}
},
--------------------------------------------------------------------------------
-- Images
--------------------------------------------------------------------------------
-- This table lists different padlock images for each protection action and
-- protection level. It is used if an image is not specified in any of the
-- banner data tables, and if the page does not satisfy the conditions for using
-- the ['image-filename-indef'] image. It is checked in the following order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
images = {
edit = {
default = 'Full-protection-shackle.svg',
templateeditor = 'Template-protection-shackle.svg',
extendedconfirmed = 'Extended-protection-shackle.svg',
autoconfirmed = 'Semi-protection-shackle.svg'
},
move = {
default = 'Move-protection-shackle.svg',
},
autoreview = {
default = 'Pending-protection-shackle.svg'
},
upload = {
default = 'Upload-protection-shackle.svg'
}
},
-- Pages with a reason specified in this table will show the special "indef"
-- padlock, defined in the 'image-filename-indef' message, if no expiry is set.
indefImageReasons = {
template = true
},
--------------------------------------------------------------------------------
-- Image links
--------------------------------------------------------------------------------
-- This table provides the data for the ${IMAGELINK} parameter, which gets
-- the image link for small padlock icons based on the page's protection action
-- and protection level. It is checked in the following order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
-- 3. "edit" protection action, default protection level
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
imageLinks = {
edit = {
default = 'Wikipedia:Protection policy#full',
templateeditor = 'Wikipedia:Protection policy#template',
extendedconfirmed = 'Wikipedia:Protection policy#extended',
autoconfirmed = 'Wikipedia:Protection policy#semi'
},
move = {
default = 'Wikipedia:Protection policy#move'
},
autoreview = {
default = 'Wikipedia:Protection policy#pending'
},
upload = {
default = 'Wikipedia:Protection policy#upload'
}
},
--------------------------------------------------------------------------------
-- Padlock indicator names
--------------------------------------------------------------------------------
-- This table provides the "name" attribute for the <indicator> extension tag
-- with which small padlock icons are generated. All indicator tags on a page
-- are displayed in alphabetical order based on this attribute, and with
-- indicator tags with duplicate names, the last tag on the page wins.
-- The attribute is chosen based on the protection action; table keys must be a
-- protection action name or the string "default".
padlockIndicatorNames = {
autoreview = 'pp-autoreview',
default = 'pp-default'
},
--------------------------------------------------------------------------------
-- Protection categories
--------------------------------------------------------------------------------
--[[
-- The protection categories are stored in the protectionCategories table.
-- Keys to this table are made up of the following strings:
--
-- 1. the expiry date
-- 2. the namespace
-- 3. the protection reason (e.g. "dispute" or "vandalism")
-- 4. the protection level (e.g. "sysop" or "autoconfirmed")
-- 5. the action (e.g. "edit" or "move")
--
-- When the module looks up a category in the table, first it will will check to
-- see a key exists that corresponds to all five parameters. For example, a
-- user page semi-protected from vandalism for two weeks would have the key
-- "temp-user-vandalism-autoconfirmed-edit". If no match is found, the module
-- changes the first part of the key to "all" and checks the table again. It
-- keeps checking increasingly generic key combinations until it finds the
-- field, or until it reaches the key "all-all-all-all-all".
--
-- The module uses a binary matrix to determine the order in which to search.
-- This is best demonstrated by a table. In this table, the "0" values
-- represent "all", and the "1" values represent the original data (e.g.
-- "indef" or "file" or "vandalism").
--
-- expiry namespace reason level action
-- order
-- 1 1 1 1 1 1
-- 2 0 1 1 1 1
-- 3 1 0 1 1 1
-- 4 0 0 1 1 1
-- 5 1 1 0 1 1
-- 6 0 1 0 1 1
-- 7 1 0 0 1 1
-- 8 0 0 0 1 1
-- 9 1 1 1 0 1
-- 10 0 1 1 0 1
-- 11 1 0 1 0 1
-- 12 0 0 1 0 1
-- 13 1 1 0 0 1
-- 14 0 1 0 0 1
-- 15 1 0 0 0 1
-- 16 0 0 0 0 1
-- 17 1 1 1 1 0
-- 18 0 1 1 1 0
-- 19 1 0 1 1 0
-- 20 0 0 1 1 0
-- 21 1 1 0 1 0
-- 22 0 1 0 1 0
-- 23 1 0 0 1 0
-- 24 0 0 0 1 0
-- 25 1 1 1 0 0
-- 26 0 1 1 0 0
-- 27 1 0 1 0 0
-- 28 0 0 1 0 0
-- 29 1 1 0 0 0
-- 30 0 1 0 0 0
-- 31 1 0 0 0 0
-- 32 0 0 0 0 0
--
-- In this scheme the action has the highest priority, as it is the last
-- to change, and the expiry has the least priority, as it changes the most.
-- The priorities of the expiry, the protection level and the action are
-- fixed, but the priorities of the reason and the namespace can be swapped
-- through the use of the cfg.bannerDataNamespaceHasPriority table.
--]]
-- If the reason specified to the template is listed in this table,
-- namespace data will take priority over reason data in the protectionCategories
-- table.
reasonsWithNamespacePriority = {
vandalism = true,
},
-- The string to use as a namespace key for the protectionCategories table for each
-- namespace number.
categoryNamespaceKeys = {
[ 2] = 'user',
[ 3] = 'user',
[ 4] = 'project',
[ 6] = 'file',
[ 8] = 'mediawiki',
[ 10] = 'template',
[ 12] = 'project',
[ 14] = 'category',
[100] = 'portal',
[828] = 'module',
},
protectionCategories = {
['all|all|all|all|all'] = 'Wikipedia fully protected pages',
['all|all|office|all|all'] = 'Wikipedia Office-protected pages',
['all|all|reset|all|all'] = 'Wikipedia Office-protected pages',
['all|all|dmca|all|all'] = 'Wikipedia Office-protected pages',
['all|all|mainpage|all|all'] = 'Wikipedia fully protected main page files',
['all|all|all|extendedconfirmed|all'] = 'Wikipedia extended-confirmed-protected pages',
['all|all|ecp|extendedconfirmed|all'] = 'Wikipedia extended-confirmed-protected pages',
['all|template|all|all|edit'] = 'Wikipedia fully protected templates',
['all|all|all|autoconfirmed|edit'] = 'Wikipedia semi-protected pages',
['indef|all|all|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected pages',
['all|all|blp|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected biographies of living people',
['temp|all|blp|autoconfirmed|edit'] = 'Wikipedia temporarily semi-protected biographies of living people',
['all|all|dispute|autoconfirmed|edit'] = 'Wikipedia pages semi-protected due to dispute',
['all|all|sock|autoconfirmed|edit'] = 'Wikipedia pages semi-protected from banned users',
['all|all|vandalism|autoconfirmed|edit'] = 'Wikipedia pages semi-protected against vandalism',
['all|category|all|autoconfirmed|edit'] = 'Wikipedia semi-protected categories',
['all|file|all|autoconfirmed|edit'] = 'Wikipedia semi-protected files',
['all|portal|all|autoconfirmed|edit'] = 'Wikipedia semi-protected portals',
['all|project|all|autoconfirmed|edit'] = 'Wikipedia semi-protected project pages',
['all|talk|all|autoconfirmed|edit'] = 'Wikipedia semi-protected talk pages',
['all|template|all|autoconfirmed|edit'] = 'Wikipedia semi-protected templates',
['all|user|all|autoconfirmed|edit'] = 'Wikipedia semi-protected user and user talk pages',
['all|all|all|templateeditor|edit'] = 'Wikipedia template-protected pages other than templates and modules',
['all|template|all|templateeditor|edit'] = 'Wikipedia template-protected templates',
['all|template|all|templateeditor|move'] = 'Wikipedia template-protected templates', -- move-protected templates
['all|all|blp|sysop|edit'] = 'Wikipedia indefinitely protected biographies of living people',
['temp|all|blp|sysop|edit'] = 'Wikipedia temporarily protected biographies of living people',
['all|all|dispute|sysop|edit'] = 'Wikipedia pages protected due to dispute',
['all|all|sock|sysop|edit'] = 'Wikipedia pages protected from banned users',
['all|all|vandalism|sysop|edit'] = 'Wikipedia pages protected against vandalism',
['all|category|all|sysop|edit'] = 'Wikipedia fully protected categories',
['all|file|all|sysop|edit'] = 'Wikipedia fully protected files',
['all|project|all|sysop|edit'] = 'Wikipedia fully protected project pages',
['all|talk|all|sysop|edit'] = 'Wikipedia fully protected talk pages',
['all|template|all|extendedconfirmed|edit'] = 'Wikipedia extended-confirmed-protected templates',
['all|template|all|sysop|edit'] = 'Wikipedia fully protected templates',
['all|user|all|sysop|edit'] = 'Wikipedia fully protected user and user talk pages',
['all|module|all|all|edit'] = 'Wikipedia fully protected modules',
['all|module|all|templateeditor|edit'] = 'Wikipedia template-protected modules',
['all|module|all|extendedconfirmed|edit'] = 'Wikipedia extended-confirmed-protected modules',
['all|module|all|autoconfirmed|edit'] = 'Wikipedia semi-protected modules',
['all|all|all|sysop|move'] = 'Wikipedia move-protected pages',
['indef|all|all|sysop|move'] = 'Wikipedia indefinitely move-protected pages',
['all|all|dispute|sysop|move'] = 'Wikipedia pages move-protected due to dispute',
['all|all|vandalism|sysop|move'] = 'Wikipedia pages move-protected due to vandalism',
['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals',
['all|project|all|sysop|move'] = 'Wikipedia move-protected project pages',
['all|talk|all|sysop|move'] = 'Wikipedia move-protected talk pages',
['all|template|all|sysop|move'] = 'Wikipedia move-protected templates',
['all|user|all|sysop|move'] = 'Wikipedia move-protected user and user talk pages',
['all|all|all|autoconfirmed|autoreview'] = 'Wikipedia pending changes protected pages',
['all|file|all|all|upload'] = 'Wikipedia upload-protected files',
},
--------------------------------------------------------------------------------
-- Expiry category config
--------------------------------------------------------------------------------
-- This table configures the expiry category behaviour for each protection
-- action.
-- * If set to true, setting that action will always categorise the page if
-- an expiry parameter is not set.
-- * If set to false, setting that action will never categorise the page.
-- * If set to nil, the module will categorise the page if:
-- 1) an expiry parameter is not set, and
-- 2) a reason is provided, and
-- 3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck
-- table.
expiryCheckActions = {
edit = nil,
move = false,
autoreview = true,
upload = false
},
reasonsWithoutExpiryCheck = {
blp = true,
template = true,
},
--------------------------------------------------------------------------------
-- Pagetypes
--------------------------------------------------------------------------------
-- This table produces the page types available with the ${PAGETYPE} parameter.
-- Keys are namespace numbers, or the string "default" for the default value.
pagetypes = {
[0] = 'article',
[6] = 'file',
[10] = 'template',
[14] = 'category',
[828] = 'module',
default = 'page'
},
--------------------------------------------------------------------------------
-- Strings marking indefinite protection
--------------------------------------------------------------------------------
-- This table contains values passed to the expiry parameter that mean the page
-- is protected indefinitely.
indefStrings = {
['indef'] = true,
['indefinite'] = true,
['indefinitely'] = true,
['infinite'] = true,
},
--------------------------------------------------------------------------------
-- Group hierarchy
--------------------------------------------------------------------------------
-- This table maps each group to all groups that have a superset of the original
-- group's page editing permissions.
hierarchy = {
sysop = {},
reviewer = {'sysop'},
filemover = {'sysop'},
templateeditor = {'sysop'},
extendedconfirmed = {'sysop'},
autoconfirmed = {'reviewer', 'filemover', 'templateeditor', 'extendedconfirmed'},
user = {'autoconfirmed'},
['*'] = {'user'}
},
--------------------------------------------------------------------------------
-- Wrapper templates and their default arguments
--------------------------------------------------------------------------------
-- This table contains wrapper templates used with the module, and their
-- default arguments. Templates specified in this table should contain the
-- following invocation, and no other template content:
--
-- {{#invoke:Protection banner|main}}
--
-- If other content is desired, it can be added between
-- <noinclude>...</noinclude> tags.
--
-- When a user calls one of these wrapper templates, they will use the
-- default arguments automatically. However, users can override any of the
-- arguments.
wrappers = {
['Template:Pp'] = {},
['Template:Pp-extended'] = {'ecp'},
['Template:Pp-blp'] = {'blp'},
-- we don't need Template:Pp-create
['Template:Pp-dispute'] = {'dispute'},
['Template:Pp-main-page'] = {'mainpage'},
['Template:Pp-move'] = {action = 'move', catonly = 'yes'},
['Template:Pp-move-dispute'] = {'dispute', action = 'move', catonly = 'yes'},
-- we don't need Template:Pp-move-indef
['Template:Pp-move-vandalism'] = {'vandalism', action = 'move', catonly = 'yes'},
['Template:Pp-office'] = {'office'},
['Template:Pp-office-dmca'] = {'dmca'},
['Template:Pp-pc'] = {action = 'autoreview', small = true},
['Template:Pp-pc1'] = {action = 'autoreview', small = true},
['Template:Pp-reset'] = {'reset'},
['Template:Pp-semi-indef'] = {small = true},
['Template:Pp-sock'] = {'sock'},
['Template:Pp-template'] = {'template', small = true},
['Template:Pp-upload'] = {action = 'upload'},
['Template:Pp-usertalk'] = {'usertalk'},
['Template:Pp-vandalism'] = {'vandalism'},
},
--------------------------------------------------------------------------------
--
-- MESSAGES
--
--------------------------------------------------------------------------------
msg = {
--------------------------------------------------------------------------------
-- Intro blurb and intro fragment
--------------------------------------------------------------------------------
-- These messages specify what is produced by the ${INTROBLURB} and
-- ${INTROFRAGMENT} parameters. If the protection is temporary they use the
-- intro-blurb-expiry or intro-fragment-expiry, and if not they use
-- intro-blurb-noexpiry or intro-fragment-noexpiry.
-- It is possible to use banner parameters in these messages.
['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.',
['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.',
['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},',
['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',
--------------------------------------------------------------------------------
-- Tooltip blurb
--------------------------------------------------------------------------------
-- These messages specify what is produced by the ${TOOLTIPBLURB} parameter.
-- If the protection is temporary the tooltip-blurb-expiry message is used, and
-- if not the tooltip-blurb-noexpiry message is used.
-- It is possible to use banner parameters in these messages.
['tooltip-blurb-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY}.',
['tooltip-blurb-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}.',
['tooltip-fragment-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY},',
['tooltip-fragment-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
--------------------------------------------------------------------------------
-- Special explanation blurb
--------------------------------------------------------------------------------
-- An explanation blurb for pages that cannot be unprotected, e.g. for pages
-- in the MediaWiki namespace.
-- It is possible to use banner parameters in this message.
['explanation-blurb-nounprotect'] = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Please discuss any changes on the ${TALKPAGE}; you'
.. ' may ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
.. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
.. '|consensus]].',
--------------------------------------------------------------------------------
-- Protection log display values
--------------------------------------------------------------------------------
-- These messages determine the display values for the protection log link
-- or the pending changes log link produced by the ${PROTECTIONLOG} parameter.
-- It is possible to use banner parameters in these messages.
['protection-log-display'] = 'protection log',
['pc-log-display'] = 'pending changes log',
--------------------------------------------------------------------------------
-- Current version display values
--------------------------------------------------------------------------------
-- These messages determine the display values for the page history link
-- or the move log link produced by the ${CURRENTVERSION} parameter.
-- It is possible to use banner parameters in these messages.
['current-version-move-display'] = 'current title',
['current-version-edit-display'] = 'current version',
--------------------------------------------------------------------------------
-- Talk page
--------------------------------------------------------------------------------
-- This message determines the display value of the talk page link produced
-- with the ${TALKPAGE} parameter.
-- It is possible to use banner parameters in this message.
['talk-page-link-display'] = 'talk page',
--------------------------------------------------------------------------------
-- Edit requests
--------------------------------------------------------------------------------
-- This message determines the display value of the edit request link produced
-- with the ${EDITREQUEST} parameter.
-- It is possible to use banner parameters in this message.
['edit-request-display'] = 'submit an edit request',
--------------------------------------------------------------------------------
-- Expiry date format
--------------------------------------------------------------------------------
-- This is the format for the blurb expiry date. It should be valid input for
-- the first parameter of the #time parser function.
['expiry-date-format'] = 'F j, Y "at" H:i e',
--------------------------------------------------------------------------------
-- Tracking categories
--------------------------------------------------------------------------------
-- These messages determine which tracking categories the module outputs.
['tracking-category-incorrect'] = 'Wikipedia pages with incorrect protection templates',
['tracking-category-template'] = 'Wikipedia template-protected pages other than templates and modules',
--------------------------------------------------------------------------------
-- Images
--------------------------------------------------------------------------------
-- These are images that are not defined by their protection action and protection level.
['image-filename-indef'] = 'Full-protection-shackle.svg',
['image-filename-default'] = 'Transparent.gif',
--------------------------------------------------------------------------------
-- End messages
--------------------------------------------------------------------------------
}
--------------------------------------------------------------------------------
-- End configuration
--------------------------------------------------------------------------------
}
a20552ae38cb5253a4fa29aa126abc74215a589f
Template:Anchor
10
35
73
72
2023-08-10T14:07:25Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:anchor|main}}<noinclude>
{{Documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
7d65122552007ac959072bddfa6f723296c81998
Module:Anchor
828
36
75
74
2023-08-10T14:07:26Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- This module implements {{anchor}}.
local getArgs = require('Module:Arguments').getArgs
local tableTools = require('Module:TableTools')
local p = {}
function p.main(frame)
-- Get the positional arguments from #invoke, remove any nil values,
-- and pass them to p._main.
local args = getArgs(frame)
local argArray = tableTools.compressSparseArray(args)
return p._main(unpack(argArray))
end
function p._main(...)
-- Generate the list of anchors.
local anchors = {...}
local ret = {}
for _, anchor in ipairs(anchors) do
ret[#ret + 1] = '<span class="anchor" id="' .. anchor .. '"></span>'
end
return table.concat(ret)
end
return p
e41d3f5d2f2840528aebb9bac719873540fcb3b8
Module:WikidataIB
828
37
77
76
2023-08-10T14:07:26Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- Version: 2023-07-10
-- Module to implement use of a blacklist and whitelist for infobox fields
-- Can take a named parameter |qid which is the Wikidata ID for the article
-- if not supplied, it will use the Wikidata ID associated with the current page.
-- Fields in blacklist are never to be displayed, i.e. module must return nil in all circumstances
-- Fields in whitelist return local value if it exists or the Wikidata value otherwise
-- The name of the field that this function is called from is passed in named parameter |name
-- The name is compulsory when blacklist or whitelist is used,
-- so the module returns nil if it is not supplied.
-- blacklist is passed in named parameter |suppressfields (or |spf)
-- whitelist is passed in named parameter |fetchwikidata (or |fwd)
require("strict")
local p = {}
local cdate -- initialise as nil and only load _complex_date function if needed
-- Module:Complex date is loaded lazily and has the following dependencies:
-- Module:Calendar
-- Module:ISOdate
-- Module:DateI18n
-- Module:I18n/complex date
-- Module:Ordinal
-- Module:I18n/ordinal
-- Module:Yesno
-- Module:Formatnum
-- Module:Linguistic
--
-- The following, taken from https://www.mediawiki.org/wiki/Wikibase/DataModel#Dates_and_times,
-- is needed to use Module:Complex date which seemingly requires date precision as a string.
-- It would work better if only the authors of the mediawiki page could spell 'millennium'.
local dp = {
[6] = "millennium",
[7] = "century",
[8] = "decade",
[9] = "year",
[10] = "month",
[11] = "day",
}
local i18n =
{
["errors"] =
{
["property-not-found"] = "Property not found.",
["No property supplied"] = "No property supplied",
["entity-not-found"] = "Wikidata entity not found.",
["unknown-claim-type"] = "Unknown claim type.",
["unknown-entity-type"] = "Unknown entity type.",
["qualifier-not-found"] = "Qualifier not found.",
["site-not-found"] = "Wikimedia project not found.",
["labels-not-found"] = "No labels found.",
["descriptions-not-found"] = "No descriptions found.",
["aliases-not-found"] = "No aliases found.",
["unknown-datetime-format"] = "Unknown datetime format.",
["local-article-not-found"] = "Article is available on Wikidata, but not on Wikipedia",
["dab-page"] = " (dab)",
},
["months"] =
{
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
},
["century"] = "century",
["BC"] = "BC",
["BCE"] = "BCE",
["ordinal"] =
{
[1] = "st",
[2] = "nd",
[3] = "rd",
["default"] = "th"
},
["filespace"] = "File",
["Unknown"] = "Unknown",
["NaN"] = "Not a number",
-- set the following to the name of a tracking category,
-- e.g. "[[Category:Articles with missing Wikidata information]]", or "" to disable:
["missinginfocat"] = "[[Category:Articles with missing Wikidata information]]",
["editonwikidata"] = "Edit this on Wikidata",
["latestdatequalifier"] = function (date) return "before " .. date end,
-- some languages, e.g. Bosnian use a period as a suffix after each number in a date
["datenumbersuffix"] = "",
["list separator"] = ", ",
["multipliers"] = {
[0] = "",
[3] = " thousand",
[6] = " million",
[9] = " billion",
[12] = " trillion",
}
}
-- This allows an internationisation module to override the above table
if 'en' ~= mw.getContentLanguage():getCode() then
require("Module:i18n").loadI18n("Module:WikidataIB/i18n", i18n)
end
-- This piece of html implements a collapsible container. Check the classes exist on your wiki.
local collapsediv = '<div class="mw-collapsible mw-collapsed" style="width:100%; overflow:auto;" data-expandtext="{{int:show}}" data-collapsetext="{{int:hide}}">'
-- Some items should not be linked.
-- Each wiki can create a list of those in Module:WikidataIB/nolinks
-- It should return a table called itemsindex, containing true for each item not to be linked
local donotlink = {}
local nolinks_exists, nolinks = pcall(mw.loadData, "Module:WikidataIB/nolinks")
if nolinks_exists then
donotlink = nolinks.itemsindex
end
-- To satisfy Wikipedia:Manual of Style/Titles, certain types of items are italicised, and others are quoted.
-- The submodule [[Module:WikidataIB/titleformats]] lists the entity-ids used in 'instance of' (P31),
-- which allows this module to identify the values that should be formatted.
-- WikidataIB/titleformats exports a table p.formats, which is indexed by entity-id, and contains the value " or ''
local formats = {}
local titleformats_exists, titleformats = pcall(mw.loadData, "Module:WikidataIB/titleformats")
if titleformats_exists then
formats = titleformats.formats
end
-------------------------------------------------------------------------------
-- Private functions
-------------------------------------------------------------------------------
--
-------------------------------------------------------------------------------
-- makeOrdinal needs to be internationalised along with the above:
-- takes cardinal number as a numeric and returns the ordinal as a string
-- we need three exceptions in English for 1st, 2nd, 3rd, 21st, .. 31st, etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local makeOrdinal = function(cardinal)
local ordsuffix = i18n.ordinal.default
if cardinal % 10 == 1 then
ordsuffix = i18n.ordinal[1]
elseif cardinal % 10 == 2 then
ordsuffix = i18n.ordinal[2]
elseif cardinal % 10 == 3 then
ordsuffix = i18n.ordinal[3]
end
-- In English, 1, 21, 31, etc. use 'st', but 11, 111, etc. use 'th'
-- similarly for 12 and 13, etc.
if (cardinal % 100 == 11) or (cardinal % 100 == 12) or (cardinal % 100 == 13) then
ordsuffix = i18n.ordinal.default
end
return tostring(cardinal) .. ordsuffix
end
-------------------------------------------------------------------------------
-- findLang takes a "langcode" parameter if supplied and valid
-- otherwise it tries to create it from the user's set language ({{int:lang}})
-- failing that it uses the wiki's content language.
-- It returns a language object
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local findLang = function(langcode)
local langobj
langcode = mw.text.trim(langcode or "")
if mw.language.isKnownLanguageTag(langcode) then
langobj = mw.language.new( langcode )
else
langcode = mw.getCurrentFrame():callParserFunction('int', {'lang'})
if mw.language.isKnownLanguageTag(langcode) then
langobj = mw.language.new( langcode )
else
langobj = mw.language.getContentLanguage()
end
end
return langobj
end
-------------------------------------------------------------------------------
-- _getItemLangCode takes a qid parameter (using the current page's qid if blank)
-- If the item for that qid has property country (P17) it looks at the first preferred value
-- If the country has an official language (P37), it looks at the first preferred value
-- If that official language has a language code (P424), it returns the first preferred value
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local _getItemLangCode = function(qid)
qid = mw.text.trim(qid or ""):upper()
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return end
local prop17 = mw.wikibase.getBestStatements(qid, "P17")[1]
if not prop17 or prop17.mainsnak.snaktype ~= "value" then return end
local qid17 = prop17.mainsnak.datavalue.value.id
local prop37 = mw.wikibase.getBestStatements(qid17, "P37")[1]
if not prop37 or prop37.mainsnak.snaktype ~= "value" then return end
local qid37 = prop37.mainsnak.datavalue.value.id
local prop424 = mw.wikibase.getBestStatements(qid37, "P424")[1]
if not prop424 or prop424.mainsnak.snaktype ~= "value" then return end
return prop424.mainsnak.datavalue.value
end
-------------------------------------------------------------------------------
-- roundto takes a number (x)
-- and returns it rounded to (sf) significant figures
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local roundto = function(x, sf)
if x == 0 then return 0 end
local s = 1
if x < 0 then
x = -x
s = -1
end
if sf < 1 then sf = 1 end
local p = 10 ^ (math.floor(math.log10(x)) - sf + 1)
x = math.floor(x / p + 0.5) * p * s
-- if it's integral, cast to an integer:
if x == math.floor(x) then x = math.floor(x) end
return x
end
-------------------------------------------------------------------------------
-- decimalToDMS takes a decimal degrees (x) with precision (p)
-- and returns degrees/minutes/seconds according to the precision
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local decimalToDMS = function(x, p)
-- if p is not supplied, use a precision around 0.1 seconds
if not tonumber(p) then p = 1e-4 end
local d = math.floor(x)
local ms = (x - d) * 60
if p > 0.5 then -- precision is > 1/2 a degree
if ms > 30 then d = d + 1 end
ms = 0
end
local m = math.floor(ms)
local s = (ms - m) * 60
if p > 0.008 then -- precision is > 1/2 a minute
if s > 30 then m = m +1 end
s = 0
elseif p > 0.00014 then -- precision is > 1/2 a second
s = math.floor(s + 0.5)
elseif p > 0.000014 then -- precision is > 1/20 second
s = math.floor(10 * s + 0.5) / 10
elseif p > 0.0000014 then -- precision is > 1/200 second
s = math.floor(100 * s + 0.5) / 100
else -- cap it at 3 dec places for now
s = math.floor(1000 * s + 0.5) / 1000
end
return d, m, s
end
-------------------------------------------------------------------------------
-- decimalPrecision takes a decimal (x) with precision (p)
-- and returns x rounded approximately to the given precision
-- precision should be between 1 and 1e-6, preferably a power of 10.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local decimalPrecision = function(x, p)
local s = 1
if x < 0 then
x = -x
s = -1
end
-- if p is not supplied, pick an arbitrary precision
if not tonumber(p) then p = 1e-4
elseif p > 1 then p = 1
elseif p < 1e-6 then p = 1e-6
else p = 10 ^ math.floor(math.log10(p))
end
x = math.floor(x / p + 0.5) * p * s
-- if it's integral, cast to an integer:
if x == math.floor(x) then x = math.floor(x) end
-- if it's less than 1e-4, it will be in exponent form, so return a string with 6dp
-- 9e-5 becomes 0.000090
if math.abs(x) < 1e-4 then x = string.format("%f", x) end
return x
end
-------------------------------------------------------------------------------
-- formatDate takes a datetime of the usual format from mw.wikibase.entity:formatPropertyValues
-- like "1 August 30 BCE" as parameter 1
-- and formats it according to the df (date format) and bc parameters
-- df = ["dmy" / "mdy" / "y"] default will be "dmy"
-- bc = ["BC" / "BCE"] default will be "BCE"
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local format_Date = function(datetime, dateformat, bc)
local datetime = datetime or "1 August 30 BCE" -- in case of nil value
-- chop off multiple vales and/or any hours, mins, etc.
-- keep anything before punctuation - we just want a single date:
local dateval = string.match( datetime, "[%w ]+")
local dateformat = string.lower(dateformat or "dmy") -- default to dmy
local bc = string.upper(bc or "") -- can't use nil for bc
-- we only want to accept two possibilities: BC or default to BCE
if bc == "BC" then
bc = " " .. i18n["BC"] -- prepend a non-breaking space.
else
bc = " " .. i18n["BCE"]
end
local postchrist = true -- start by assuming no BCE
local dateparts = {}
for word in string.gmatch(dateval, "%w+") do
if word == "BCE" or word == "BC" then -- *** internationalise later ***
postchrist = false
else
-- we'll keep the parts that are not 'BCE' in a table
dateparts[#dateparts + 1] = word
end
end
if postchrist then bc = "" end -- set AD dates to no suffix *** internationalise later ***
local sep = " " -- separator is nbsp
local fdate = table.concat(dateparts, sep) -- set formatted date to same order as input
-- if we have day month year, check dateformat
if #dateparts == 3 then
if dateformat == "y" then
fdate = dateparts[3]
elseif dateformat == "mdy" then
fdate = dateparts[2] .. sep .. dateparts[1] .. "," .. sep .. dateparts[3]
end
elseif #dateparts == 2 and dateformat == "y" then
fdate = dateparts[2]
end
return fdate .. bc
end
-------------------------------------------------------------------------------
-- dateFormat is the handler for properties that are of type "time"
-- It takes timestamp, precision (6 to 11 per mediawiki), dateformat (y/dmy/mdy), BC format (BC/BCE),
-- a plaindate switch (yes/no/adj) to en/disable "sourcing circumstances"/use adjectival form,
-- any qualifiers for the property, the language, and any adjective to use like 'before'.
-- It passes the date through the "complex date" function
-- and returns a string with the internatonalised date formatted according to preferences.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); cdate(); dp[]
-------------------------------------------------------------------------------
local dateFormat = function(timestamp, dprec, df, bcf, pd, qualifiers, lang, adj, model)
-- output formatting according to preferences (y/dmy/mdy/ymd)
df = (df or ""):lower()
-- if ymd is required, return the part of the timestamp in YYYY-MM-DD form
-- but apply Year zero#Astronomers fix: 1 BC = 0000; 2 BC = -0001; etc.
if df == "ymd" then
if timestamp:sub(1,1) == "+" then
return timestamp:sub(2,11)
else
local yr = tonumber(timestamp:sub(2,5)) - 1
yr = ("000" .. yr):sub(-4)
if yr ~= "0000" then yr = "-" .. yr end
return yr .. timestamp:sub(6,11)
end
end
-- A year can be stored like this: "+1872-00-00T00:00:00Z",
-- which is processed here as if it were the day before "+1872-01-01T00:00:00Z",
-- and that's the last day of 1871, so the year is wrong.
-- So fix the month 0, day 0 timestamp to become 1 January instead:
timestamp = timestamp:gsub("%-00%-00T", "-01-01T")
-- just in case date precision is missing
dprec = dprec or 11
-- override more precise dates if required dateformat is year alone:
if df == "y" and dprec > 9 then dprec = 9 end
-- complex date only deals with precisions from 6 to 11, so clip range
dprec = dprec>11 and 11 or dprec
dprec = dprec<6 and 6 or dprec
-- BC format is "BC" or "BCE"
bcf = (bcf or ""):upper()
-- plaindate only needs the first letter (y/n/a)
pd = (pd or ""):sub(1,1):lower()
if pd == "" or pd == "n" or pd == "f" or pd == "0" then pd = false end
-- in case language isn't passed
lang = lang or findLang().code
-- set adj as empty if nil
adj = adj or ""
-- extract the day, month, year from the timestamp
local bc = timestamp:sub(1, 1)=="-" and "BC" or ""
local year, month, day = timestamp:match("[+-](%d*)-(%d*)-(%d*)T")
local iso = tonumber(year) -- if year is missing, let it throw an error
-- this will adjust the date format to be compatible with cdate
-- possible formats are Y, YY, YYY0, YYYY, YYYY-MM, YYYY-MM-DD
if dprec == 6 then iso = math.floor( (iso - 1) / 1000 ) + 1 end
if dprec == 7 then iso = math.floor( (iso - 1) / 100 ) + 1 end
if dprec == 8 then iso = math.floor( iso / 10 ) .. "0" end
if dprec == 10 then iso = year .. "-" .. month end
if dprec == 11 then iso = year .. "-" .. month .. "-" .. day end
-- add "circa" (Q5727902) from "sourcing circumstances" (P1480)
local sc = not pd and qualifiers and qualifiers.P1480
if sc then
for k1, v1 in pairs(sc) do
if v1.datavalue and v1.datavalue.value.id == "Q5727902" then
adj = "circa"
break
end
end
end
-- deal with Julian dates:
-- no point in saying that dates before 1582 are Julian - they are by default
-- doesn't make sense for dates less precise than year
-- we can suppress it by setting |plaindate, e.g. for use in constructing categories.
local calendarmodel = ""
if tonumber(year) > 1582
and dprec > 8
and not pd
and model == "http://www.wikidata.org/entity/Q1985786" then
calendarmodel = "julian"
end
if not cdate then
cdate = require("Module:Complex date")._complex_date
end
local fdate = cdate(calendarmodel, adj, tostring(iso), dp[dprec], bc, "", "", "", "", lang, 1)
-- this may have QuickStatements info appended to it in a div, so remove that
fdate = fdate:gsub(' <div style="display: none;">[^<]*</div>', '')
-- it may also be returned wrapped in a microformat, so remove that
fdate = fdate:gsub("<[^>]*>", "")
-- there may be leading zeros that we should remove
fdate = fdate:gsub("^0*", "")
-- if a plain date is required, then remove any links (like BC linked)
if pd then
fdate = fdate:gsub("%[%[.*|", ""):gsub("]]", "")
end
-- if 'circa', use the abbreviated form *** internationalise later ***
fdate = fdate:gsub('circa ', '<abbr title="circa">c.</abbr> ')
-- deal with BC/BCE
if bcf == "BCE" then
fdate = fdate:gsub('BC', 'BCE')
end
-- deal with mdy format
if df == "mdy" then
fdate = fdate:gsub("(%d+) (%w+) (%d+)", "%2 %1, %3")
end
-- deal with adjectival form *** internationalise later ***
if pd == "a" then
fdate = fdate:gsub(' century', '-century')
end
return fdate
end
-------------------------------------------------------------------------------
-- parseParam takes a (string) parameter, e.g. from the list of frame arguments,
-- and makes "false", "no", and "0" into the (boolean) false
-- it makes the empty string and nil into the (boolean) value passed as default
-- allowing the parameter to be true or false by default.
-- It returns a boolean.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local parseParam = function(param, default)
if type(param) == "boolean" then param = tostring(param) end
if param and param ~= "" then
param = param:lower()
if (param == "false") or (param:sub(1,1) == "n") or (param == "0") then
return false
else
return true
end
else
return default
end
end
-------------------------------------------------------------------------------
-- _getSitelink takes the qid of a Wikidata entity passed as |qid=
-- It takes an optional parameter |wiki= to determine which wiki is to be checked for a sitelink
-- If the parameter is blank, then it uses the local wiki.
-- If there is a sitelink to an article available, it returns the plain text link to the article
-- If there is no sitelink, it returns nil.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local _getSitelink = function(qid, wiki)
qid = (qid or ""):upper()
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
wiki = wiki or ""
local sitelink
if wiki == "" then
sitelink = mw.wikibase.getSitelink(qid)
else
sitelink = mw.wikibase.getSitelink(qid, wiki)
end
return sitelink
end
-------------------------------------------------------------------------------
-- _getCommonslink takes an optional qid of a Wikidata entity passed as |qid=
-- It returns one of the following in order of preference:
-- the Commons sitelink of the Wikidata entity - but not if onlycat=true and it's not a category;
-- the Commons sitelink of the topic's main category of the Wikidata entity;
-- the Commons category of the Wikidata entity - unless fallback=false.
-------------------------------------------------------------------------------
-- Dependencies: _getSitelink(); parseParam()
-------------------------------------------------------------------------------
local _getCommonslink = function(qid, onlycat, fallback)
qid = (qid or ""):upper()
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
onlycat = parseParam(onlycat, false)
if fallback == "" then fallback = nil end
local sitelink = _getSitelink(qid, "commonswiki")
if onlycat and sitelink and sitelink:sub(1,9) ~= "Category:" then sitelink = nil end
if not sitelink then
-- check for topic's main category
local prop910 = mw.wikibase.getBestStatements(qid, "P910")[1]
if prop910 then
local tmcid = prop910.mainsnak.datavalue and prop910.mainsnak.datavalue.value.id
sitelink = _getSitelink(tmcid, "commonswiki")
end
if not sitelink then
-- check for list's main category
local prop1754 = mw.wikibase.getBestStatements(qid, "P1754")[1]
if prop1754 then
local tmcid = prop1754.mainsnak.datavalue and prop1754.mainsnak.datavalue.value.id
sitelink = _getSitelink(tmcid, "commonswiki")
end
end
end
if not sitelink and fallback then
-- check for Commons category (string value)
local prop373 = mw.wikibase.getBestStatements(qid, "P373")[1]
if prop373 then
sitelink = prop373.mainsnak.datavalue and prop373.mainsnak.datavalue.value
if sitelink then sitelink = "Category:" .. sitelink end
end
end
return sitelink
end
-------------------------------------------------------------------------------
-- The label in a Wikidata item is subject to vulnerabilities
-- that an attacker might try to exploit.
-- It needs to be 'sanitised' by removing any wikitext before use.
-- If it doesn't exist, return the id for the item
-- a second (boolean) value is also returned, value is true when the label exists
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local labelOrId = function(id, lang)
if lang == "default" then lang = findLang().code end
local label
if lang then
label = mw.wikibase.getLabelByLang(id, lang)
else
label = mw.wikibase.getLabel(id)
end
if label then
return mw.text.nowiki(label), true
else
return id, false
end
end
-------------------------------------------------------------------------------
-- linkedItem takes an entity-id and returns a string, linked if possible.
-- This is the handler for "wikibase-item". Preferences:
-- 1. Display linked disambiguated sitelink if it exists
-- 2. Display linked label if it is a redirect
-- 3. TBA: Display an inter-language link for the label if it exists other than in default language
-- 4. Display unlinked label if it exists
-- 5. Display entity-id for now to indicate a label could be provided
-- dtxt is text to be used instead of label, or nil.
-- shortname is boolean switch to use P1813 (short name) instead of label if true.
-- lang is the current language code.
-- uselbl is boolean switch to force display of the label instead of the sitelink (default: false)
-- linkredir is boolean switch to allow linking to a redirect (default: false)
-- formatvalue is boolean switch to allow formatting as italics or quoted (default: false)
-------------------------------------------------------------------------------
-- Dependencies: labelOrId(); donotlink[]
-------------------------------------------------------------------------------
local linkedItem = function(id, args)
local lprefix = (args.lp or args.lprefix or args.linkprefix or ""):gsub('"', '') -- toughen against nil values passed
local lpostfix = (args.lpostfix or ""):gsub('"', '')
local prefix = (args.prefix or ""):gsub('"', '')
local postfix = (args.postfix or ""):gsub('"', '')
local dtxt = args.dtxt
local shortname = args.shortname or args.sn
local lang = args.lang or "en" -- fallback to default if missing
local uselbl = args.uselabel or args.uselbl
uselbl = parseParam(uselbl, false)
local linkredir = args.linkredir
linkredir = parseParam(linkredir, false)
local formatvalue = args.formatvalue or args.fv
formatvalue = parseParam(formatvalue, false)
-- see if item might need italics or quotes
local fmt = ""
if next(formats) and formatvalue then
for k, v in ipairs( mw.wikibase.getBestStatements(id, "P31") ) do
if v.mainsnak.datavalue and formats[v.mainsnak.datavalue.value.id] then
fmt = formats[v.mainsnak.datavalue.value.id]
break -- pick the first match
end
end
end
local disp
local sitelink = mw.wikibase.getSitelink(id)
local label, islabel
if dtxt then
label, islabel = dtxt, true
elseif shortname then
-- see if there is a shortname in our language, and set label to it
for k, v in ipairs( mw.wikibase.getBestStatements(id, "P1813") ) do
if v.mainsnak.datavalue.value.language == lang then
label, islabel = v.mainsnak.datavalue.value.text, true
break
end -- test for language match
end -- loop through values of short name
-- if we have no label set, then there was no shortname available
if not islabel then
label, islabel = labelOrId(id)
shortname = false
end
else
label, islabel = labelOrId(id)
end
if mw.site.siteName ~= "Wikimedia Commons" then
if sitelink then
if not (dtxt or shortname) then
-- if sitelink and label are the same except for case, no need to process further
if sitelink:lower() ~= label:lower() then
-- strip any namespace or dab from the sitelink
local pos = sitelink:find(":") or 0
local slink = sitelink
if pos > 0 then
local pfx = sitelink:sub(1,pos-1)
if mw.site.namespaces[pfx] then -- that prefix is a valid namespace, so remove it
slink = sitelink:sub(pos+1)
end
end
-- remove stuff after commas or inside parentheses - ie. dabs
slink = slink:gsub("%s%(.+%)$", ""):gsub(",.+$", "")
-- if uselbl is false, use sitelink instead of label
if not uselbl then
-- use slink as display, preserving label case - find("^%u") is true for 1st char uppercase
if label:find("^%u") then
label = slink:gsub("^(%l)", string.upper)
else
label = slink:gsub("^(%u)", string.lower)
end
end
end
end
if donotlink[label] then
disp = prefix .. fmt .. label .. fmt .. postfix
else
disp = "[[" .. lprefix .. sitelink .. lpostfix .. "|" .. prefix .. fmt .. label .. fmt .. postfix .. "]]"
end
elseif islabel then
-- no sitelink, label exists, so check if a redirect with that title exists, if linkredir is true
-- display plain label by default
disp = prefix .. fmt .. label .. fmt .. postfix
if linkredir then
local artitle = mw.title.new(label, 0) -- only nil if label has invalid chars
if not donotlink[label] and artitle and artitle.redirectTarget then
-- there's a redirect with the same title as the label, so let's link to that
disp = "[[".. lprefix .. label .. lpostfix .. "|" .. prefix .. fmt .. label .. fmt .. postfix .. "]]"
end
end -- test if article title exists as redirect on current Wiki
else
-- no sitelink and no label, so return whatever was returned from labelOrId for now
-- add tracking category [[Category:Articles with missing Wikidata information]]
-- for enwiki, just return the tracking category
if mw.wikibase.getGlobalSiteId() == "enwiki" then
disp = i18n.missinginfocat
else
disp = prefix .. label .. postfix .. i18n.missinginfocat
end
end
else
local ccat = mw.wikibase.getBestStatements(id, "P373")[1]
if ccat and ccat.mainsnak.datavalue then
ccat = ccat.mainsnak.datavalue.value
disp = "[[" .. lprefix .. "Category:" .. ccat .. lpostfix .. "|" .. prefix .. label .. postfix .. "]]"
elseif sitelink then
-- this asumes that if a sitelink exists, then a label also exists
disp = "[[" .. lprefix .. sitelink .. lpostfix .. "|" .. prefix .. label .. postfix .. "]]"
else
-- no sitelink and no Commons cat, so return label from labelOrId for now
disp = prefix .. label .. postfix
end
end
return disp
end
-------------------------------------------------------------------------------
-- sourced takes a table representing a statement that may or may not have references
-- it looks for a reference sourced to something not containing the word "wikipedia"
-- it returns a boolean = true if it finds a sourced reference.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local sourced = function(claim)
if claim.references then
for kr, vr in pairs(claim.references) do
local ref = mw.wikibase.renderSnaks(vr.snaks)
if not ref:find("Wiki") then
return true
end
end
end
end
-------------------------------------------------------------------------------
-- setRanks takes a flag (parameter passed) that requests the values to return
-- "b[est]" returns preferred if available, otherwise normal
-- "p[referred]" returns preferred
-- "n[ormal]" returns normal
-- "d[eprecated]" returns deprecated
-- multiple values are allowed, e.g. "preferred normal" (which is the default)
-- "best" will override the other flags, and set p and n
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local setRanks = function(rank)
rank = (rank or ""):lower()
-- if nothing passed, return preferred and normal
-- if rank == "" then rank = "p n" end
local ranks = {}
for w in string.gmatch(rank, "%a+") do
w = w:sub(1,1)
if w == "b" or w == "p" or w == "n" or w == "d" then
ranks[w] = true
end
end
-- check if "best" is requested or no ranks requested; and if so, set preferred and normal
if ranks.b or not next(ranks) then
ranks.p = true
ranks.n = true
end
return ranks
end
-------------------------------------------------------------------------------
-- parseInput processes the Q-id , the blacklist and the whitelist
-- if an input parameter is supplied, it returns that and ends the call.
-- it returns (1) either the qid or nil indicating whether or not the call should continue
-- and (2) a table containing all of the statements for the propertyID and relevant Qid
-- if "best" ranks are requested, it returns those instead of all non-deprecated ranks
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local parseInput = function(frame, input_parm, property_id)
-- There may be a local parameter supplied, if it's blank, set it to nil
input_parm = mw.text.trim(input_parm or "")
if input_parm == "" then input_parm = nil end
-- return nil if Wikidata is not available
if not mw.wikibase then return false, input_parm end
local args = frame.args
-- can take a named parameter |qid which is the Wikidata ID for the article.
-- if it's not supplied, use the id for the current page
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
-- if there's no Wikidata item for the current page return nil
if not qid then return false, input_parm end
-- The blacklist is passed in named parameter |suppressfields
local blacklist = args.suppressfields or args.spf or ""
-- The whitelist is passed in named parameter |fetchwikidata
local whitelist = args.fetchwikidata or args.fwd or ""
if whitelist == "" then whitelist = "NONE" end
-- The name of the field that this function is called from is passed in named parameter |name
local fieldname = args.name or ""
if blacklist ~= "" then
-- The name is compulsory when blacklist is used, so return nil if it is not supplied
if fieldname == "" then return false, nil end
-- If this field is on the blacklist, then return nil
if blacklist:find(fieldname) then return false, nil end
end
-- If we got this far then we're not on the blacklist
-- The blacklist overrides any locally supplied parameter as well
-- If a non-blank input parameter was supplied return it
if input_parm then return false, input_parm end
-- We can filter out non-valid properties
if property_id:sub(1,1):upper() ~="P" or property_id == "P0" then return false, nil end
-- Otherwise see if this field is on the whitelist:
-- needs a bit more logic because find will return its second value = 0 if fieldname is ""
-- but nil if fieldname not found on whitelist
local _, found = whitelist:find(fieldname)
found = ((found or 0) > 0)
if whitelist ~= 'ALL' and (whitelist:upper() == "NONE" or not found) then
return false, nil
end
-- See what's on Wikidata (the call always returns a table, but it may be empty):
local props = {}
if args.reqranks.b then
props = mw.wikibase.getBestStatements(qid, property_id)
else
props = mw.wikibase.getAllStatements(qid, property_id)
end
if props[1] then
return qid, props
end
-- no property on Wikidata
return false, nil
end
-------------------------------------------------------------------------------
-- createicon assembles the "Edit at Wikidata" pen icon.
-- It returns a wikitext string inside a span class="penicon"
-- if entityID is nil or empty, the ID associated with current page is used
-- langcode and propertyID may be nil or empty
-------------------------------------------------------------------------------
-- Dependencies: i18n[];
-------------------------------------------------------------------------------
local createicon = function(langcode, entityID, propertyID)
langcode = langcode or ""
if not entityID or entityID == "" then entityID= mw.wikibase.getEntityIdForCurrentPage() end
propertyID = propertyID or ""
local icon = " <span class='penicon autoconfirmed-show'>[["
-- " <span data-bridge-edit-flow='overwrite' class='penicon'>[[" -> enable Wikidata Bridge
.. i18n["filespace"]
.. ":OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt="
.. i18n["editonwikidata"]
.. "|link=https://www.wikidata.org/wiki/" .. entityID
if langcode ~= "" then icon = icon .. "?uselang=" .. langcode end
if propertyID ~= "" then icon = icon .. "#" .. propertyID end
icon = icon .. "|" .. i18n["editonwikidata"] .. "]]</span>"
return icon
end
-------------------------------------------------------------------------------
-- assembleoutput takes the sequence table containing the property values
-- and formats it according to switches given. It returns a string or nil.
-- It uses the entityID (and optionally propertyID) to create a link in the pen icon.
-------------------------------------------------------------------------------
-- Dependencies: parseParam();
-------------------------------------------------------------------------------
local assembleoutput = function(out, args, entityID, propertyID)
-- sorted is a boolean passed to enable sorting of the values returned
-- if nothing or an empty string is passed set it false
-- if "false" or "no" or "0" is passed set it false
local sorted = parseParam(args.sorted, false)
-- noicon is a boolean passed to suppress the trailing "edit at Wikidata" icon
-- for use when the value is processed further by the infobox
-- if nothing or an empty string is passed set it false
-- if "false" or "no" or "0" is passed set it false
local noic = parseParam(args.noicon, false)
-- list is the name of a template that a list of multiple values is passed through
-- examples include "hlist" and "ubl"
-- setting it to "prose" produces something like "1, 2, 3, and 4"
local list = args.list or ""
-- sep is a string that is used to separate multiple returned values
-- if nothing or an empty string is passed set it to the default
-- any double-quotes " are stripped out, so that spaces may be passed
-- e.g. |sep=" - "
local sepdefault = i18n["list separator"]
local separator = args.sep or ""
separator = string.gsub(separator, '"', '')
if separator == "" then
separator = sepdefault
end
-- collapse is a number that determines the maximum number of returned values
-- before the output is collapsed.
-- Zero or not a number result in no collapsing (default becomes 0).
local collapse = tonumber(args.collapse) or 0
-- replacetext (rt) is a string that is returned instead of any non-empty Wikidata value
-- this is useful for tracking and debugging
local replacetext = mw.text.trim(args.rt or args.replacetext or "")
-- if there's anything to return, then return a list
-- comma-separated by default, but may be specified by the sep parameter
-- optionally specify a hlist or ubl or a prose list, etc.
local strout
if #out > 0 then
if sorted then table.sort(out) end
-- if there's something to display and a pen icon is wanted, add it the end of the last value
local hasdisplay = false
for i, v in ipairs(out) do
if v ~= i18n.missinginfocat then
hasdisplay = true
break
end
end
if not noic and hasdisplay then
out[#out] = out[#out] .. createicon(args.langobj.code, entityID, propertyID)
end
if list == "" then
strout = table.concat(out, separator)
elseif list:lower() == "prose" then
strout = mw.text.listToText( out )
else
strout = mw.getCurrentFrame():expandTemplate{title = list, args = out}
end
if collapse >0 and #out > collapse then
strout = collapsediv .. strout .. "</div>"
end
else
strout = nil -- no items had valid reference
end
if replacetext ~= "" and strout then strout = replacetext end
return strout
end
-------------------------------------------------------------------------------
-- rendersnak takes a table (propval) containing the information stored on one property value
-- and returns the value as a string and its language if monolingual text.
-- It handles data of type:
-- wikibase-item
-- time
-- string, url, commonsMedia, external-id
-- quantity
-- globe-coordinate
-- monolingualtext
-- It also requires linked, the link/pre/postfixes, uabbr, and the arguments passed from frame.
-- The optional filter parameter allows quantities to be be filtered by unit Qid.
-------------------------------------------------------------------------------
-- Dependencies: parseParam(); labelOrId(); i18n[]; dateFormat();
-- roundto(); decimalPrecision(); decimalToDMS(); linkedItem();
-------------------------------------------------------------------------------
local rendersnak = function(propval, args, linked, lpre, lpost, pre, post, uabbr, filter)
lpre = lpre or ""
lpost = lpost or ""
pre = pre or ""
post = post or ""
args.lang = args.lang or findLang().code
-- allow values to display a fixed text instead of label
local dtxt = args.displaytext or args.dt
if dtxt == "" then dtxt = nil end
-- switch to use display of short name (P1813) instead of label
local shortname = args.shortname or args.sn
shortname = parseParam(shortname, false)
local snak = propval.mainsnak or propval
local dtype = snak.datatype
local dv = snak.datavalue
dv = dv and dv.value
-- value and monolingual text language code returned
local val, mlt
if propval.rank and not args.reqranks[propval.rank:sub(1, 1)] then
-- val is nil: value has a rank that isn't requested
------------------------------------
elseif snak.snaktype == "somevalue" then -- value is unknown
val = i18n["Unknown"]
------------------------------------
elseif snak.snaktype == "novalue" then -- value is none
-- val = "No value" -- don't return anything
------------------------------------
elseif dtype == "wikibase-item" then -- data type is a wikibase item:
-- it's wiki-linked value, so output as link if enabled and possible
local qnumber = dv.id
if linked then
val = linkedItem(qnumber, args)
else -- no link wanted so check for display-text, otherwise test for lang code
local label, islabel
if dtxt then
label = dtxt
else
label, islabel = labelOrId(qnumber)
local langlabel = mw.wikibase.getLabelByLang(qnumber, args.lang)
if langlabel then
label = mw.text.nowiki( langlabel )
end
end
val = pre .. label .. post
end -- test for link required
------------------------------------
elseif dtype == "time" then -- data type is time:
-- time is in timestamp format
-- date precision is integer per mediawiki
-- output formatting according to preferences (y/dmy/mdy)
-- BC format as BC or BCE
-- plaindate is passed to disable looking for "sourcing cirumstances"
-- or to set the adjectival form
-- qualifiers (if any) is a nested table or nil
-- lang is given, or user language, or site language
--
-- Here we can check whether args.df has a value
-- If not, use code from Module:Sandbox/RexxS/Getdateformat to set it from templates like {{Use mdy dates}}
val = dateFormat(dv.time, dv.precision, args.df, args.bc, args.pd, propval.qualifiers, args.lang, "", dv.calendarmodel)
------------------------------------
-- data types which are strings:
elseif dtype == "commonsMedia" or dtype == "external-id" or dtype == "string" or dtype == "url" then
-- commonsMedia or external-id or string or url
-- all have mainsnak.datavalue.value as string
if (lpre == "" or lpre == ":") and lpost == "" then
-- don't link if no linkpre/postfix or linkprefix is just ":"
val = pre .. dv .. post
elseif dtype == "external-id" then
val = "[" .. lpre .. dv .. lpost .. " " .. pre .. dv .. post .. "]"
else
val = "[[" .. lpre .. dv .. lpost .. "|" .. pre .. dv .. post .. "]]"
end -- check for link requested (i.e. either linkprefix or linkpostfix exists)
------------------------------------
-- data types which are quantities:
elseif dtype == "quantity" then
-- quantities have mainsnak.datavalue.value.amount and mainsnak.datavalue.value.unit
-- the unit is of the form http://www.wikidata.org/entity/Q829073
--
-- implement a switch to turn on/off numerical formatting later
local fnum = true
--
-- a switch to turn on/off conversions - only for en-wiki
local conv = parseParam(args.conv or args.convert, false)
-- if we have conversions, we won't have formatted numbers or scales
if conv then
uabbr = true
fnum = false
args.scale = "0"
end
--
-- a switch to turn on/off showing units, default is true
local showunits = parseParam(args.su or args.showunits, true)
--
-- convert amount to a number
local amount = tonumber(dv.amount) or i18n["NaN"]
--
-- scale factor for millions, billions, etc.
local sc = tostring(args.scale or ""):sub(1,1):lower()
local scale
if sc == "a" then
-- automatic scaling
if amount > 1e15 then
scale = 12
elseif amount > 1e12 then
scale = 9
elseif amount > 1e9 then
scale = 6
elseif amount > 1e6 then
scale = 3
else
scale = 0
end
else
scale = tonumber(args.scale) or 0
if scale < 0 or scale > 12 then scale = 0 end
scale = math.floor(scale/3) * 3
end
local factor = 10^scale
amount = amount / factor
-- ranges:
local range = ""
-- check if upper and/or lower bounds are given and significant
local upb = tonumber(dv.upperBound)
local lowb = tonumber(dv.lowerBound)
if upb and lowb then
-- differences rounded to 2 sig fig:
local posdif = roundto(upb - amount, 2) / factor
local negdif = roundto(amount - lowb, 2) / factor
upb, lowb = amount + posdif, amount - negdif
-- round scaled numbers to integers or 4 sig fig
if (scale > 0 or sc == "a") then
if amount < 1e4 then
amount = roundto(amount, 4)
else
amount = math.floor(amount + 0.5)
end
end
if fnum then amount = args.langobj:formatNum( amount ) end
if posdif ~= negdif then
-- non-symmetrical
range = " +" .. posdif .. " -" .. negdif
elseif posdif ~= 0 then
-- symmetrical and non-zero
range = " ±" .. posdif
else
-- otherwise range is zero, so leave it as ""
end
else
-- round scaled numbers to integers or 4 sig fig
if (scale > 0 or sc == "a") then
if amount < 1e4 then
amount = roundto(amount, 4)
else
amount = math.floor(amount + 0.5)
end
end
if fnum then amount = args.langobj:formatNum( amount ) end
end
-- unit names and symbols:
-- extract the qid in the form 'Qnnn' from the value.unit url
-- and then fetch the label from that - or symbol if unitabbr is true
local unit = ""
local usep = ""
local usym = ""
local unitqid = string.match( dv.unit, "(Q%d+)" )
if filter and unitqid ~= filter then return nil end
if unitqid and showunits then
local uname = mw.wikibase.getLabelByLang(unitqid, args.lang) or ""
if uname ~= "" then usep, unit = " ", uname end
if uabbr then
-- see if there's a unit symbol (P5061)
local unitsymbols = mw.wikibase.getBestStatements(unitqid, "P5061")
-- construct fallback table, add local lang and multiple languages
local fbtbl = mw.language.getFallbacksFor( args.lang )
table.insert( fbtbl, 1, args.lang )
table.insert( fbtbl, 1, "mul" )
local found = false
for idx1, us in ipairs(unitsymbols) do
for idx2, fblang in ipairs(fbtbl) do
if us.mainsnak.datavalue.value.language == fblang then
usym = us.mainsnak.datavalue.value.text
found = true
break
end
if found then break end
end -- loop through fallback table
end -- loop through values of P5061
if found then usep, unit = " ", usym end
end
end
-- format display:
if conv then
if range == "" then
val = mw.getCurrentFrame():expandTemplate{title = "cvt", args = {amount, unit}}
else
val = mw.getCurrentFrame():expandTemplate{title = "cvt", args = {lowb, "to", upb, unit}}
end
elseif unit == "$" or unit == "£" then
val = unit .. amount .. range .. i18n.multipliers[scale]
else
val = amount .. range .. i18n.multipliers[scale] .. usep .. unit
end
------------------------------------
-- datatypes which are global coordinates:
elseif dtype == "globe-coordinate" then
-- 'display' parameter defaults to "inline, title" *** unused for now ***
-- local disp = args.display or ""
-- if disp == "" then disp = "inline, title" end
--
-- format parameter switches from deg/min/sec to decimal degrees
-- default is deg/min/sec -- decimal degrees needs |format = dec
local form = (args.format or ""):lower():sub(1,3)
if form ~= "dec" then form = "dms" end -- not needed for now
--
-- show parameter allows just the latitude, or just the longitude, or both
-- to be returned as a signed decimal, ignoring the format parameter.
local show = (args.show or ""):lower()
if show ~= "longlat" then show = show:sub(1,3) end
--
local lat, long, prec = dv.latitude, dv.longitude, dv.precision
if show == "lat" then
val = decimalPrecision(lat, prec)
elseif show == "lon" then
val = decimalPrecision(long, prec)
elseif show == "longlat" then
val = decimalPrecision(long, prec) .. ", " .. decimalPrecision(lat, prec)
else
local ns = "N"
local ew = "E"
if lat < 0 then
ns = "S"
lat = - lat
end
if long < 0 then
ew = "W"
long = - long
end
if form == "dec" then
lat = decimalPrecision(lat, prec)
long = decimalPrecision(long, prec)
val = lat .. "°" .. ns .. " " .. long .. "°" .. ew
else
local latdeg, latmin, latsec = decimalToDMS(lat, prec)
local longdeg, longmin, longsec = decimalToDMS(long, prec)
if latsec == 0 and longsec == 0 then
if latmin == 0 and longmin == 0 then
val = latdeg .. "°" .. ns .. " " .. longdeg .. "°" .. ew
else
val = latdeg .. "°" .. latmin .. "′" .. ns .. " "
val = val .. longdeg .. "°".. longmin .. "′" .. ew
end
else
val = latdeg .. "°" .. latmin .. "′" .. latsec .. "″" .. ns .. " "
val = val .. longdeg .. "°" .. longmin .. "′" .. longsec .. "″" .. ew
end
end
end
------------------------------------
elseif dtype == "monolingualtext" then -- data type is Monolingual text:
-- has mainsnak.datavalue.value as a table containing language/text pairs
-- collect all the values in 'out' and languages in 'mlt' and process them later
val = pre .. dv.text .. post
mlt = dv.language
------------------------------------
else
-- some other data type so write a specific handler
val = "unknown data type: " .. dtype
end -- of datatype/unknown value/sourced check
return val, mlt
end
-------------------------------------------------------------------------------
-- propertyvalueandquals takes a property object, the arguments passed from frame,
-- and a qualifier propertyID.
-- It returns a sequence (table) of values representing the values of that property
-- and qualifiers that match the qualifierID if supplied.
-------------------------------------------------------------------------------
-- Dependencies: parseParam(); sourced(); labelOrId(); i18n.latestdatequalifier(); format_Date();
-- makeOrdinal(); roundto(); decimalPrecision(); decimalToDMS(); assembleoutput();
-------------------------------------------------------------------------------
local function propertyvalueandquals(objproperty, args, qualID)
-- needs this style of declaration because it's re-entrant
-- onlysourced is a boolean passed to return only values sourced to other than Wikipedia
-- if nothing or an empty string is passed set it true
local onlysrc = parseParam(args.onlysourced or args.osd, true)
-- linked is a a boolean that enables the link to a local page via sitelink
-- if nothing or an empty string is passed set it true
local linked = parseParam(args.linked, true)
-- prefix is a string that may be nil, empty (""), or a string of characters
-- this is prefixed to each value
-- useful when when multiple values are returned
-- any double-quotes " are stripped out, so that spaces may be passed
local prefix = (args.prefix or ""):gsub('"', '')
-- postfix is a string that may be nil, empty (""), or a string of characters
-- this is postfixed to each value
-- useful when when multiple values are returned
-- any double-quotes " are stripped out, so that spaces may be passed
local postfix = (args.postfix or ""):gsub('"', '')
-- linkprefix is a string that may be nil, empty (""), or a string of characters
-- this creates a link and is then prefixed to each value
-- useful when when multiple values are returned and indirect links are needed
-- any double-quotes " are stripped out, so that spaces may be passed
local lprefix = (args.linkprefix or args.lp or ""):gsub('"', '')
-- linkpostfix is a string that may be nil, empty (""), or a string of characters
-- this is postfixed to each value when linking is enabled with lprefix
-- useful when when multiple values are returned
-- any double-quotes " are stripped out, so that spaces may be passed
local lpostfix = (args.linkpostfix or ""):gsub('"', '')
-- wdlinks is a boolean passed to enable links to Wikidata when no article exists
-- if nothing or an empty string is passed set it false
local wdl = parseParam(args.wdlinks or args.wdl, false)
-- unitabbr is a boolean passed to enable unit abbreviations for common units
-- if nothing or an empty string is passed set it false
local uabbr = parseParam(args.unitabbr or args.uabbr, false)
-- qualsonly is a boolean passed to return just the qualifiers
-- if nothing or an empty string is passed set it false
local qualsonly = parseParam(args.qualsonly or args.qo, false)
-- maxvals is a string that may be nil, empty (""), or a number
-- this determines how many items may be returned when multiple values are available
-- setting it = 1 is useful where the returned string is used within another call, e.g. image
local maxvals = tonumber(args.maxvals) or 0
-- pd (plain date) is a string: yes/true/1 | no/false/0 | adj
-- to disable/enable "sourcing cirumstances" or use adjectival form for the plain date
local pd = args.plaindate or args.pd or "no"
args.pd = pd
-- allow qualifiers to have a different date format; default to year unless qualsonly is set
args.qdf = args.qdf or args.qualifierdateformat or args.df or (not qualsonly and "y")
local lang = args.lang or findLang().code
-- qualID is a string list of wanted qualifiers or "ALL"
qualID = qualID or ""
-- capitalise list of wanted qualifiers and substitute "DATES"
qualID = qualID:upper():gsub("DATES", "P580, P582")
local allflag = (qualID == "ALL")
-- create table of wanted qualifiers as key
local qwanted = {}
-- create sequence of wanted qualifiers
local qorder = {}
for q in mw.text.gsplit(qualID, "%p") do -- split at punctuation and iterate
local qtrim = mw.text.trim(q)
if qtrim ~= "" then
qwanted[mw.text.trim(q)] = true
qorder[#qorder+1] = qtrim
end
end
-- qsep is the output separator for rendering qualifier list
local qsep = (args.qsep or ""):gsub('"', '')
-- qargs are the arguments to supply to assembleoutput()
local qargs = {
["osd"] = "false",
["linked"] = tostring(linked),
["prefix"] = args.qprefix,
["postfix"] = args.qpostfix,
["linkprefix"] = args.qlinkprefix or args.qlp,
["linkpostfix"] = args.qlinkpostfix,
["wdl"] = "false",
["unitabbr"] = tostring(uabbr),
["maxvals"] = 0,
["sorted"] = tostring(args.qsorted),
["noicon"] = "true",
["list"] = args.qlist,
["sep"] = qsep,
["langobj"] = args.langobj,
["lang"] = args.langobj.code,
["df"] = args.qdf,
["sn"] = parseParam(args.qsn or args.qshortname, false),
}
-- all proper values of a Wikidata property will be the same type as the first
-- qualifiers don't have a mainsnak, properties do
local datatype = objproperty[1].datatype or objproperty[1].mainsnak.datatype
-- out[] holds the a list of returned values for this property
-- mlt[] holds the language code if the datatype is monolingual text
local out = {}
local mlt = {}
for k, v in ipairs(objproperty) do
local hasvalue = true
if (onlysrc and not sourced(v)) then
-- no value: it isn't sourced when onlysourced=true
hasvalue = false
else
local val, lcode = rendersnak(v, args, linked, lprefix, lpostfix, prefix, postfix, uabbr)
if not val then
hasvalue = false -- rank doesn't match
elseif qualsonly and qualID then
-- suppress value returned: only qualifiers are requested
else
out[#out+1], mlt[#out+1] = val, lcode
end
end
-- See if qualifiers are to be returned:
local snak = v.mainsnak or v
if hasvalue and v.qualifiers and qualID ~= "" and snak.snaktype~="novalue" then
-- collect all wanted qualifier values returned in qlist, indexed by propertyID
local qlist = {}
local timestart, timeend = "", ""
-- loop through qualifiers
for k1, v1 in pairs(v.qualifiers) do
if allflag or qwanted[k1] then
if k1 == "P1326" then
local ts = v1[1].datavalue.value.time
local dp = v1[1].datavalue.value.precision
qlist[k1] = dateFormat(ts, dp, args.qdf, args.bc, pd, "", lang, "before")
elseif k1 == "P1319" then
local ts = v1[1].datavalue.value.time
local dp = v1[1].datavalue.value.precision
qlist[k1] = dateFormat(ts, dp, args.qdf, args.bc, pd, "", lang, "after")
elseif k1 == "P580" then
timestart = propertyvalueandquals(v1, qargs)[1] or "" -- treat only one start time as valid
elseif k1 == "P582" then
timeend = propertyvalueandquals(v1, qargs)[1] or "" -- treat only one end time as valid
else
local q = assembleoutput(propertyvalueandquals(v1, qargs), qargs)
-- we already deal with circa via 'sourcing circumstances' if the datatype was time
-- circa may be either linked or unlinked *** internationalise later ***
if datatype ~= "time" or q ~= "circa" and not (type(q) == "string" and q:find("circa]]")) then
qlist[k1] = q
end
end
end -- of test for wanted
end -- of loop through qualifiers
-- set date separator
local t = timestart .. timeend
-- *** internationalise date separators later ***
local dsep = "–"
if t:find("%s") or t:find(" ") then dsep = " – " end
-- set the order for the list of qualifiers returned; start time and end time go last
if next(qlist) then
local qlistout = {}
if allflag then
for k2, v2 in pairs(qlist) do
qlistout[#qlistout+1] = v2
end
else
for i2, v2 in ipairs(qorder) do
qlistout[#qlistout+1] = qlist[v2]
end
end
if t ~= "" then
qlistout[#qlistout+1] = timestart .. dsep .. timeend
end
local qstr = assembleoutput(qlistout, qargs)
if qualsonly then
out[#out+1] = qstr
else
out[#out] = out[#out] .. " (" .. qstr .. ")"
end
elseif t ~= "" then
if qualsonly then
if timestart == "" then
out[#out+1] = timeend
elseif timeend == "" then
out[#out+1] = timestart
else
out[#out+1] = timestart .. dsep .. timeend
end
else
out[#out] = out[#out] .. " (" .. timestart .. dsep .. timeend .. ")"
end
end
end -- of test for qualifiers wanted
if maxvals > 0 and #out >= maxvals then break end
end -- of for each value loop
-- we need to pick one value to return if the datatype was "monolingualtext"
-- if there's only one value, use that
-- otherwise look through the fallback languages for a match
if datatype == "monolingualtext" and #out >1 then
lang = mw.text.split( lang, '-', true )[1]
local fbtbl = mw.language.getFallbacksFor( lang )
table.insert( fbtbl, 1, lang )
local bestval = ""
local found = false
for idx1, lang1 in ipairs(fbtbl) do
for idx2, lang2 in ipairs(mlt) do
if (lang1 == lang2) and not found then
bestval = out[idx2]
found = true
break
end
end -- loop through values of property
end -- loop through fallback languages
if found then
-- replace output table with a table containing the best value
out = { bestval }
else
-- more than one value and none of them on the list of fallback languages
-- sod it, just give them the first one
out = { out[1] }
end
end
return out
end
-------------------------------------------------------------------------------
-- Common code for p.getValueByQual and p.getValueByLang
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; assembleoutput;
-------------------------------------------------------------------------------
local _getvaluebyqual = function(frame, qualID, checkvalue)
-- The property ID that will have a qualifier is the first unnamed parameter
local propertyID = mw.text.trim(frame.args[1] or "")
if propertyID == "" then return "no property supplied" end
if qualID == "" then return "no qualifier supplied" end
-- onlysourced is a boolean passed to return property values
-- only when property values are sourced to something other than Wikipedia
-- if nothing or an empty string is passed set it true
-- if "false" or "no" or 0 is passed set it false
local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)
-- set the requested ranks flags
frame.args.reqranks = setRanks(frame.args.rank)
-- set a language object and code in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local args = frame.args
-- check for locally supplied parameter in second unnamed parameter
-- success means no local parameter and the property exists
local qid, props = parseInput(frame, args[2], propertyID)
local linked = parseParam(args.linked, true)
local lpre = (args.linkprefix or args.lp or ""):gsub('"', '')
local lpost = (args.linkpostfix or ""):gsub('"', '')
local pre = (args.prefix or ""):gsub('"', '')
local post = (args.postfix or ""):gsub('"', '')
local uabbr = parseParam(args.unitabbr or args.uabbr, false)
local filter = (args.unit or ""):upper()
local maxvals = tonumber(args.maxvals) or 0
if filter == "" then filter = nil end
if qid then
local out = {}
-- Scan through the values of the property
-- we want something like property is "pronunciation audio (P443)" in propertyID
-- with a qualifier like "language of work or name (P407)" in qualID
-- whose value has the required ID, like "British English (Q7979)", in qval
for k1, v1 in ipairs(props) do
if v1.mainsnak.snaktype == "value" then
-- check if it has the right qualifier
local v1q = v1.qualifiers
if v1q and v1q[qualID] then
if onlysrc == false or sourced(v1) then
-- if we've got this far, we have a (sourced) claim with qualifiers
-- so see if matches the required value
-- We'll only deal with wikibase-items and strings for now
if v1q[qualID][1].datatype == "wikibase-item" then
if checkvalue(v1q[qualID][1].datavalue.value.id) then
out[#out + 1] = rendersnak(v1, args, linked, lpre, lpost, pre, post, uabbr, filter)
end
elseif v1q[qualID][1].datatype == "string" then
if checkvalue(v1q[qualID][1].datavalue.value) then
out[#out + 1] = rendersnak(v1, args, linked, lpre, lpost, pre, post, uabbr, filter)
end
end
end -- of check for sourced
end -- of check for matching required value and has qualifiers
else
return nil
end -- of check for string
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through values of propertyID
return assembleoutput(out, frame.args, qid, propertyID)
else
return props -- either local parameter or nothing
end -- of test for success
return nil
end
-------------------------------------------------------------------------------
-- _location takes Q-id and follows P276 (location)
-- or P131 (located in the administrative territorial entity) or P706 (located on terrain feature)
-- from the initial item to higher level territories/locations until it reaches the highest.
-- An optional boolean, 'first', determines whether the first item is returned (default: false).
-- An optional boolean 'skip' toggles the display to skip to the last item (default: false).
-- It returns a table containing the locations - linked where possible, except for the highest.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); labelOrId(); linkedItem
-------------------------------------------------------------------------------
local _location = function(qid, first, skip)
first = parseParam(first, false)
skip = parseParam(skip, false)
local locs = {"P276", "P131", "P706"}
local out = {}
local langcode = findLang():getCode()
local finished = false
local count = 0
local prevqid = "Q0"
repeat
local prop
for i1, v1 in ipairs(locs) do
local proptbl = mw.wikibase.getBestStatements(qid, v1)
if #proptbl > 1 then
-- there is more than one higher location
local prevP131, prevP131id
if prevqid ~= "Q0" then
prevP131 = mw.wikibase.getBestStatements(prevqid, "P131")[1]
prevP131id = prevP131
and prevP131.mainsnak.datavalue
and prevP131.mainsnak.datavalue.value.id
end
for i2, v2 in ipairs(proptbl) do
local parttbl = v2.qualifiers and v2.qualifiers.P518
if parttbl then
-- this higher location has qualifier 'applies to part' (P518)
for i3, v3 in ipairs(parttbl) do
if v3.snaktype == "value" and v3.datavalue.value.id == prevqid then
-- it has a value equal to the previous location
prop = proptbl[i2]
break
end -- of test for matching last location
end -- of loop through values of 'applies to part'
else
-- there's no qualifier 'applies to part' (P518)
-- so check if the previous location had a P131 that matches this alternate
if qid == prevP131id then
prop = proptbl[i2]
break
end -- of test for matching previous P131
end
end -- of loop through parent locations
-- fallback to second value if match not found
prop = prop or proptbl[2]
elseif #proptbl > 0 then
prop = proptbl[1]
end
if prop then break end
end
-- check if it's an instance of (P31) a country (Q6256) or sovereign state (Q3624078)
-- and terminate the chain if it is
local inst = mw.wikibase.getAllStatements(qid, "P31")
if #inst > 0 then
for k, v in ipairs(inst) do
local instid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id
-- stop if it's a country (or a country within the United Kingdom if skip is true)
if instid == "Q6256" or instid == "Q3624078" or (skip and instid == "Q3336843") then
prop = nil -- this will ensure this is treated as top-level location
break
end
end
end
-- get the name of this location and update qid to point to the parent location
if prop and prop.mainsnak.datavalue then
if not skip or count == 0 then
local args = { lprefix = ":" }
out[#out+1] = linkedItem(qid, args) -- get a linked value if we can
end
qid, prevqid = prop.mainsnak.datavalue.value.id, qid
else
-- This is top-level location, so get short name except when this is the first item
-- Use full label if there's no short name or this is the first item
local prop1813 = mw.wikibase.getAllStatements(qid, "P1813")
-- if there's a short name and this isn't the only item
if prop1813[1] and (#out > 0)then
local shortname
-- short name is monolingual text, so look for match to the local language
-- choose the shortest 'short name' in that language
for k, v in pairs(prop1813) do
if v.mainsnak.datavalue.value.language == langcode then
local name = v.mainsnak.datavalue.value.text
if (not shortname) or (#name < #shortname) then
shortname = name
end
end
end
-- add the shortname if one is found, fallback to the label
-- but skip it if it's "USA"
if shortname ~= "USA" then
out[#out+1] = shortname or labelOrId(qid)
else
if skip then out[#out+1] = "US" end
end
else
-- no shortname, so just add the label
local loc = labelOrId(qid)
-- exceptions go here:
if loc == "United States of America" then
out[#out+1] = "United States"
else
out[#out+1] = loc
end
end
finished = true
end
count = count + 1
until finished or count >= 10 -- limit to 10 levels to avoid infinite loops
-- remove the first location if not required
if not first then table.remove(out, 1) end
-- we might have duplicate text for consecutive locations, so remove them
if #out > 2 then
local plain = {}
for i, v in ipairs(out) do
-- strip any links
plain[i] = v:gsub("^%[%[[^|]*|", ""):gsub("]]$", "")
end
local idx = 2
repeat
if plain[idx] == plain[idx-1] then
-- duplicate found
local removeidx = 0
if (plain[idx] ~= out[idx]) and (plain[idx-1] == out[idx-1]) then
-- only second one is linked, so drop the first
removeidx = idx - 1
elseif (plain[idx] == out[idx]) and (plain[idx-1] ~= out[idx-1]) then
-- only first one is linked, so drop the second
removeidx = idx
else
-- pick one
removeidx = idx - (os.time()%2)
end
table.remove(out, removeidx)
table.remove(plain, removeidx)
else
idx = idx +1
end
until idx >= #out
end
return out
end
-------------------------------------------------------------------------------
-- _getsumofparts scans the property 'has part' (P527) for values matching a list.
-- The list (args.vlist) consists of a string of Qids separated by spaces or any usual punctuation.
-- If the matched values have a qualifer 'quantity' (P1114), those quantites are summed.
-- The sum is returned as a number (i.e. 0 if none)
-- a table of arguments is supplied implementing the usual parameters.
-------------------------------------------------------------------------------
-- Dependencies: setRanks; parseParam; parseInput; sourced; assembleoutput;
-------------------------------------------------------------------------------
local _getsumofparts = function(args)
local vallist = (args.vlist or ""):upper()
if vallist == "" then return end
args.reqranks = setRanks(args.rank)
local f = {}
f.args = args
local qid, props = parseInput(f, "", "P527")
if not qid then return 0 end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local sum = 0
for k1, v1 in ipairs(props) do
if (onlysrc == false or sourced(v1))
and v1.mainsnak.snaktype == "value"
and v1.mainsnak.datavalue.type == "wikibase-entityid"
and vallist:match( v1.mainsnak.datavalue.value.id )
and v1.qualifiers
then
local quals = v1.qualifiers["P1114"]
if quals then
for k2, v2 in ipairs(quals) do
sum = sum + v2.datavalue.value.amount
end
end
end
end
return sum
end
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Public functions
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- _getValue makes the functionality of getValue available to other modules
-------------------------------------------------------------------------------
-- Dependencies: setRanks; parseInput; propertyvalueandquals; assembleoutput; parseParam; sourced;
-- labelOrId; i18n.latestdatequalifier; format_Date; makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p._getValue = function(args)
-- parameter sets for commonly used groups of parameters
local paraset = tonumber(args.ps or args.parameterset or 0)
if paraset == 1 then
-- a common setting
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
elseif paraset == 2 then
-- equivalent to raw
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
args.linked = "no"
args.pd = "true"
elseif paraset == 3 then
-- third set goes here
end
-- implement eid parameter
local eid = args.eid
if eid == "" then
return nil
elseif eid then
args.qid = eid
end
local propertyID = mw.text.trim(args[1] or "")
args.reqranks = setRanks(args.rank)
-- replacetext (rt) is a string that is returned instead of any non-empty Wikidata value
-- this is useful for tracking and debugging, so we set fetchwikidata=ALL to fill the whitelist
local replacetext = mw.text.trim(args.rt or args.replacetext or "")
if replacetext ~= "" then
args.fetchwikidata = "ALL"
end
local f = {}
f.args = args
local entityid, props = parseInput(f, f.args[2], propertyID)
if not entityid then
return props -- either the input parameter or nothing
end
-- qual is a string containing the property ID of the qualifier(s) to be returned
-- if qual == "ALL" then all qualifiers returned
-- if qual == "DATES" then qualifiers P580 (start time) and P582 (end time) returned
-- if nothing or an empty string is passed set it nil -> no qualifiers returned
local qualID = mw.text.trim(args.qual or ""):upper()
if qualID == "" then qualID = nil end
-- set a language object and code in the args table
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
-- table 'out' stores the return value(s):
local out = propertyvalueandquals(props, args, qualID)
-- format the table of values and return it as a string:
return assembleoutput(out, args, entityid, propertyID)
end
-------------------------------------------------------------------------------
-- getValue is used to get the value(s) of a property
-- The property ID is passed as the first unnamed parameter and is required.
-- A locally supplied parameter may optionaly be supplied as the second unnamed parameter.
-- The function will now also return qualifiers if parameter qual is supplied
-------------------------------------------------------------------------------
-- Dependencies: _getValue; setRanks; parseInput; propertyvalueandquals; assembleoutput; parseParam; sourced;
-- labelOrId; i18n.latestdatequalifier; format_Date; makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p.getValue = function(frame)
local args= frame.args
if not args[1] then
args = frame:getParent().args
if not args[1] then return i18n.errors["No property supplied"] end
end
return p._getValue(args)
end
-------------------------------------------------------------------------------
-- getPreferredValue is used to get a value,
-- (or a comma separated list of them if multiple values exist).
-- If preferred ranks are set, it will return those values, otherwise values with normal ranks
-- now redundant to getValue with |rank=best
-------------------------------------------------------------------------------
-- Dependencies: p.getValue; setRanks; parseInput; propertyvalueandquals; assembleoutput;
-- parseParam; sourced; labelOrId; i18n.latestdatequalifier; format_Date;
-- makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p.getPreferredValue = function(frame)
frame.args.rank = "best"
return p.getValue(frame)
end
-------------------------------------------------------------------------------
-- getCoords is used to get coordinates for display in an infobox
-- whitelist and blacklist are implemented
-- optional 'display' parameter is allowed, defaults to nil - was "inline, title"
-------------------------------------------------------------------------------
-- Dependencies: setRanks(); parseInput(); decimalPrecision();
-------------------------------------------------------------------------------
p.getCoords = function(frame)
local propertyID = "P625"
-- if there is a 'display' parameter supplied, use it
-- otherwise default to nothing
local disp = frame.args.display or ""
if disp == "" then
disp = nil -- default to not supplying display parameter, was "inline, title"
end
-- there may be a format parameter to switch from deg/min/sec to decimal degrees
-- default is deg/min/sec
-- decimal degrees needs |format = dec
local form = (frame.args.format or ""):lower():sub(1,3)
if form ~= "dec" then
form = "dms"
end
-- just deal with best values
frame.args.reqranks = setRanks("best")
local qid, props = parseInput(frame, frame.args[1], propertyID)
if not qid then
return props -- either local parameter or nothing
else
local dv = props[1].mainsnak.datavalue.value
local lat, long, prec = dv.latitude, dv.longitude, dv.precision
lat = decimalPrecision(lat, prec)
long = decimalPrecision(long, prec)
local lat_long = { lat, long }
lat_long["display"] = disp
lat_long["format"] = form
-- invoke template Coord with the values stored in the table
return frame:expandTemplate{title = 'coord', args = lat_long}
end
end
-------------------------------------------------------------------------------
-- getQualifierValue is used to get a formatted value of a qualifier
--
-- The call needs: a property (the unnamed parameter or 1=)
-- a target value for that property (pval=)
-- a qualifier for that target value (qual=)
-- The usual whitelisting and blacklisting of the property is implemented
-- The boolean onlysourced= parameter can be set to return nothing
-- when the property is unsourced (or only sourced to Wikipedia)
-------------------------------------------------------------------------------
-- Dependencies: parseParam(); setRanks(); parseInput(); sourced();
-- propertyvalueandquals(); assembleoutput();
-- labelOrId(); i18n.latestdatequalifier(); format_Date();
-- findLang(); makeOrdinal(); roundto(); decimalPrecision(); decimalToDMS();
-------------------------------------------------------------------------------
p.getQualifierValue = function(frame)
-- The property ID that will have a qualifier is the first unnamed parameter
local propertyID = mw.text.trim(frame.args[1] or "")
-- The value of the property we want to match whose qualifier value is to be returned
-- is passed in named parameter |pval=
local propvalue = frame.args.pval
-- The property ID of the qualifier
-- whose value is to be returned is passed in named parameter |qual=
local qualifierID = frame.args.qual
-- A filter can be set like this: filter=P642==Q22674854
local filter, fprop, fval
local ftable = mw.text.split(frame.args.filter or "", "==")
if ftable[2] then
fprop = mw.text.trim(ftable[1])
fval = mw.text.trim(ftable[2])
filter = true
end
-- onlysourced is a boolean passed to return qualifiers
-- only when property values are sourced to something other than Wikipedia
-- if nothing or an empty string is passed set it true
-- if "false" or "no" or 0 is passed set it false
local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)
-- set a language object and language code in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
-- set the requested ranks flags
frame.args.reqranks = setRanks(frame.args.rank)
-- check for locally supplied parameter in second unnamed parameter
-- success means no local parameter and the property exists
local qid, props = parseInput(frame, frame.args[2], propertyID)
if qid then
local out = {}
-- Scan through the values of the property
-- we want something like property is P793, significant event (in propertyID)
-- whose value is something like Q385378, construction (in propvalue)
-- then we can return the value(s) of a qualifier such as P580, start time (in qualifierID)
for k1, v1 in pairs(props) do
if v1.mainsnak.snaktype == "value" and v1.mainsnak.datavalue.type == "wikibase-entityid" then
-- It's a wiki-linked value, so check if it's the target (in propvalue) and if it has qualifiers
if v1.mainsnak.datavalue.value.id == propvalue and v1.qualifiers then
if onlysrc == false or sourced(v1) then
-- if we've got this far, we have a (sourced) claim with qualifiers
-- which matches the target, so apply the filter and find the value(s) of the qualifier we want
if not filter or (v1.qualifiers[fprop] and v1.qualifiers[fprop][1].datavalue.value.id == fval) then
local quals = v1.qualifiers[qualifierID]
if quals then
-- can't reference qualifer, so set onlysourced = "no" (args are strings, not boolean)
local qargs = frame.args
qargs.onlysourced = "no"
local vals = propertyvalueandquals(quals, qargs, qid)
for k, v in ipairs(vals) do
out[#out + 1] = v
end
end
end
end -- of check for sourced
end -- of check for matching required value and has qualifiers
end -- of check for wikibase entity
end -- of loop through values of propertyID
return assembleoutput(out, frame.args, qid, propertyID)
else
return props -- either local parameter or nothing
end -- of test for success
return nil
end
-------------------------------------------------------------------------------
-- getSumOfParts scans the property 'has part' (P527) for values matching a list.
-- The list is passed in parameter vlist.
-- It consists of a string of Qids separated by spaces or any usual punctuation.
-- If the matched values have a qualifier 'quantity' (P1114), those quantities are summed.
-- The sum is returned as a number or nothing if zero.
-------------------------------------------------------------------------------
-- Dependencies: _getsumofparts;
-------------------------------------------------------------------------------
p.getSumOfParts = function(frame)
local sum = _getsumofparts(frame.args)
if sum == 0 then return end
return sum
end
-------------------------------------------------------------------------------
-- getValueByQual gets the value of a property which has a qualifier with a given entity value
-- The call needs:
-- a property ID (the unnamed parameter or 1=Pxxx)
-- the ID of a qualifier for that property (qualID=Pyyy)
-- either the Wikibase-entity ID of a value for that qualifier (qvalue=Qzzz)
-- or a string value for that qualifier (qvalue=abc123)
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: _getvaluebyqual; parseParam; setRanks; parseInput; sourced;
-- assembleoutput;
-------------------------------------------------------------------------------
p.getValueByQual = function(frame)
local qualID = frame.args.qualID
-- The Q-id of the value for the qualifier we want to match is in named parameter |qvalue=
local qval = frame.args.qvalue or ""
if qval == "" then return "no qualifier value supplied" end
local function checkQID(id)
return id == qval
end
return _getvaluebyqual(frame, qualID, checkQID)
end
-------------------------------------------------------------------------------
-- getValueByLang gets the value of a property which has a qualifier P407
-- ("language of work or name") whose value has the given language code
-- The call needs:
-- a property ID (the unnamed parameter or 1=Pxxx)
-- the MediaWiki language code to match the language (lang=xx[-yy])
-- (if no code is supplied, it uses the default language)
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: _getvaluebyqual; parseParam; setRanks; parseInput; sourced; assembleoutput;
-------------------------------------------------------------------------------
p.getValueByLang = function(frame)
-- The language code for the qualifier we want to match is in named parameter |lang=
local langcode = findLang(frame.args.lang).code
local function checkLanguage(id)
-- id should represent a language like "British English (Q7979)"
-- it should have string property "Wikimedia language code (P424)"
-- qlcode will be a table:
local qlcode = mw.wikibase.getBestStatements(id, "P424")
if (#qlcode > 0) and (qlcode[1].mainsnak.datavalue.value == langcode) then
return true
end
end
return _getvaluebyqual(frame, "P407", checkLanguage)
end
-------------------------------------------------------------------------------
-- getValueByRefSource gets the value of a property which has a reference "stated in" (P248)
-- whose value has the given entity-ID.
-- The call needs:
-- a property ID (the unnamed parameter or 1=Pxxx)
-- the entity ID of a value to match where the reference is stated in (match=Qzzz)
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getValueByRefSource = function(frame)
-- The property ID that we want to check is the first unnamed parameter
local propertyID = mw.text.trim(frame.args[1] or ""):upper()
if propertyID == "" then return "no property supplied" end
-- The Q-id of the value we want to match is in named parameter |qvalue=
local qval = (frame.args.match or ""):upper()
if qval == "" then qval = "Q21540096" end
local unit = (frame.args.unit or ""):upper()
if unit == "" then unit = "Q4917" end
local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)
-- set the requested ranks flags
frame.args.reqranks = setRanks(frame.args.rank)
-- set a language object and code in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local linked = parseParam(frame.args.linked, true)
local uabbr = parseParam(frame.args.uabbr or frame.args.unitabbr, false)
-- qid not nil means no local parameter and the property exists
local qid, props = parseInput(frame, frame.args[2], propertyID)
if qid then
local out = {}
local mlt= {}
for k1, v1 in ipairs(props) do
if onlysrc == false or sourced(v1) then
if v1.references then
for k2, v2 in ipairs(v1.references) do
if v2.snaks.P248 then
for k3, v3 in ipairs(v2.snaks.P248) do
if v3.datavalue.value.id == qval then
out[#out+1], mlt[#out+1] = rendersnak(v1, frame.args, linked, "", "", "", "", uabbr, unit)
if not mlt[#out] then
-- we only need one match per property value
-- unless datatype was monolingual text
break
end
end -- of test for match
end -- of loop through values "stated in"
end -- of test that "stated in" exists
end -- of loop through references
end -- of test that references exist
end -- of test for sourced
end -- of loop through values of propertyID
if #mlt > 0 then
local langcode = frame.args.lang
langcode = mw.text.split( langcode, '-', true )[1]
local fbtbl = mw.language.getFallbacksFor( langcode )
table.insert( fbtbl, 1, langcode )
local bestval = ""
local found = false
for idx1, lang1 in ipairs(fbtbl) do
for idx2, lang2 in ipairs(mlt) do
if (lang1 == lang2) and not found then
bestval = out[idx2]
found = true
break
end
end -- loop through values of property
end -- loop through fallback languages
if found then
-- replace output table with a table containing the best value
out = { bestval }
else
-- more than one value and none of them on the list of fallback languages
-- sod it, just give them the first one
out = { out[1] }
end
end
return assembleoutput(out, frame.args, qid, propertyID)
else
return props -- no property or local parameter supplied
end -- of test for success
end
-------------------------------------------------------------------------------
-- getPropertyIDs takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented.
-- It returns the Entity-IDs (Qids) of the values of a property if it is a Wikibase-Entity.
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p._getPropertyIDs = function(args)
args.reqranks = setRanks(args.rank)
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
-- change default for noicon to true
args.noicon = tostring(parseParam(args.noicon or "", true))
local f = {}
f.args = args
local pid = mw.text.trim(args[1] or ""):upper()
-- get the qid and table of claims for the property, or nothing and the local value passed
local qid, props = parseInput(f, args[2], pid)
if not qid then return props end
if not props[1] then return nil end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local out = {}
for i, v in ipairs(props) do
local snak = v.mainsnak
if ( snak.datatype == "wikibase-item" )
and ( v.rank and args.reqranks[v.rank:sub(1, 1)] )
and ( snak.snaktype == "value" )
and ( sourced(v) or not onlysrc )
then
out[#out+1] = snak.datavalue.value.id
end
if maxvals > 0 and #out >= maxvals then break end
end
return assembleoutput(out, args, qid, pid)
end
p.getPropertyIDs = function(frame)
local args = frame.args
return p._getPropertyIDs(args)
end
-------------------------------------------------------------------------------
-- getQualifierIDs takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented.
-- It takes a property-id as the first unnamed parameter, and an optional parameter qlist
-- which is a list of qualifier property-ids to search for (default is "ALL")
-- It returns the Entity-IDs (Qids) of the values of a property if it is a Wikibase-Entity.
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getQualifierIDs = function(frame)
local args = frame.args
args.reqranks = setRanks(args.rank)
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
-- change default for noicon to true
args.noicon = tostring(parseParam(args.noicon or "", true))
local f = {}
f.args = args
local pid = mw.text.trim(args[1] or ""):upper()
-- get the qid and table of claims for the property, or nothing and the local value passed
local qid, props = parseInput(f, args[2], pid)
if not qid then return props end
if not props[1] then return nil end
-- get the other parameters
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local qlist = args.qlist or ""
if qlist == "" then qlist = "ALL" end
qlist = qlist:gsub("[%p%s]+", " ") .. " "
local out = {}
for i, v in ipairs(props) do
local snak = v.mainsnak
if ( v.rank and args.reqranks[v.rank:sub(1, 1)] )
and ( snak.snaktype == "value" )
and ( sourced(v) or not onlysrc )
then
if v.qualifiers then
for k1, v1 in pairs(v.qualifiers) do
if qlist == "ALL " or qlist:match(k1 .. " ") then
for i2, v2 in ipairs(v1) do
if v2.datatype == "wikibase-item" and v2.snaktype == "value" then
out[#out+1] = v2.datavalue.value.id
end -- of test that id exists
end -- of loop through qualifier values
end -- of test for kq in qlist
end -- of loop through qualifiers
end -- of test for qualifiers
end -- of test for rank value, sourced, and value exists
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through property values
return assembleoutput(out, args, qid, pid)
end
-------------------------------------------------------------------------------
-- getPropOfProp takes two propertyIDs: prop1 and prop2 (as well as the usual parameters)
-- If the value(s) of prop1 are of type "wikibase-item" then it returns the value(s) of prop2
-- of each of those wikibase-items.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p._getPropOfProp = function(args)
-- parameter sets for commonly used groups of parameters
local paraset = tonumber(args.ps or args.parameterset or 0)
if paraset == 1 then
-- a common setting
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
elseif paraset == 2 then
-- equivalent to raw
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
args.linked = "no"
args.pd = "true"
elseif paraset == 3 then
-- third set goes here
end
args.reqranks = setRanks(args.rank)
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
local pid1 = args.prop1 or args.pid1 or ""
local pid2 = args.prop2 or args.pid2 or ""
if pid1 == "" or pid2 == "" then return nil end
local f = {}
f.args = args
local qid1, statements1 = parseInput(f, args[1], pid1)
-- parseInput nulls empty args[1] and returns args[1] if nothing on Wikidata
if not qid1 then return statements1 end
-- otherwise it returns the qid and a table for the statement
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local qualID = mw.text.trim(args.qual or ""):upper()
if qualID == "" then qualID = nil end
local out = {}
for k, v in ipairs(statements1) do
if not onlysrc or sourced(v) then
local snak = v.mainsnak
if snak.datatype == "wikibase-item" and snak.snaktype == "value" then
local qid2 = snak.datavalue.value.id
local statements2 = {}
if args.reqranks.b then
statements2 = mw.wikibase.getBestStatements(qid2, pid2)
else
statements2 = mw.wikibase.getAllStatements(qid2, pid2)
end
if statements2[1] then
local out2 = propertyvalueandquals(statements2, args, qualID)
out[#out+1] = assembleoutput(out2, args, qid2, pid2)
end
end -- of test for valid property1 value
end -- of test for sourced
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through values of property1
return assembleoutput(out, args, qid1, pid1)
end
p.getPropOfProp = function(frame)
local args= frame.args
if not args.prop1 and not args.pid1 then
args = frame:getParent().args
if not args.prop1 and not args.pid1 then return i18n.errors["No property supplied"] end
end
return p._getPropOfProp(args)
end
-------------------------------------------------------------------------------
-- getAwardCat takes most of the usual parameters. If the item has values of P166 (award received),
-- then it examines each of those awards for P2517 (category for recipients of this award).
-- If it exists, it returns the corresponding category,
-- with the item's P734 (family name) as sort key, or no sort key if there is no family name.
-- The sort key may be overridden by the parameter |sortkey (alias |sk).
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getAwardCat = function(frame)
frame.args.reqranks = setRanks(frame.args.rank)
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local args = frame.args
args.sep = " "
local pid1 = args.prop1 or "P166"
local pid2 = args.prop2 or "P2517"
if pid1 == "" or pid2 == "" then return nil end
-- locally supplied value:
local localval = mw.text.trim(args[1] or "")
local qid1, statements1 = parseInput(frame, localval, pid1)
if not qid1 then return localval end
-- linkprefix (strip quotes)
local lp = (args.linkprefix or args.lp or ""):gsub('"', '')
-- sort key (strip quotes, hyphens and periods):
local sk = (args.sortkey or args.sk or ""):gsub('["-.]', '')
-- family name:
local famname = ""
if sk == "" then
local p734 = mw.wikibase.getBestStatements(qid1, "P734")[1]
local p734id = p734 and p734.mainsnak.snaktype == "value" and p734.mainsnak.datavalue.value.id or ""
famname = mw.wikibase.getSitelink(p734id) or ""
-- strip namespace and disambigation
local pos = famname:find(":") or 0
famname = famname:sub(pos+1):gsub("%s%(.+%)$", "")
if famname == "" then
local lbl = mw.wikibase.getLabel(p734id)
famname = lbl and mw.text.nowiki(lbl) or ""
end
end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local qualID = mw.text.trim(args.qual or ""):upper()
if qualID == "" then qualID = nil end
local out = {}
for k, v in ipairs(statements1) do
if not onlysrc or sourced(v) then
local snak = v.mainsnak
if snak.datatype == "wikibase-item" and snak.snaktype == "value" then
local qid2 = snak.datavalue.value.id
local statements2 = {}
if args.reqranks.b then
statements2 = mw.wikibase.getBestStatements(qid2, pid2)
else
statements2 = mw.wikibase.getAllStatements(qid2, pid2)
end
if statements2[1] and statements2[1].mainsnak.snaktype == "value" then
local qid3 = statements2[1].mainsnak.datavalue.value.id
local sitelink = mw.wikibase.getSitelink(qid3)
-- if there's no local sitelink, create the sitelink from English label
if not sitelink then
local lbl = mw.wikibase.getLabelByLang(qid3, "en")
if lbl then
if lbl:sub(1,9) == "Category:" then
sitelink = mw.text.nowiki(lbl)
else
sitelink = "Category:" .. mw.text.nowiki(lbl)
end
end
end
if sitelink then
if sk ~= "" then
out[#out+1] = "[[" .. lp .. sitelink .. "|" .. sk .. "]]"
elseif famname ~= "" then
out[#out+1] = "[[" .. lp .. sitelink .. "|" .. famname .. "]]"
else
out[#out+1] = "[[" .. lp .. sitelink .. "]]"
end -- of check for sort keys
end -- of test for sitelink
end -- of test for category
end -- of test for wikibase item has a value
end -- of test for sourced
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through values of property1
return assembleoutput(out, args, qid1, pid1)
end
-------------------------------------------------------------------------------
-- getIntersectCat takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-- It takes two properties, |prop1 and |prop2 (e.g. occupation and country of citizenship)
-- Each property's value is a wiki-base entity
-- For each value of the first parameter (ranks implemented) it fetches the value's main category
-- and then each value of the second parameter (possibly substituting a simpler description)
-- then it returns all of the categories representing the intersection of those properties,
-- (e.g. Category:Actors from Canada). A joining term may be supplied (e.g. |join=from).
-- The item's P734 (family name) is the sort key, or no sort key if there is no family name.
-- The sort key may be overridden by the parameter |sortkey (alias |sk).
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getIntersectCat = function(frame)
frame.args.reqranks = setRanks(frame.args.rank)
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local args = frame.args
args.sep = " "
args.linked = "no"
local pid1 = args.prop1 or "P106"
local pid2 = args.prop2 or "P27"
if pid1 == "" or pid2 == "" then return nil end
local qid, statements1 = parseInput(frame, "", pid1)
if not qid then return nil end
local qid, statements2 = parseInput(frame, "", pid2)
if not qid then return nil end
-- topics like countries may have different names in categories from their label in Wikidata
local subs_exists, subs = pcall(mw.loadData, "Module:WikidataIB/subs")
local join = args.join or ""
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
-- linkprefix (strip quotes)
local lp = (args.linkprefix or args.lp or ""):gsub('"', '')
-- sort key (strip quotes, hyphens and periods):
local sk = (args.sortkey or args.sk or ""):gsub('["-.]', '')
-- family name:
local famname = ""
if sk == "" then
local p734 = mw.wikibase.getBestStatements(qid, "P734")[1]
local p734id = p734 and p734.mainsnak.snaktype == "value" and p734.mainsnak.datavalue.value.id or ""
famname = mw.wikibase.getSitelink(p734id) or ""
-- strip namespace and disambigation
local pos = famname:find(":") or 0
famname = famname:sub(pos+1):gsub("%s%(.+%)$", "")
if famname == "" then
local lbl = mw.wikibase.getLabel(p734id)
famname = lbl and mw.text.nowiki(lbl) or ""
end
end
local cat1 = {}
for k, v in ipairs(statements1) do
if not onlysrc or sourced(v) then
-- get the ID representing the value of the property
local pvalID = (v.mainsnak.snaktype == "value") and v.mainsnak.datavalue.value.id
if pvalID then
-- get the topic's main category (P910) for that entity
local p910 = mw.wikibase.getBestStatements(pvalID, "P910")[1]
if p910 and p910.mainsnak.snaktype == "value" then
local tmcID = p910.mainsnak.datavalue.value.id
-- use sitelink or the English label for the cat
local cat = mw.wikibase.getSitelink(tmcID)
if not cat then
local lbl = mw.wikibase.getLabelByLang(tmcID, "en")
if lbl then
if lbl:sub(1,9) == "Category:" then
cat = mw.text.nowiki(lbl)
else
cat = "Category:" .. mw.text.nowiki(lbl)
end
end
end
cat1[#cat1+1] = cat
end -- of test for topic's main category exists
end -- of test for property has vaild value
end -- of test for sourced
if maxvals > 0 and #cat1 >= maxvals then break end
end
local cat2 = {}
for k, v in ipairs(statements2) do
if not onlysrc or sourced(v) then
local cat = rendersnak(v, args)
if subs[cat] then cat = subs[cat] end
cat2[#cat2+1] = cat
end
if maxvals > 0 and #cat2 >= maxvals then break end
end
local out = {}
for k1, v1 in ipairs(cat1) do
for k2, v2 in ipairs(cat2) do
if sk ~= "" then
out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "|" .. sk .. "]]"
elseif famname ~= "" then
out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "|" .. famname .. "]]"
else
out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "]]"
end -- of check for sort keys
end
end
args.noicon = "true"
return assembleoutput(out, args, qid, pid1)
end
-------------------------------------------------------------------------------
-- qualsToTable takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented.
-- A qid may be given, and the first unnamed parameter is the property ID, which is of type wikibase item.
-- It takes a list of qualifier property IDs as |quals=
-- For a given qid and property, it creates the rows of an html table,
-- each row being a value of the property (optionally only if the property matches the value in |pval= )
-- each cell being the first value of the qualifier corresponding to the list in |quals
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced;
-------------------------------------------------------------------------------
p.qualsToTable = function(frame)
local args = frame.args
local quals = args.quals or ""
if quals == "" then return "" end
args.reqranks = setRanks(args.rank)
local propertyID = mw.text.trim(args[1] or "")
local f = {}
f.args = args
local entityid, props = parseInput(f, "", propertyID)
if not entityid then return "" end
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
local pval = args.pval or ""
local qplist = mw.text.split(quals, "%p") -- split at punctuation and make a sequential table
for i, v in ipairs(qplist) do
qplist[i] = mw.text.trim(v):upper() -- remove whitespace and capitalise
end
local col1 = args.firstcol or ""
if col1 ~= "" then
col1 = col1 .. "</td><td>"
end
local emptycell = args.emptycell or " "
-- construct a 2-D array of qualifier values in qvals
local qvals = {}
for i, v in ipairs(props) do
local skip = false
if pval ~= "" then
local pid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id
if pid ~= pval then skip = true end
end
if not skip then
local qval = {}
local vqualifiers = v.qualifiers or {}
-- go through list of wanted qualifier properties
for i1, v1 in ipairs(qplist) do
-- check for that property ID in the statement's qualifiers
local qv, qtype
if vqualifiers[v1] then
qtype = vqualifiers[v1][1].datatype
if qtype == "time" then
if vqualifiers[v1][1].snaktype == "value" then
qv = mw.wikibase.renderSnak(vqualifiers[v1][1])
qv = frame:expandTemplate{title="dts", args={qv}}
else
qv = "?"
end
elseif qtype == "url" then
if vqualifiers[v1][1].snaktype == "value" then
qv = mw.wikibase.renderSnak(vqualifiers[v1][1])
local display = mw.ustring.match( mw.uri.decode(qv, "WIKI"), "([%w ]+)$" )
if display then
qv = "[" .. qv .. " " .. display .. "]"
end
end
else
qv = mw.wikibase.formatValue(vqualifiers[v1][1])
end
end
-- record either the value or a placeholder
qval[i1] = qv or emptycell
end -- of loop through list of qualifiers
-- add the list of qualifier values as a "row" in the main list
qvals[#qvals+1] = qval
end
end -- of for each value loop
local out = {}
for i, v in ipairs(qvals) do
out[i] = "<tr><td>" .. col1 .. table.concat(qvals[i], "</td><td>") .. "</td></tr>"
end
return table.concat(out, "\n")
end
-------------------------------------------------------------------------------
-- getGlobe takes an optional qid of a Wikidata entity passed as |qid=
-- otherwise it uses the linked item for the current page.
-- If returns the Qid of the globe used in P625 (coordinate location),
-- or nil if there isn't one.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getGlobe = function(frame)
local qid = frame.args.qid or frame.args[1] or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
local coords = mw.wikibase.getBestStatements(qid, "P625")[1]
local globeid
if coords and coords.mainsnak.snaktype == "value" then
globeid = coords.mainsnak.datavalue.value.globe:match("(Q%d+)")
end
return globeid
end
-------------------------------------------------------------------------------
-- getCommonsLink takes an optional qid of a Wikidata entity passed as |qid=
-- It returns one of the following in order of preference:
-- the Commons sitelink of the linked Wikidata item;
-- the Commons sitelink of the topic's main category of the linked Wikidata item;
-------------------------------------------------------------------------------
-- Dependencies: _getCommonslink(); _getSitelink(); parseParam()
-------------------------------------------------------------------------------
p.getCommonsLink = function(frame)
local oc = frame.args.onlycat or frame.args.onlycategories
local fb = parseParam(frame.args.fallback or frame.args.fb, true)
return _getCommonslink(frame.args.qid, oc, fb)
end
-------------------------------------------------------------------------------
-- getSitelink takes the qid of a Wikidata entity passed as |qid=
-- It takes an optional parameter |wiki= to determine which wiki is to be checked for a sitelink
-- If the parameter is blank, then it uses the local wiki.
-- If there is a sitelink to an article available, it returns the plain text link to the article
-- If there is no sitelink, it returns nil.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getSiteLink = function(frame)
return _getSitelink(frame.args.qid, frame.args.wiki or mw.text.trim(frame.args[1] or ""))
end
-------------------------------------------------------------------------------
-- getLink has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- If there is a sitelink to an article on the local Wiki, it returns a link to the article
-- with the Wikidata label as the displayed text.
-- If there is no sitelink, it returns the label as plain text.
-- If there is no label in the local language, it displays the qid instead.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getLink = function(frame)
local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "")
if itemID == "" then return end
local sitelink = mw.wikibase.getSitelink(itemID)
local label = labelOrId(itemID)
if sitelink then
return "[[:" .. sitelink .. "|" .. label .. "]]"
else
return label
end
end
-------------------------------------------------------------------------------
-- getLabel has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- It returns the Wikidata label for the local language as plain text.
-- If there is no label in the local language, it displays the qid instead.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getLabel = function(frame)
local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "")
if itemID == "" then return end
local lang = frame.args.lang or ""
if lang == "" then lang = nil end
local label = labelOrId(itemID, lang)
return label
end
-------------------------------------------------------------------------------
-- label has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- if no qid is supplied, it uses the qid associated with the current page.
-- It returns the Wikidata label for the local language as plain text.
-- If there is no label in the local language, it returns nil.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.label = function(frame)
local qid = mw.text.trim(frame.args[1] or frame.args.qid or "")
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return end
local lang = frame.args.lang or ""
if lang == "" then lang = nil end
local label, success = labelOrId(qid, lang)
if success then return label end
end
-------------------------------------------------------------------------------
-- getAT (Article Title)
-- has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- If there is a sitelink to an article on the local Wiki, it returns the sitelink as plain text.
-- If there is no sitelink or qid supplied, it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAT = function(frame)
local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "")
if itemID == "" then return end
return mw.wikibase.getSitelink(itemID)
end
-------------------------------------------------------------------------------
-- getDescription has the qid of a Wikidata entity passed as |qid=
-- (it defaults to the associated qid of the current article if omitted)
-- and a local parameter passed as the first unnamed parameter.
-- Any local parameter passed (other than "Wikidata" or "none") becomes the return value.
-- It returns the article description for the Wikidata entity if the local parameter is "Wikidata".
-- Nothing is returned if the description doesn't exist or "none" is passed as the local parameter.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getDescription = function(frame)
local desc = mw.text.trim(frame.args[1] or "")
local itemID = mw.text.trim(frame.args.qid or "")
if itemID == "" then itemID = nil end
if desc:lower() == 'wikidata' then
return mw.wikibase.getDescription(itemID)
elseif desc:lower() == 'none' then
return nil
else
return desc
end
end
-------------------------------------------------------------------------------
-- getAliases has the qid of a Wikidata entity passed as |qid=
-- (it defaults to the associated qid of the current article if omitted)
-- and a local parameter passed as the first unnamed parameter.
-- It implements blacklisting and whitelisting with a field name of "alias" by default.
-- Any local parameter passed becomes the return value.
-- Otherwise it returns the aliases for the Wikidata entity with the usual list options.
-- Nothing is returned if the aliases do not exist.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); assembleoutput()
-------------------------------------------------------------------------------
p.getAliases = function(frame)
local args = frame.args
local fieldname = args.name or ""
if fieldname == "" then fieldname = "alias" end
local blacklist = args.suppressfields or args.spf or ""
if blacklist:find(fieldname) then return nil end
local localval = mw.text.trim(args[1] or "")
if localval ~= "" then return localval end
local whitelist = args.fetchwikidata or args.fwd or ""
if whitelist == "" then whitelist = "NONE" end
if not (whitelist == 'ALL' or whitelist:find(fieldname)) then return nil end
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return nil end
local aliases = mw.wikibase.getEntity(qid).aliases
if not aliases then return nil end
args.langobj = findLang(args.lang)
local langcode = args.langobj.code
args.lang = langcode
local out = {}
for k1, v1 in pairs(aliases) do
if v1[1].language == langcode then
for k1, v2 in ipairs(v1) do
out[#out+1] = v2.value
end
break
end
end
return assembleoutput(out, args, qid)
end
-------------------------------------------------------------------------------
-- pageId returns the page id (entity ID, Qnnn) of the current page
-- returns nothing if the page is not connected to Wikidata
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.pageId = function(frame)
return mw.wikibase.getEntityIdForCurrentPage()
end
-------------------------------------------------------------------------------
-- formatDate is a wrapper to export the private function format_Date
-------------------------------------------------------------------------------
-- Dependencies: format_Date();
-------------------------------------------------------------------------------
p.formatDate = function(frame)
return format_Date(frame.args[1], frame.args.df, frame.args.bc)
end
-------------------------------------------------------------------------------
-- location is a wrapper to export the private function _location
-- it takes the entity-id as qid or the first unnamed parameter
-- optional boolean parameter first toggles the display of the first item
-- optional boolean parameter skip toggles the display to skip to the last item
-- parameter debug=<y/n> (default 'n') adds error msg if not a location
-------------------------------------------------------------------------------
-- Dependencies: _location();
-------------------------------------------------------------------------------
p.location = function(frame)
local debug = (frame.args.debug or ""):sub(1, 1):lower()
if debug == "" then debug = "n" end
local qid = mw.text.trim(frame.args.qid or frame.args[1] or ""):upper()
if qid == "" then qid=mw.wikibase.getEntityIdForCurrentPage() end
if not qid then
if debug ~= "n" then
return i18n.errors["entity-not-found"]
else
return nil
end
end
local first = mw.text.trim(frame.args.first or "")
local skip = mw.text.trim(frame.args.skip or "")
return table.concat( _location(qid, first, skip), ", " )
end
-------------------------------------------------------------------------------
-- checkBlacklist implements a test to check whether a named field is allowed
-- returns true if the field is not blacklisted (i.e. allowed)
-- returns false if the field is blacklisted (i.e. disallowed)
-- {{#if:{{#invoke:WikidataIB |checkBlacklist |name=Joe |suppressfields=Dave; Joe; Fred}} | not blacklisted | blacklisted}}
-- displays "blacklisted"
-- {{#if:{{#invoke:WikidataIB |checkBlacklist |name=Jim |suppressfields=Dave; Joe; Fred}} | not blacklisted | blacklisted}}
-- displays "not blacklisted"
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.checkBlacklist = function(frame)
local blacklist = frame.args.suppressfields or frame.args.spf or ""
local fieldname = frame.args.name or ""
if blacklist ~= "" and fieldname ~= "" then
if blacklist:find(fieldname) then
return false
else
return true
end
else
-- one of the fields is missing: let's call that "not on the list"
return true
end
end
-------------------------------------------------------------------------------
-- emptyor returns nil if its first unnamed argument is just punctuation, whitespace or html tags
-- otherwise it returns the argument unchanged (including leading/trailing space).
-- If the argument may contain "=", then it must be called explicitly:
-- |1=arg
-- (In that case, leading and trailing spaces are trimmed)
-- It finds use in infoboxes where it can replace tests like:
-- {{#if: {{#invoke:WikidatIB |getvalue |P99 |fwd=ALL}} | <span class="xxx">{{#invoke:WikidatIB |getvalue |P99 |fwd=ALL}}</span> | }}
-- with a form that uses just a single call to Wikidata:
-- {{#invoke |WikidataIB |emptyor |1= <span class="xxx">{{#invoke:WikidataIB |getvalue |P99 |fwd=ALL}}</span> }}
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.emptyor = function(frame)
local s = frame.args[1] or ""
if s == "" then return nil end
local sx = s:gsub("%s", ""):gsub("<[^>]*>", ""):gsub("%p", "")
if sx == "" then
return nil
else
return s
end
end
-------------------------------------------------------------------------------
-- labelorid is a public function to expose the output of labelOrId()
-- Pass the Q-number as |qid= or as an unnamed parameter.
-- It returns the Wikidata label for that entity or the qid if no label exists.
-------------------------------------------------------------------------------
-- Dependencies: labelOrId
-------------------------------------------------------------------------------
p.labelorid = function(frame)
return (labelOrId(frame.args.qid or frame.args[1]))
end
-------------------------------------------------------------------------------
-- getLang returns the MediaWiki language code of the current content.
-- If optional parameter |style=full, it returns the language name.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getLang = function(frame)
local style = (frame.args.style or ""):lower()
local langcode = mw.language.getContentLanguage().code
if style == "full" then
return mw.language.fetchLanguageName( langcode )
end
return langcode
end
-------------------------------------------------------------------------------
-- getItemLangCode takes a qid parameter (using the current page's qid if blank)
-- If the item for that qid has property country (P17) it looks at the first preferred value
-- If the country has an official language (P37), it looks at the first preferred value
-- If that official language has a language code (P424), it returns the first preferred value
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: _getItemLangCode()
-------------------------------------------------------------------------------
p.getItemLangCode = function(frame)
return _getItemLangCode(frame.args.qid or frame.args[1])
end
-------------------------------------------------------------------------------
-- findLanguage exports the local findLang() function
-- It takes an optional language code and returns, in order of preference:
-- the code if a known language;
-- the user's language, if set;
-- the server's content language.
-------------------------------------------------------------------------------
-- Dependencies: findLang
-------------------------------------------------------------------------------
p.findLanguage = function(frame)
return findLang(frame.args.lang or frame.args[1]).code
end
-------------------------------------------------------------------------------
-- getQid returns the qid, if supplied
-- failing that, the Wikidata entity ID of the "category's main topic (P301)", if it exists
-- failing that, the Wikidata entity ID associated with the current page, if it exists
-- otherwise, nothing
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getQid = function(frame)
local qid = (frame.args.qid or ""):upper()
-- check if a qid was passed; if so, return it:
if qid ~= "" then return qid end
-- check if there's a "category's main topic (P301)":
qid = mw.wikibase.getEntityIdForCurrentPage()
if qid then
local prop301 = mw.wikibase.getBestStatements(qid, "P301")
if prop301[1] then
local mctid = prop301[1].mainsnak.datavalue.value.id
if mctid then return mctid end
end
end
-- otherwise return the page qid (if any)
return qid
end
-------------------------------------------------------------------------------
-- followQid takes four optional parameters: qid, props, list and all.
-- If qid is not given, it uses the qid for the connected page
-- or returns nil if there isn't one.
-- props is a list of properties, separated by punctuation.
-- If props is given, the Wikidata item for the qid is examined for each property in turn.
-- If that property contains a value that is another Wikibase-item, that item's qid is returned,
-- and the search terminates, unless |all=y when all of the qids are returned, separated by spaces.
-- If |list= is set to a template, the qids are passed as arguments to the template.
-- If props is not given, the qid is returned.
-------------------------------------------------------------------------------
-- Dependencies: parseParam()
-------------------------------------------------------------------------------
p._followQid = function(args)
local qid = (args.qid or ""):upper()
local all = parseParam(args.all, false)
local list = args.list or ""
if list == "" then list = nil end
if qid == "" then
qid = mw.wikibase.getEntityIdForCurrentPage()
end
if not qid then return nil end
local out = {}
local props = (args.props or ""):upper()
if props ~= "" then
for p in mw.text.gsplit(props, "%p") do -- split at punctuation and iterate
p = mw.text.trim(p)
for i, v in ipairs( mw.wikibase.getBestStatements(qid, p) ) do
local linkedid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id
if linkedid then
if all then
out[#out+1] = linkedid
else
return linkedid
end -- test for all or just the first one found
end -- test for value exists for that property
end -- loop through values of property to follow
end -- loop through list of properties to follow
end
if #out > 0 then
local ret = ""
if list then
ret = mw.getCurrentFrame():expandTemplate{title = list, args = out}
else
ret = table.concat(out, " ")
end
return ret
else
return qid
end
end
p.followQid = function(frame)
return p._followQid(frame.args)
end
-------------------------------------------------------------------------------
-- globalSiteID returns the globalSiteID for the current wiki
-- e.g. returns "enwiki" for the English Wikipedia, "enwikisource" for English Wikisource, etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.globalSiteID = function(frame)
return mw.wikibase.getGlobalSiteId()
end
-------------------------------------------------------------------------------
-- siteID returns the root of the globalSiteID
-- e.g. "en" for "enwiki", "enwikisource", etc.
-- treats "en-gb" as "en", etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.siteID = function(frame)
local txtlang = frame:callParserFunction('int', {'lang'}) or ""
-- This deals with specific exceptions: be-tarask -> be-x-old
if txtlang == "be-tarask" then
return "be_x_old"
end
local pos = txtlang:find("-")
local ret = ""
if pos then
ret = txtlang:sub(1, pos-1)
else
ret = txtlang
end
return ret
end
-------------------------------------------------------------------------------
-- projID returns the code used to link to the reader's language's project
-- e.g "en" for [[:en:WikidataIB]]
-- treats "en-gb" as "en", etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.projID = function(frame)
local txtlang = frame:callParserFunction('int', {'lang'}) or ""
-- This deals with specific exceptions: be-tarask -> be-x-old
if txtlang == "be-tarask" then
return "be-x-old"
end
local pos = txtlang:find("-")
local ret = ""
if pos then
ret = txtlang:sub(1, pos-1)
else
ret = txtlang
end
return ret
end
-------------------------------------------------------------------------------
-- formatNumber formats a number according to the the supplied language code ("|lang=")
-- or the default language if not supplied.
-- The number is the first unnamed parameter or "|num="
-------------------------------------------------------------------------------
-- Dependencies: findLang()
-------------------------------------------------------------------------------
p.formatNumber = function(frame)
local lang
local num = tonumber(frame.args[1] or frame.args.num) or 0
lang = findLang(frame.args.lang)
return lang:formatNum( num )
end
-------------------------------------------------------------------------------
-- examine dumps the property (the unnamed parameter or pid)
-- from the item given by the parameter 'qid' (or the other unnamed parameter)
-- or from the item corresponding to the current page if qid is not supplied.
-- e.g. {{#invoke:WikidataIB |examine |pid=P26 |qid=Q42}}
-- or {{#invoke:WikidataIB |examine |P26 |Q42}} or any combination of these
-- or {{#invoke:WikidataIB |examine |P26}} for the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.examine = function( frame )
local args
if frame.args[1] or frame.args.pid or frame.args.qid then
args = frame.args
else
args = frame:getParent().args
end
local par = {}
local pid = (args.pid or ""):upper()
local qid = (args.qid or ""):upper()
par[1] = mw.text.trim( args[1] or "" ):upper()
par[2] = mw.text.trim( args[2] or "" ):upper()
table.sort(par)
if par[2]:sub(1,1) == "P" then par[1], par[2] = par[2], par[1] end
if pid == "" then pid = par[1] end
if qid == "" then qid = par[2] end
local q1 = qid:sub(1,1)
if pid:sub(1,1) ~= "P" then return "No property supplied" end
if q1 ~= "Q" and q1 ~= "M" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return "No item for this page" end
return "<pre>" .. mw.dumpObject( mw.wikibase.getAllStatements( qid, pid ) ) .. "</pre>"
end
-------------------------------------------------------------------------------
-- checkvalue looks for 'val' as a wikibase-item value of a property (the unnamed parameter or pid)
-- from the item given by the parameter 'qid'
-- or from the Wikidata item associated with the current page if qid is not supplied.
-- It only checks ranks that are requested (preferred and normal by default)
-- If property is not supplied, then P31 (instance of) is assumed.
-- It returns val if found or nothing if not found.
-- e.g. {{#invoke:WikidataIB |checkvalue |val=Q5 |pid=P31 |qid=Q42}}
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |P31 |qid=Q42}}
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |qid=Q42}}
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |P31}} for the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.checkvalue = function( frame )
local args
if frame.args.val then
args = frame.args
else
args = frame:getParent().args
end
local val = args.val
if not val then return nil end
local pid = mw.text.trim(args.pid or args[1] or "P31"):upper()
local qid = (args.qid or ""):upper()
if pid:sub(1,1) ~= "P" then return nil end
if qid:sub(1,1) ~= "Q" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
local ranks = setRanks(args.rank)
local stats = {}
if ranks.b then
stats = mw.wikibase.getBestStatements(qid, pid)
else
stats = mw.wikibase.getAllStatements( qid, pid )
end
if not stats[1] then return nil end
if stats[1].mainsnak.datatype == "wikibase-item" then
for k, v in pairs( stats ) do
local ms = v.mainsnak
if ranks[v.rank:sub(1,1)] and ms.snaktype == "value" and ms.datavalue.value.id == val then
return val
end
end
end
return nil
end
-------------------------------------------------------------------------------
-- url2 takes a parameter url= that is a proper url and formats it for use in an infobox.
-- If no parameter is supplied, it returns nothing.
-- This is the equivalent of Template:URL
-- but it keeps the "edit at Wikidata" pen icon out of the microformat.
-- Usually it will take its url parameter directly from a Wikidata call:
-- e.g. {{#invoke:WikidataIB |url2 |url={{wdib |P856 |qid=Q23317 |fwd=ALL |osd=no}} }}
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.url2 = function(frame)
local txt = frame.args.url or ""
if txt == "" then return nil end
-- extract any icon
local url, icon = txt:match("(.+) (.+)")
-- make sure there's at least a space at the end
url = (url or txt) .. " "
icon = icon or ""
-- extract any protocol like https://
local prot = url:match("(https*://).+[ \"\']")
-- extract address
local addr = ""
if prot then
addr = url:match("https*://(.+)[ \"\']") or " "
else
prot = "//"
addr = url:match("[^%p%s]+%.(.+)[ \"\']") or " "
end
-- strip trailing / from end of domain-only url and add <wbr/> before . and /
local disp, n = addr:gsub( "^([^/]+)/$", "%1" ):gsub("%/", "<wbr/>/"):gsub("%.", "<wbr/>.")
return '<span class="url">[' .. prot .. addr .. " " .. disp .. "]</span> " .. icon
end
-------------------------------------------------------------------------------
-- getWebsite fetches the Official website (P856) and formats it for use in an infobox.
-- This is similar to Template:Official website but with a url displayed,
-- and it adds the "edit at Wikidata" pen icon beyond the microformat if enabled.
-- A local value will override the Wikidata value. "NONE" returns nothing.
-- e.g. {{#invoke:WikidataIB |getWebsite |qid= |noicon= |lang= |url= }}
-------------------------------------------------------------------------------
-- Dependencies: findLang(); parseParam();
-------------------------------------------------------------------------------
p.getWebsite = function(frame)
local url = frame.args.url or ""
if url:upper() == "NONE" then return nil end
local urls = {}
local quals = {}
local qid = frame.args.qid or ""
if url and url ~= "" then
urls[1] = url
else
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
local prop856 = mw.wikibase.getBestStatements(qid, "P856")
for k, v in pairs(prop856) do
if v.mainsnak.snaktype == "value" then
urls[#urls+1] = v.mainsnak.datavalue.value
if v.qualifiers and v.qualifiers["P1065"] then
-- just take the first archive url (P1065)
local au = v.qualifiers["P1065"][1]
if au.snaktype == "value" then
quals[#urls] = au.datavalue.value
end -- test for archive url having a value
end -- test for qualifers
end -- test for website having a value
end -- loop through website(s)
end
if #urls == 0 then return nil end
local out = {}
for i, u in ipairs(urls) do
local link = quals[i] or u
local prot, addr = u:match("(http[s]*://)(.+)")
addr = addr or u
local disp, n = addr:gsub("%.", "<wbr/>%.")
out[#out+1] = '<span class="url">[' .. link .. " " .. disp .. "]</span>"
end
local langcode = findLang(frame.args.lang).code
local noicon = parseParam(frame.args.noicon, false)
if url == "" and not noicon then
out[#out] = out[#out] .. createicon(langcode, qid, "P856")
end
local ret = ""
if #out > 1 then
ret = mw.getCurrentFrame():expandTemplate{title = "ubl", args = out}
else
ret = out[1]
end
return ret
end
-------------------------------------------------------------------------------
-- getAllLabels fetches the set of labels and formats it for display as wikitext.
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAllLabels = function(frame)
local args = frame.args or frame:getParent().args or {}
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end
local labels = mw.wikibase.getEntity(qid).labels
if not labels then return i18n["labels-not-found"] end
local out = {}
for k, v in pairs(labels) do
out[#out+1] = v.value .. " (" .. v.language .. ")"
end
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- getAllDescriptions fetches the set of descriptions and formats it for display as wikitext.
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAllDescriptions = function(frame)
local args = frame.args or frame:getParent().args or {}
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end
local descriptions = mw.wikibase.getEntity(qid).descriptions
if not descriptions then return i18n["descriptions-not-found"] end
local out = {}
for k, v in pairs(descriptions) do
out[#out+1] = v.value .. " (" .. v.language .. ")"
end
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- getAllAliases fetches the set of aliases and formats it for display as wikitext.
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAllAliases = function(frame)
local args = frame.args or frame:getParent().args or {}
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end
local aliases = mw.wikibase.getEntity(qid).aliases
if not aliases then return i18n["aliases-not-found"] end
local out = {}
for k1, v1 in pairs(aliases) do
local lang = v1[1].language
local val = {}
for k1, v2 in ipairs(v1) do
val[#val+1] = v2.value
end
out[#out+1] = table.concat(val, ", ") .. " (" .. lang .. ")"
end
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- showNoLinks displays the article titles that should not be linked.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.showNoLinks = function(frame)
local out = {}
for k, v in pairs(donotlink) do
out[#out+1] = k
end
table.sort( out )
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- checkValidity checks whether the first unnamed parameter represents a valid entity-id,
-- that is, something like Q1235 or P123.
-- It returns the strings "true" or "false".
-- Change false to nil to return "true" or "" (easier to test with #if:).
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
function p.checkValidity(frame)
local id = mw.text.trim(frame.args[1] or "")
if mw.wikibase.isValidEntityId(id) then
return true
else
return false
end
end
-------------------------------------------------------------------------------
-- getEntityFromTitle returns the Entity-ID (Q-number) for a given title.
-- Modification of Module:ResolveEntityId
-- The title is the first unnamed parameter.
-- The site parameter determines the site/language for the title. Defaults to current wiki.
-- The showdab parameter determines whether dab pages should return the Q-number or nil. Defaults to true.
-- Returns the Q-number or nil if it does not exist.
-------------------------------------------------------------------------------
-- Dependencies: parseParam
-------------------------------------------------------------------------------
function p.getEntityFromTitle(frame)
local args=frame.args
if not args[1] then args=frame:getParent().args end
if not args[1] then return nil end
local title = mw.text.trim(args[1])
local site = args.site or ""
local showdab = parseParam(args.showdab, true)
local qid = mw.wikibase.getEntityIdForTitle(title, site)
if qid then
local prop31 = mw.wikibase.getBestStatements(qid, "P31")[1]
if not showdab and prop31 and prop31.mainsnak.datavalue.value.id == "Q4167410" then
return nil
else
return qid
end
end
end
-------------------------------------------------------------------------------
-- getDatePrecision returns the number representing the precision of the first best date value
-- for the given property.
-- It takes the qid and property ID
-- The meanings are given at https://www.mediawiki.org/wiki/Wikibase/DataModel#Dates_and_times
-- 0 = 1 billion years .. 6 = millennium, 7 = century, 8 = decade, 9 = year, 10 = month, 11 = day
-- Returns 0 (or the second unnamed parameter) if the Wikidata does not exist.
-------------------------------------------------------------------------------
-- Dependencies: parseParam; sourced;
-------------------------------------------------------------------------------
function p.getDatePrecision(frame)
local args=frame.args
if not args[1] then args=frame:getParent().args end
local default = tonumber(args[2] or args.default) or 0
local prop = mw.text.trim(args[1] or "")
if prop == "" then return default end
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return default end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local stat = mw.wikibase.getBestStatements(qid, prop)
for i, v in ipairs(stat) do
local prec = (onlysrc == false or sourced(v))
and v.mainsnak.datavalue
and v.mainsnak.datavalue.value
and v.mainsnak.datavalue.value.precision
if prec then return prec end
end
return default
end
return p
-------------------------------------------------------------------------------
-- List of exported functions
-------------------------------------------------------------------------------
--[[
_getValue
getValue
getPreferredValue
getCoords
getQualifierValue
getSumOfParts
getValueByQual
getValueByLang
getValueByRefSource
getPropertyIDs
getQualifierIDs
getPropOfProp
getAwardCat
getIntersectCat
getGlobe
getCommonsLink
getSiteLink
getLink
getLabel
label
getAT
getDescription
getAliases
pageId
formatDate
location
checkBlacklist
emptyor
labelorid
getLang
getItemLangCode
findLanguage
getQID
followQid
globalSiteID
siteID
projID
formatNumber
examine
checkvalue
url2
getWebsite
getAllLabels
getAllDescriptions
getAllAliases
showNoLinks
checkValidity
getEntityFromTitle
getDatePrecision
--]]
-------------------------------------------------------------------------------
cdfad4f2433151e512d5023478c35bceaf5c980a
Module:WikidataIB/nolinks
828
38
79
78
2023-08-10T14:07:27Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
local p ={}
--[[
The values here are the English sitelinks for items that should not be linked.
These 36 are not definitive and may be altered to suit.
--]]
p.items = {
"Australia",
"Austria",
"Belgium",
"Canada",
"China",
"Denmark",
"England",
"France",
"Germany",
"Greece",
"Hungary",
"Iceland",
"India",
"Republic of Ireland",
"Israel",
"Italy",
"Jamaica",
"Japan",
"Luxembourg",
"Mexico",
"Netherlands",
"New Zealand",
"Northern Ireland",
"Norway",
"Poland",
"Portugal",
"Russia",
"Scotland",
"South Africa",
"Spain",
"Sweden",
"Switzerland",
"Turkey",
"United Kingdom",
"UK",
"United States",
"USA",
"Wales",
}
--[[
This provides a convenient way to create a test whether an item is on the list.
--]]
p.itemsindex = {}
for i, v in ipairs(p.items) do
p.itemsindex[v] = true
end
return p
d42a1e1cb5d411ab1b578dc0d36aa0266f32b2d6
Module:WikidataIB/titleformats
828
39
81
80
2023-08-10T14:07:27Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
--[[
To satisfy Wikipedia:Manual of Style/Titles, certain types of items are italicised,
and others are quoted.
This submodule lists the entity-ids used in 'instance of' (P31),
which allows a module to identify the values that should be formatted.
The table p.formats is indexed by entity-id, and contains the value " or ''
--]]
local p = {}
p.italics = {
"Q571", -- book
"Q13593966", -- literary trilogy
"Q277759", -- book series
"Q2188189", -- musical work
"Q11424", -- film
"Q13593818", -- film trilogy
"Q24856", -- film series
"Q5398426", -- television series
"Q482994", -- album
"Q169930", -- extended play
"Q1760610", -- comic book
"Q7889", -- video game
"Q7058673", -- video game series
"Q25379", -- play
"Q2743", -- musical
"Q37484", -- epic poem
"Q41298", -- magazine
}
p.quotes = {
"Q207628", -- musical composition
}
p.size = 0
p.formats = {}
for i, v in ipairs(p.italics) do
p.formats[v] = "''"
p.size = p.size + 1
end
for i, v in ipairs(p.quotes) do
p.formats[v] = '"'
p.size = p.size + 1
end
return p
aecc52ff69e56d315f5b60dc21d02dd94a63dfea
Template:Code
10
40
83
82
2023-08-10T14:07:28Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{#tag:syntaxhighlight|{{{code|{{{1}}}}}}|lang={{{lang|{{{2|text}}}}}}|class={{{class|}}}|id={{{id|}}}|style={{{style|}}}|inline=1}}<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
5d9b1a0980efe1b02eb91bc717438a5ae4a5ee04
Template:Em
10
41
85
84
2023-08-10T14:07:28Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
<em {{#if:{{{role|}}}|role="{{{role}}}"}} {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} {{#if:{{{style|}}}|style="{{{style}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</em><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
e2fac6fb507a0dd72c4e79d02403049c7d857c8d
Template:Yesno-no
10
42
87
86
2023-08-10T14:07:28Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{safesubst:<noinclude />yesno|{{{1}}}|yes={{{yes|yes}}}|no={{{no|no}}}|blank={{{blank|no}}}|¬={{{¬|no}}}|def={{{def|no}}}}}<noinclude>
{{Documentation|Template:Yesno/doc}}
<!--Categories go in the doc page referenced above; interwikis go in Wikidata.-->
</noinclude>
1ad7b7800da1b867ead8f6ff8cef76e6201b3b56
Template:Crossref
10
43
89
88
2023-08-10T14:07:29Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
#REDIRECT [[Template:Crossreference]]
{{Rcat shell|
{{R from template shortcut}}
}}
dc4192593ccb8eaa34c0440c4aa712442a06c329
Template:Crossreference
10
44
91
90
2023-08-10T14:07:29Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
<templatestyles src="Crossreference/styles.css" />{{Hatnote inline
|1={{{1|{{{text|{{{content|<noinclude>sample content</noinclude>}}}}}}}}}
|extraclasses=crossreference {{{class|{{{extraclasses|}}}}}}
|selfref={{#if:{{{selfref|{{{printworthy|{{{unprintworthy|}}}}}}}}}||yes}}
|inline={{{inline|true}}}
}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
b8ac8a6a83bb08330ba0b9f31a7fcd8567217d0e
Template:Crossreference/styles.css
10
45
93
92
2023-08-10T14:07:29Z
InsaneX
2
1 revision imported: Importing Short description
text
text/plain
/* {{pp-template}} */
/* This snippet just undoes the default "padding-left: 1.6em;" imposed by
div.hatnote, when Template:Crossreference is used in block (div) mode.
Ignore the dumb CSS editor's "Element (div.crossreference) is overqualified"
warning. It is wrong. We do not want to apply any CSS intended for block
mode when it is not in block mode. While it's unlikely our "padding-left: 0;"
does anything wrong in inline (span) mode, we can't guarantee it forever. */
div.crossreference {
padding-left: 0;
}
ae665603577c5dbafbdf190ec9e29f2ed1f7cd77
Template:Hatnote inline
10
46
95
94
2023-08-10T14:07:30Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{Hatnote inline/invoke
|1={{{1|{{{text|{{{content}}}}}}}}}
|extraclasses={{{class|{{{extraclasses|}}}}}}
|selfref={{#if:{{{printworthy|{{{selfref|}}}}}}||yes}}
|category={{{category|}}}
|inline={{{inline|true}}}
}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
257f3004ea74817011cab7b3bdfd0c87531d7e35
Template:Hatnote inline/invoke
10
47
97
96
2023-08-10T14:07:30Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
<includeonly>{{#invoke:Hatnote inline|hatnote}}</includeonly><noinclude>
{{Documentation|content=This is an includeonly part of [[Template:Hatnote inline]].}}</noinclude>
bcceba0d964fb499427b81aef69b70f463221df3
Module:Hatnote inline
828
48
99
98
2023-08-10T14:07:30Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote-inline --
-- --
-- This module produces hatnote-style links, and links to related articles, --
-- but inside a <span>, instead of the <div> used by Module:Hatnote. It --
-- implements the {{hatnote-inline}} meta-template. --
--------------------------------------------------------------------------------
local mHatnote = require('Module:Hatnote')
local mArguments = require('Module:Arguments')
local yesno = require('Module:Yesno')
local p = {}
function p.hatnoteInline (frame)
local args = mArguments.getArgs(frame)
local hatnote = mHatnote.hatnote(frame)
if args.inline == nil or yesno(args.inline, true) then
local subs = {
['<div'] = '<span',
['</div>$'] = '</span>'
}
for k, v in pairs(subs) do hatnote = string.gsub(hatnote, k, v, 1) end
end
return hatnote
end
p.hatnote = p.hatnoteInline --alias
return p
b5000cd7910b7eae23206235b64880a775e4209b
Template:Q
10
49
101
100
2023-08-10T14:07:31Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
#REDIRECT [[Template:Wikidata entity link]]
[[Category:Wikidata templates]]
{{Redirect category shell|
{{R from template shortcut}}
{{R from move}}
}}
7f19fdcb2b05d966cd3f0f5f540cf8fa37935869
Template:Wikidata entity link
10
50
103
102
2023-08-10T14:07:31Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
<includeonly>{{#if:{{{1|}}}
| {{#switch:{{padleft:|1|{{uc:{{{1}}}}}}}
| Q | P = [[d:Special:EntityPage/{{uc:{{{1}}}}}|{{#invoke:wd|label|{{uc:{{{1}}}}}}} <small>({{uc:{{{1}}}}})</small>]]
| #default = [[d:Special:EntityPage/Q{{uc:{{{1}}}}}|{{#invoke:wd|label|Q{{uc:{{{1}}}}}}} <small>(Q{{uc:{{{1|}}}}})</small>]]
}}
| {{#if:{{#invoke:wd|label|raw}}
| [[d:Special:EntityPage/{{#invoke:wd|label|raw}}|{{#invoke:wd|label}} <small>({{#invoke:wd|label|raw}})</small>]]
| <small>(no entity)</small>
}}
}}</includeonly><noinclude>{{Documentation}}</noinclude>
3eaf99f5fdf869bc08932bb8eda9eba23858c9c8
Template:Category link
10
51
105
104
2023-08-10T14:07:31Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{#ifeq:{{#titleparts:{{PAGENAME}}|1}}|Stub types for deletion |[[:Category:{{{1}}}|Cat:{{{1}}}]] | [[:Category:{{{1}}}|{{{2|Category:{{{1}}}}}}]]{{#ifeq:{{Yesno|{{{count|no}}}}}|yes|<small> {{#ifexpr:{{PAGESINCAT:{{{1}}}|{{UC:{{{count_type|ALL}}}}}|R}}>={{{backlog|{{#expr:{{PAGESINCAT:{{{1}}}|{{UC:{{{count_type|ALL}}}}}|R}}+1}}}}}|<span style="font-weight: bold; color: #DD0000;">}}( {{PAGESINCAT:{{{1}}}|{{UC:{{{count_type|ALL}}}}}}} ){{#ifexpr:{{PAGESINCAT:{{{1}}}|{{UC:{{{count_type|ALL}}}}}|R}}>={{{backlog|{{#expr:{{PAGESINCAT:{{{1}}}|{{UC:{{{count_type|ALL}}}}}|R}}+1}}}}}|</span>}}</small>}}}}<noinclude>
{{Documentation}}
</noinclude>
cb0fcaeb8242d1d37c27a8dcb57f76fe5b5faa36
Template:Cl
10
52
107
106
2023-08-10T14:07:32Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
#REDIRECT [[Template:Category link]]
{{R from move}}
f79fddc38797fc163b6e6ddeb4377afbea7d0cfc
Template:No redirect
10
54
111
110
2023-08-10T14:07:32Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{safesubst:<noinclude/>#if: {{safesubst:<noinclude/>#invoke:Redirect|isRedirect|{{{1}}}}}
| <span class="plainlinks">[{{safesubst:<noinclude/>fullurl:{{{1}}}|redirect=no}} {{{2|{{{1}}}}}}]</span>
| {{safesubst:<noinclude/>#if:{{{2|}}}|[[:{{safesubst:<noinclude/>FULLPAGENAME:{{{1}}}}}|{{{2}}}]]|[[:{{safesubst:<noinclude/>FULLPAGENAME:{{{1}}}}}]]}}
}}<noinclude>
{{documentation}}
</noinclude>
1760035b1bed54ee08b810208ed3551b812dfe13
Template:Documentation
10
55
113
112
2023-08-10T14:07:33Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<!-- Add categories to the /doc subpage -->
</noinclude>
9e62b964e96c4e3d478edecbfcb3c0338ae8a276
Module:Documentation
828
56
115
114
2023-08-10T14:07:33Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
local format = mw.ustring.format
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return format('[[%s|%s]]', page, display)
else
return format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return format(
'<span class="%s">(%s)</span>',
message('toolbar-class'),
table.concat(ret, ' | ')
)
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:attr('role', 'complementary')
:attr('aria-labelledby', args.heading ~= '' and 'documentation-heading' or nil)
:attr('aria-label', args.heading == '' and 'Documentation' or nil)
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.canonicalUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[File:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle
and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local pagetype
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
else
pagetype = message('sandbox-notice-pagetype-other')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if compareUrl then
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
else
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(message('sandbox-category'))
-- 'documentation-clear'
return '<div class="' .. message('clear') .. '"></div>'
.. require('Module:Message box').main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- The page is edit-protected.
return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
return require('Module:Protection banner')._main{
action = 'move', small = true
}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
return {
title = title,
docTitle = docTitle,
-- View, display, edit, and purge links if /doc exists.
viewLinkDisplay = message('view-link-display'),
editLinkDisplay = message('edit-link-display'),
historyLinkDisplay = message('history-link-display'),
purgeLinkDisplay = message('purge-link-display'),
preload = preload,
createLinkDisplay = message('create-link-display')
}
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create][purge] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local docTitle = data.docTitle
-- yes, we do intend to purge the template page on which the documentation appears
local purgeLink = makeWikilink("Special:Purge/" .. data.title.prefixedText, data.purgeLinkDisplay)
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeWikilink("Special:EditPage/" .. docTitle.prefixedText, data.editLinkDisplay)
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, data.historyLinkDisplay)
return "[" .. viewLink .. "] [" .. editLink .. "] [" .. historyLink .. "] [" .. purgeLink .. "]"
else
local createLink = makeUrlLink(docTitle:canonicalUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
return "[" .. createLink .. "] [" .. purgeLink .. "]"
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:attr('id', 'documentation-heading')
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:attr('role', 'note')
:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local ret
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editDisplay = message('edit-link-display')
local editLink = makeWikilink("Special:EditPage/" .. docTitle.prefixedText, editDisplay)
local historyDisplay = message('history-link-display')
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:canonicalUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
.. '<br />'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeWikilink("Special:EditPage/" .. sandboxPage, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:canonicalUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeWikilink("Special:EditPage/" .. testcasesPage, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:canonicalUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
end
return ret
end
return p
268dc89480af10873bfbca5439ae8e61b404f770
Module:Documentation/config
828
57
117
116
2023-08-10T14:07:34Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
cfg['sandbox-notice-compare-link-display'] = 'diff'
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
cfg['sandbox-notice-testcases-link-display'] = 'test cases'
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
cfg['sandbox-notice-testcases-run-link-display'] = 'run'
-- cfg['sandbox-category']
-- A category to add to all template sandboxes.
cfg['sandbox-category'] = 'Template sandboxes'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Help:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
71b68ed73088f1a59d61acf06bbee9fde6677f03
Module:Documentation/styles.css
828
58
119
118
2023-08-10T14:07:34Z
InsaneX
2
1 revision imported: Importing Short description
text
text/plain
/* {{pp|small=yes}} */
.documentation,
.documentation-metadata {
border: 1px solid #a2a9b1;
background-color: #ecfcf4;
clear: both;
}
.documentation {
margin: 1em 0 0 0;
padding: 1em;
}
.documentation-metadata {
margin: 0.2em 0; /* same margin left-right as .documentation */
font-style: italic;
padding: 0.4em 1em; /* same padding left-right as .documentation */
}
.documentation-startbox {
padding-bottom: 3px;
border-bottom: 1px solid #aaa;
margin-bottom: 1ex;
}
.documentation-heading {
font-weight: bold;
font-size: 125%;
}
.documentation-clear { /* Don't want things to stick out where they shouldn't. */
clear: both;
}
.documentation-toolbar {
font-style: normal;
font-size: 85%;
}
ce0e629c92e3d825ab9fd927fe6cc37d9117b6cb
Template:Sandbox other
10
59
121
120
2023-08-10T14:07:34Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{#if:{{#ifeq:{{#invoke:String|sublength|s={{SUBPAGENAME}}|i=0|len=7}}|sandbox|1}}{{#ifeq:{{SUBPAGENAME}}|doc|1}}{{#invoke:String|match|{{PAGENAME}}|/sandbox/styles.css$|plain=false|nomatch=}}|{{{1|}}}|{{{2|}}}}}<!--
--><noinclude>{{documentation}}</noinclude>
91e4ae891d6b791615152c1fbc971414961ba872
Template:Warning
10
60
123
122
2023-08-10T14:07:35Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{Mbox
| name = Warning
| demospace = {{{demospace|}}}
| style = {{#if:{{{style|}}} |{{{style}}} }}
| subst = <includeonly>{{subst:substcheck}}</includeonly>
| type = content
| image = {{#if:{{{image|}}}| [[File:{{{image}}}|{{{imagesize|40px}}}|Warning]] }}
| small = {{{small|}}}
| smallimage = {{#if:{{{image|}}}| [[File:{{{image}}}|30px|Warning]]}}
| imageright = {{#if:{{{imageright|}}} |{{{imageright}}} |{{#if:{{{shortcut|{{{shortcut1|}}}}}} |{{Ombox/shortcut|{{{shortcut|{{{shortcut1|}}}}}}|{{{shortcut2|}}}|{{{shortcut3|}}}|{{{shortcut4|}}}|{{{shortcut5|}}}}}}} }}
| textstyle = {{{textstyle|text-align: {{#if:{{{center|}}}|center|{{{align|left}}}}};}}}
| text = {{#if:{{{header|{{{heading|{{{title|}}}}}}}}} |<div style="{{{headstyle|text-align: {{#if:{{{center|}}}|center|left}};}}}">'''{{{header|{{{heading|{{{title|}}}}}}}}}'''</div>}}<!--
-->{{{text|{{{content|{{{reason|{{{1}}}}}}}}}}}}
}}<noinclude>
<!-- Add categories to the /doc subpage; interwikis go to Wikidata. -->
{{Documentation}}
</noinclude>
3af84e728da2ec54b8431a52af171256c929741e
Template:--
10
61
125
124
2023-08-10T14:07:35Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
#REDIRECT [[Template:Em dash]]
{{Redirect category shell|
{{R from move}}
{{R from template shortcut}}
}}
b6255351d93197d967d74365cfba31e395df0170
Template:Template link code
10
62
127
126
2023-08-10T14:07:36Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nolink=yes|code=yes|nowrap=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlc}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
044f00ca1bfc10cb967c32e893043ccc6f739764
Template:Documentation subpage
10
63
129
128
2023-08-10T14:07:36Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
<includeonly><!--
-->{{#ifeq:{{lc:{{SUBPAGENAME}}}} |{{{override|doc}}}
| <!--(this template has been transcluded on a /doc or /{{{override}}} page)-->
</includeonly><!--
-->{{#ifeq:{{{doc-notice|show}}} |show
| {{Mbox
| type = notice
| style = margin-bottom:1.0em;
| image = [[File:Edit-copy green.svg|40px|alt=|link=]]
| text =
{{strong|This is a [[Wikipedia:Template documentation|documentation]] [[Wikipedia:Subpages|subpage]]}} for {{terminate sentence|{{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}}}<br />It may contain usage information, [[Wikipedia:Categorization|categories]] and other content that is not part of the original {{#if:{{{text2|}}} |{{{text2}}} |{{#if:{{{text1|}}} |{{{text1}}} |{{#ifeq:{{SUBJECTSPACE}} |{{ns:User}} |{{lc:{{SUBJECTSPACE}}}} template page |{{#if:{{SUBJECTSPACE}} |{{lc:{{SUBJECTSPACE}}}} page|article}}}}}}}}.
}}
}}<!--
-->{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}<!--
-->{{#if:{{{inhibit|}}} |<!--(don't categorize)-->
| <includeonly><!--
-->{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}
| [[Category:{{#switch:{{SUBJECTSPACE}} |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
| [[Category:Documentation subpages without corresponding pages]]
}}<!--
--></includeonly>
}}<!--
(completing initial #ifeq: at start of template:)
--><includeonly>
| <!--(this template has not been transcluded on a /doc or /{{{override}}} page)-->
}}<!--
--></includeonly><noinclude>{{Documentation}}</noinclude>
41ca90af0945442788a2dbd08c8c54a61a23c057
Template:Tnull
10
64
131
130
2023-08-10T14:07:37Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
#REDIRECT [[Template:Template link null]]
{{Redirect category shell|
{{R from move}}
}}
b22d666a4b16808dc3becc2403546fb9ab5dea7e
Template:Template link null
10
65
133
132
2023-08-10T14:07:37Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nolink=yes|code=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tnull}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
2167c503e001d24d870ef82a9de0aaa9832404cb
Template:Tld
10
66
135
134
2023-08-10T14:07:38Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
#REDIRECT [[Template:Template link code]]
be5d6275ea41d83224503e05901f3405c82141f7
Template:Shortcut
10
67
137
136
2023-08-10T14:07:38Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
<includeonly>{{#invoke:Shortcut|main}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
2f2ccc402cde40b1ae056628bffa0852ee01653c
Module:Shortcut
828
68
139
138
2023-08-10T14:07:38Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- This module implements {{shortcut}}.
-- Set constants
local CONFIG_MODULE = 'Module:Shortcut/config'
-- Load required modules
local checkType = require('libraryUtil').checkType
local yesno = require('Module:Yesno')
local p = {}
local function message(msg, ...)
return mw.message.newRawMessage(msg, ...):plain()
end
local function makeCategoryLink(cat)
return string.format('[[%s:%s]]', mw.site.namespaces[14].name, cat)
end
function p._main(shortcuts, options, frame, cfg)
checkType('_main', 1, shortcuts, 'table')
checkType('_main', 2, options, 'table', true)
options = options or {}
frame = frame or mw.getCurrentFrame()
cfg = cfg or mw.loadData(CONFIG_MODULE)
local templateMode = options.template and yesno(options.template)
local redirectMode = options.redirect and yesno(options.redirect)
local isCategorized = not options.category or yesno(options.category) ~= false
-- Validate shortcuts
for i, shortcut in ipairs(shortcuts) do
if type(shortcut) ~= 'string' or #shortcut < 1 then
error(message(cfg['invalid-shortcut-error'], i), 2)
end
end
-- Make the list items. These are the shortcuts plus any extra lines such
-- as options.msg.
local listItems = {}
for i, shortcut in ipairs(shortcuts) do
local templatePath, prefix
if templateMode then
-- Namespace detection
local titleObj = mw.title.new(shortcut, 10)
if titleObj.namespace == 10 then
templatePath = titleObj.fullText
else
templatePath = shortcut
end
prefix = options['pre' .. i] or options.pre or ''
end
if options.target and yesno(options.target) then
listItems[i] = templateMode
and string.format("{{%s[[%s|%s]]}}", prefix, templatePath, shortcut)
or string.format("[[%s]]", shortcut)
else
listItems[i] = frame:expandTemplate{
title = 'No redirect',
args = templateMode and {templatePath, shortcut} or {shortcut, shortcut}
}
if templateMode then
listItems[i] = string.format("{{%s%s}}", prefix, listItems[i])
end
end
end
table.insert(listItems, options.msg)
-- Return an error if we have nothing to display
if #listItems < 1 then
local msg = cfg['no-content-error']
msg = string.format('<strong class="error">%s</strong>', msg)
if isCategorized and cfg['no-content-error-category'] then
msg = msg .. makeCategoryLink(cfg['no-content-error-category'])
end
return msg
end
local root = mw.html.create()
root:wikitext(frame:extensionTag{ name = 'templatestyles', args = { src = 'Module:Shortcut/styles.css'} })
-- Anchors
local anchorDiv = root
:tag('div')
:addClass('module-shortcutanchordiv')
for i, shortcut in ipairs(shortcuts) do
local anchor = mw.uri.anchorEncode(shortcut)
anchorDiv:tag('span'):attr('id', anchor)
end
-- Shortcut heading
local shortcutHeading
do
local nShortcuts = #shortcuts
if nShortcuts > 0 then
local headingMsg = options['shortcut-heading'] or
redirectMode and cfg['redirect-heading'] or
cfg['shortcut-heading']
shortcutHeading = message(headingMsg, nShortcuts)
shortcutHeading = frame:preprocess(shortcutHeading)
end
end
-- Shortcut box
local shortcutList = root
:tag('div')
:addClass('module-shortcutboxplain noprint')
:attr('role', 'note')
if options.float and options.float:lower() == 'left' then
shortcutList:addClass('module-shortcutboxleft')
end
if options.clear and options.clear ~= '' then
shortcutList:css('clear', options.clear)
end
if shortcutHeading then
shortcutList
:tag('div')
:addClass('module-shortcutlist')
:wikitext(shortcutHeading)
end
local ubl = require('Module:List').unbulleted(listItems)
shortcutList:wikitext(ubl)
return tostring(root)
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame)
-- Separate shortcuts from options
local shortcuts, options = {}, {}
for k, v in pairs(args) do
if type(k) == 'number' then
shortcuts[k] = v
else
options[k] = v
end
end
-- Compress the shortcut array, which may contain nils.
local function compressArray(t)
local nums, ret = {}, {}
for k in pairs(t) do
nums[#nums + 1] = k
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[i] = t[num]
end
return ret
end
shortcuts = compressArray(shortcuts)
return p._main(shortcuts, options, frame)
end
return p
03fd46a265e549852a9ed3d3a9249b247d84cb4f
Module:Shortcut/config
828
69
141
140
2023-08-10T14:07:39Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- This module holds configuration data for [[Module:Shortcut]].
return {
-- The heading at the top of the shortcut box. It accepts the following parameter:
-- $1 - the total number of shortcuts. (required)
['shortcut-heading'] = '[[Wikipedia:Shortcut|{{PLURAL:$1|Shortcut|Shortcuts}}]]',
-- The heading when |redirect=yes is given. It accepts the following parameter:
-- $1 - the total number of shortcuts. (required)
['redirect-heading'] = '[[Wikipedia:Redirect|{{PLURAL:$1|Redirect|Redirects}}]]',
-- The error message to display when a shortcut is invalid (is not a string, or
-- is the blank string). It accepts the following parameter:
-- $1 - the number of the shortcut in the argument list. (required)
['invalid-shortcut-error'] = 'shortcut #$1 was invalid (shortcuts must be ' ..
'strings of at least one character in length)',
-- The error message to display when no shortcuts or other displayable content
-- were specified. (required)
['no-content-error'] = 'Error: no shortcuts were specified and the ' ..
mw.text.nowiki('|msg=') ..
' parameter was not set.',
-- A category to add when the no-content-error message is displayed. (optional)
['no-content-error-category'] = 'Shortcut templates with missing parameters',
}
f9d1d94844d5953753eb19e30a3ce389eda3d319
Template:TemplateData header
10
71
145
144
2023-08-10T14:07:39Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
<div class="templatedata-header">{{#if:{{{noheader|}}}|<!--
noheader:
-->{{Template parameter usage|based=y}}|<!--
+header:
-->This is the {{#if:{{{nolink|}}}|<!--
+header, nolink TD
-->TemplateData|<!--
+header, +link [[TD]]; DEFAULT:
-->[[Wikipedia:TemplateData|TemplateData]]}}<!--
e.o. #if:nolink; DEFAULT:
--> for this template used by [[mw:Extension:TemplateWizard|TemplateWizard]], [[Wikipedia:VisualEditor|VisualEditor]] and other tools. {{Template parameter usage|based=y}}<!--
e.o. #if:noheader
-->}}
'''TemplateData for {{{1|{{BASEPAGENAME}}}}}'''
</div><includeonly><!--
check parameters
-->{{#invoke:Check for unknown parameters|check
|unknown={{template other|1=[[Category:Pages using TemplateData header with unknown parameters|_VALUE_]]}}
|template=Template:TemplateData header
|1 |nolink |noheader
|preview=<div class="error" style="font-weight:normal">Unknown parameter '_VALUE_' in [[Template:TemplateData header]].</div>
}}<!--
-->{{template other|{{sandbox other||
[[Category:Templates using TemplateData]]
}}}}</includeonly><!--
--><noinclude>{{Documentation}}</noinclude>
ddfbb4ae793846b96d4c06330417fa6ed4da2adc
Template:Template parameter usage
10
72
147
146
2023-08-10T14:07:40Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{#switch:{{{label|}}}
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|this template}} in articles{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report] for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|[[Template:{{ROOTPAGENAME}}]]}}{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|#default=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{{label|}}}]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
}}<noinclude>
{{documentation}}
</noinclude>
10a89e6a4bc63a1427518ea21bf94b8f623a7391
Module:High-use
828
73
149
148
2023-08-10T14:07:40Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
local p = {}
-- _fetch looks at the "demo" argument.
local _fetch = require('Module:Transclusion_count').fetch
local yesno = require('Module:Yesno')
function p.num(frame, count)
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
-- Build output string
local return_value = ""
if count == nil then
if frame.args[1] == "risk" then
return_value = "a very large number of"
else
return_value = "many"
end
else
-- Use 2 significant figures for smaller numbers and 3 for larger ones
local sigfig = 2
if count >= 100000 then
sigfig = 3
end
-- Prepare to round to appropriate number of sigfigs
local f = math.floor(math.log10(count)) - sigfig + 1
-- Round and insert "approximately" or "+" when appropriate
if (frame.args[2] == "yes") or (mw.ustring.sub(frame.args[1],-1) == "+") then
-- Round down
return_value = string.format("%s+", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) ) * (10^(f))) )
else
-- Round to nearest
return_value = string.format("approximately %s", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) + 0.5) * (10^(f))) )
end
-- Insert percentage of pages if that is likely to be >= 1% and when |no-percent= not set to yes
if count and count > 250000 and not yesno (frame:getParent().args['no-percent']) then
local percent = math.floor( ( (count/frame:callParserFunction('NUMBEROFPAGES', 'R') ) * 100) + 0.5)
if percent >= 1 then
return_value = string.format("%s pages, or roughly %s%% of all", return_value, percent)
end
end
end
return return_value
end
-- Actions if there is a large (greater than or equal to 100,000) transclusion count
function p.risk(frame)
local return_value = ""
if frame.args[1] == "risk" then
return_value = "risk"
else
local count = _fetch(frame)
if count and count >= 100000 then return_value = "risk" end
end
return return_value
end
function p.text(frame, count)
-- Only show the information about how this template gets updated if someone
-- is actually editing the page and maybe trying to update the count.
local bot_text = (frame:preprocess("{{REVISIONID}}") == "") and "\n\n----\n'''Preview message''': Transclusion count updated automatically ([[Template:High-use/doc#Technical details|see documentation]])." or ''
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" or title.subpageText == "sandbox" then
title = title.basePageTitle
end
local systemMessages = frame.args['system']
if frame.args['system'] == '' then
systemMessages = nil
end
-- This retrieves the project URL automatically to simplify localiation.
local templateCount = ('on [https://linkcount.toolforge.org/index.php?project=%s&page=%s %s pages]'):format(
mw.title.getCurrentTitle():fullUrl():gsub('//(.-)/.*', '%1'),
mw.uri.encode(title.fullText), p.num(frame, count))
local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used ';
if systemMessages then
used_on_text = used_on_text .. systemMessages ..
((count and count > 2000) and ("''', and " .. templateCount) or ("'''"))
else
used_on_text = used_on_text .. templateCount .. "'''"
end
local sandbox_text = ("%s's [[%s/sandbox|/sandbox]] or [[%s/testcases|/testcases]] subpages, or in your own [[%s]]. "):format(
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"),
title.fullText, title.fullText,
mw.title.getCurrentTitle().namespace == 828 and "Module:Sandbox|module sandbox" or "Wikipedia:User pages#SUB|user subpage"
)
local infoArg = frame.args["info"] ~= "" and frame.args["info"]
if (systemMessages or frame.args[1] == "risk" or (count and count >= 100000) ) then
local info = systemMessages and '.<br/>Changes to it can cause immediate changes to the Wikipedia user interface.' or '.'
if infoArg then
info = info .. "<br />" .. infoArg
end
sandbox_text = info .. '<br /> To avoid major disruption' ..
(count and count >= 100000 and ' and server load' or '') ..
', any changes should be tested in the ' .. sandbox_text ..
'The tested changes can be added to this page in a single edit. '
else
sandbox_text = (infoArg and ('.<br />' .. infoArg .. ' C') or ' and c') ..
'hanges may be widely noticed. Test changes in the ' .. sandbox_text
end
local discussion_text = systemMessages and 'Please discuss changes ' or 'Consider discussing changes '
if frame.args["2"] and frame.args["2"] ~= "" and frame.args["2"] ~= "yes" then
discussion_text = string.format("%sat [[%s]]", discussion_text, frame.args["2"])
else
discussion_text = string.format("%son the [[%s|talk page]]", discussion_text, title.talkPageTitle.fullText )
end
return used_on_text .. sandbox_text .. discussion_text .. " before implementing them." .. bot_text
end
function p.main(frame)
local count = nil
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
local image = "[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]"
local type_param = "style"
local epilogue = ''
if frame.args['system'] and frame.args['system'] ~= '' then
image = "[[File:Ambox important.svg|40px|alt=Warning|link=]]"
type_param = "content"
local nocat = frame:getParent().args['nocat'] or frame.args['nocat']
local categorise = (nocat == '' or not yesno(nocat))
if categorise then
epilogue = frame:preprocess('{{Sandbox other||{{#switch:{{#invoke:Effective protection level|{{#switch:{{NAMESPACE}}|File=upload|#default=edit}}|{{FULLPAGENAME}}}}|sysop|templateeditor|interfaceadmin=|#default=[[Category:Pages used in system messages needing protection]]}}}}')
end
elseif (frame.args[1] == "risk" or (count and count >= 100000)) then
image = "[[File:Ambox warning orange.svg|40px|alt=Warning|link=]]"
type_param = "content"
end
if frame.args["form"] == "editnotice" then
return frame:expandTemplate{
title = 'editnotice',
args = {
["image"] = image,
["text"] = p.text(frame, count),
["expiry"] = (frame.args["expiry"] or "")
}
} .. epilogue
else
return require('Module:Message box').main('ombox', {
type = type_param,
image = image,
text = p.text(frame, count),
expiry = (frame.args["expiry"] or "")
}) .. epilogue
end
end
return p
134551888e066954a89c109d2faa8af71a4454a4
Module:Transclusion count
828
74
151
150
2023-08-10T14:07:40Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
local p = {}
function p.fetch(frame)
local template = nil
local return_value = nil
-- Use demo parameter if it exists, otherswise use current template name
local namespace = mw.title.getCurrentTitle().namespace
if frame.args["demo"] and frame.args["demo"] ~= "" then
template = mw.ustring.gsub(frame.args["demo"],"^[Tt]emplate:","")
elseif namespace == 10 then -- Template namespace
template = mw.title.getCurrentTitle().text
elseif namespace == 828 then -- Module namespace
template = (mw.site.namespaces[828].name .. ":" .. mw.title.getCurrentTitle().text)
end
-- If in template or module namespace, look up count in /data
if template ~= nil then
namespace = mw.title.new(template, "Template").namespace
if namespace == 10 or namespace == 828 then
template = mw.ustring.gsub(template, "/doc$", "") -- strip /doc from end
template = mw.ustring.gsub(template, "/sandbox$", "") -- strip /sandbox from end
local index = mw.ustring.sub(mw.title.new(template).text,1,1)
local status, data = pcall(function ()
return(mw.loadData('Module:Transclusion_count/data/' .. (mw.ustring.find(index, "%a") and index or "other")))
end)
if status then
return_value = tonumber(data[mw.ustring.gsub(template, " ", "_")])
end
end
end
-- If database value doesn't exist, use value passed to template
if return_value == nil and frame.args[1] ~= nil then
local arg1=mw.ustring.match(frame.args[1], '[%d,]+')
if arg1 and arg1 ~= '' then
return_value = tonumber(frame:callParserFunction('formatnum', arg1, 'R'))
end
end
return return_value
end
-- Tabulate this data for [[Wikipedia:Database reports/Templates transcluded on the most pages]]
function p.tabulate(frame)
local list = {}
for i = 65, 91 do
local data = mw.loadData('Module:Transclusion count/data/' .. ((i == 91) and 'other' or string.char(i)))
for name, count in pairs(data) do
table.insert(list, {mw.title.new(name, "Template").fullText, count})
end
end
table.sort(list, function(a, b)
return (a[2] == b[2]) and (a[1] < b[1]) or (a[2] > b[2])
end)
local lang = mw.getContentLanguage();
for i = 1, #list do
list[i] = ('|-\n| %d || [[%s]] || %s\n'):format(i, list[i][1]:gsub('_', ' '), lang:formatNum(list[i][2]))
end
return table.concat(list)
end
return p
000ef6bcbf7b66e727870b0c300c4009da300513
Template:Param
10
75
153
152
2023-08-10T14:07:41Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{SAFESUBST:<noinclude />#ifeq:{{SAFESUBST:<noinclude />Yesno|{{{nested|no}}}}}|yes||<{{{tag|code}}}>}}{{{{{{1<noinclude>|foo</noinclude>}}}{{SAFESUBST:<noinclude />#ifeq:{{{2}}}|{{{2|}}} ||}}{{{2|}}}}}}{{SAFESUBST:<noinclude />#ifeq:{{SAFESUBST:<noinclude />Yesno|{{{nested|no}}}}}|yes||</{{{tag|code}}}>}}<noinclude>
{{Documentation}}
<!--
PLEASE ADD CATEGORIES AND INTERWIKIS
TO THE /doc SUBPAGE, THANKS
-->
</noinclude>
abdb5d7fe0982064ea62ad15e8298d1693ed69e2
Module:Lua banner
828
76
155
154
2023-08-10T14:07:41Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
-- This module implements the {{lua}} template.
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local p = {}
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args)
local modules = mTableTools.compressSparseArray(args)
local box = p.renderBox(modules)
local trackingCategories = p.renderTrackingCategories(args, modules)
return box .. trackingCategories
end
function p.renderBox(modules)
local boxArgs = {}
if #modules < 1 then
boxArgs.text = '<strong class="error">Error: no modules specified</strong>'
else
local moduleLinks = {}
for i, module in ipairs(modules) do
moduleLinks[i] = string.format('[[:%s]]', module)
local maybeSandbox = mw.title.new(module .. '/sandbox')
if maybeSandbox.exists then
moduleLinks[i] = moduleLinks[i] .. string.format(' ([[:%s|sandbox]])', maybeSandbox.fullText)
end
end
local moduleList = mList.makeList('bulleted', moduleLinks)
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" then
title = title.basePageTitle
end
if title.contentModel == "Scribunto" then
boxArgs.text = 'This module depends on the following other modules:' .. moduleList
else
boxArgs.text = 'This template uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
end
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = '[[File:Lua-Logo.svg|30px|alt=|link=]]'
return mMessageBox.main('mbox', boxArgs)
end
function p.renderTrackingCategories(args, modules, titleObj)
if yesno(args.nocat) then
return ''
end
local cats = {}
-- Error category
if #modules < 1 then
cats[#cats + 1] = 'Lua templates with errors'
end
-- Lua templates category
titleObj = titleObj or mw.title.getCurrentTitle()
local subpageBlacklist = {
doc = true,
sandbox = true,
sandbox2 = true,
testcases = true
}
if not subpageBlacklist[titleObj.subpageText] then
local protCatName
if titleObj.namespace == 10 then
local category = args.category
if not category then
local categories = {
['Module:String'] = 'Templates based on the String Lua module',
['Module:Math'] = 'Templates based on the Math Lua module',
['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module',
['Module:Citation/CS1'] = 'Templates based on the Citation/CS1 Lua module'
}
category = modules[1] and categories[modules[1]]
category = category or 'Lua-based templates'
end
cats[#cats + 1] = category
protCatName = "Templates using under-protected Lua modules"
elseif titleObj.namespace == 828 then
protCatName = "Modules depending on under-protected modules"
end
if not args.noprotcat and protCatName then
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
local currentProt
if titleObj.id ~= 0 then
-- id is 0 (page does not exist) if am previewing before creating a template.
currentProt = titleObj.protectionLevels["edit"][1]
end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
if module ~= "WP:libraryUtil" then
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt < currentProt then
cats[#cats + 1] = protCatName
break
end
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
return p
03ec1b34a40121efc562c0c64a67ebbf57d56dff
Template:Lua
10
77
157
156
2023-08-10T14:07:42Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
<includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>
{{Lua|Module:Lua banner}}
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
dba3962144dacd289dbc34f50fbe0a7bf6d7f2f7
Template:Clc
10
78
159
158
2023-08-10T14:07:42Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
#REDIRECT [[Template:Category link with count]]
02280e2ab57b544236e11f913e3759c5781ca9d5
Template:Category link with count
10
79
161
160
2023-08-10T14:07:42Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
[[:Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|<!--
-->{{#if:{{{name|}}}|{{{name}}}|Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}}}<!--
-->]] ({{PAGESINCATEGORY:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|{{{2|all}}}}})<noinclude>
{{Documentation}}
</noinclude>
f93f1540b8c157703bd6d24ae35c35bef745981d
Module:Transclusion count/data/S
828
80
163
162
2023-08-10T14:07:44Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
return {
["S"] = 3500,
["S-aca"] = 6400,
["S-ach"] = 16000,
["S-aft"] = 218000,
["S-aft/filter"] = 218000,
["S-bef"] = 222000,
["S-bef/filter"] = 222000,
["S-break"] = 5000,
["S-civ"] = 2600,
["S-dip"] = 5300,
["S-end"] = 245000,
["S-gov"] = 7900,
["S-hon"] = 3800,
["S-hou"] = 9500,
["S-inc"] = 13000,
["S-legal"] = 9300,
["S-mil"] = 12000,
["S-new"] = 15000,
["S-non"] = 9200,
["S-npo"] = 4000,
["S-off"] = 41000,
["S-par"] = 50000,
["S-par/en"] = 3200,
["S-par/gb"] = 3300,
["S-par/uk"] = 11000,
["S-par/us-hs"] = 11000,
["S-par/us-sen"] = 2000,
["S-ppo"] = 13000,
["S-prec"] = 3200,
["S-rail"] = 6300,
["S-rail-start"] = 6200,
["S-rail/lines"] = 6400,
["S-reg"] = 20000,
["S-rel"] = 18000,
["S-roy"] = 2700,
["S-s"] = 3600,
["S-sports"] = 10000,
["S-start"] = 239000,
["S-ttl"] = 229000,
["S-vac"] = 6000,
["SCO"] = 3700,
["SDcat"] = 5390000,
["SECOND"] = 2300,
["SGP"] = 2600,
["SIA"] = 2600,
["SIPA"] = 2600,
["SLO"] = 4200,
["SMS"] = 7200,
["SMU"] = 2100,
["SPI_archive_notice"] = 70000,
["SPIarchive_notice"] = 70000,
["SPIcat"] = 3800,
["SPIclose"] = 3300,
["SPIpriorcases"] = 65000,
["SR/Olympics_profile"] = 3200,
["SRB"] = 3600,
["SS"] = 20000,
["SSPa"] = 2600,
["STN"] = 12000,
["SUBJECTSPACE_formatted"] = 42000,
["SUI"] = 8400,
["SVG"] = 3200,
["SVG-Logo"] = 17000,
["SVG-Res"] = 15000,
["SVG-logo"] = 2900,
["SVK"] = 5900,
["SVN"] = 5200,
["SWE"] = 12000,
["Sandbox_other"] = 230000,
["Saturday"] = 2600,
["Saved_book"] = 52000,
["Sc"] = 3000,
["Scholia"] = 2700,
["School_block"] = 13000,
["School_disambiguation"] = 3300,
["Schoolblock"] = 6700,
["Schooldis"] = 2700,
["Schoolip"] = 10000,
["Scientist_icon"] = 15000,
["Scientist_icon2"] = 15000,
["Sclass"] = 31000,
["Sclass2"] = 10000,
["Screen_reader-only"] = 43000,
["Screen_reader-only/styles.css"] = 43000,
["Script"] = 5800,
["Script/Arabic"] = 2100,
["Script/Hebrew"] = 4700,
["Script/Nastaliq"] = 14000,
["Script/doc/id-unk"] = 2900,
["Script/doc/id-unk/core"] = 2900,
["Script/doc/id-unk/is-iso-alpha4"] = 2800,
["Script/doc/id-unk/name-to-alpha4"] = 2900,
["Script/styles.css"] = 3000,
["Script/styles_arabic.css"] = 2100,
["Script/styles_hebrew.css"] = 4700,
["Sdash"] = 3000,
["Search_box"] = 49000,
["Search_link"] = 9800,
["Section_link"] = 52000,
["Section_sizes"] = 2400,
["See"] = 11000,
["See_also"] = 184000,
["Seealso"] = 6700,
["Select_skin"] = 4300,
["Selected_article"] = 2700,
["Selected_picture"] = 2500,
["Self"] = 49000,
["Self-published_inline"] = 3900,
["Self-published_source"] = 6600,
["Self-reference"] = 2700,
["Self-reference_tool"] = 5100,
["Self/migration"] = 33000,
["Self2"] = 2100,
["Sent_off"] = 13000,
["Sentoff"] = 4100,
["Separated_entries"] = 175000,
["Sequence"] = 3700,
["Serial_killer_opentask"] = 3600,
["Series_overview"] = 7600,
["Serif"] = 2800,
["Set_category"] = 35000,
["Set_index_article"] = 5700,
["Sets_taxobox_colour"] = 93000,
["Sfn"] = 152000,
["SfnRef"] = 133000,
["Sfnm"] = 3500,
["Sfnp"] = 17000,
["Sfnref"] = 11000,
["Sfrac"] = 4200,
["Sfrac/styles.css"] = 4200,
["SharedIPEDU"] = 3200,
["Shared_IP"] = 11000,
["Shared_IP_advice"] = 16000,
["Shared_IP_corp"] = 5000,
["Shared_IP_edu"] = 126000,
["Shared_IP_gov"] = 3000,
["Sharedip"] = 3300,
["Sharedipedu"] = 3600,
["Sherdog"] = 2600,
["Ship"] = 85000,
["Ship/maintenancecategory"] = 85000,
["Ship_index"] = 7000,
["Shipboxflag"] = 20000,
["Shipboxflag/core"] = 20000,
["Shipwrecks_navbox_footer"] = 10000,
["Shipwrecks_navbox_footer/link"] = 10000,
["Short_description"] = 5500000,
["Short_description/lowercasecheck"] = 5500000,
["Short_pages_monitor"] = 10000,
["Short_pages_monitor/maximum_length"] = 10000,
["Shortcut"] = 19000,
["Should_be_SVG"] = 9100,
["Show_button"] = 2130000,
["Sic"] = 32000,
["Sica"] = 3000,
["Side_box"] = 1120000,
["Sidebar"] = 254000,
["Sidebar_games_events"] = 36000,
["Sidebar_person"] = 2300,
["Sidebar_person/styles.css"] = 2300,
["Sidebar_with_collapsible_lists"] = 93000,
["Sigfig"] = 3700,
["Significant_figures"] = 5000,
["Significant_figures/rnd"] = 4600,
["Signpost-subscription"] = 2100,
["Sildb_prim"] = 2000,
["Silver02"] = 16000,
["Silver2"] = 48000,
["Silver_medal"] = 5500,
["Similar_names"] = 2100,
["Single+double"] = 6800,
["Single+space"] = 14000,
["Single-innings_cricket_match"] = 3200,
["Single_chart"] = 37000,
["Single_chart/chartnote"] = 37000,
["Single_namespace"] = 200000,
["Singlechart"] = 20000,
["Singles"] = 41000,
["Sister-inline"] = 187000,
["Sister_project"] = 1040000,
["Sister_project_links"] = 11000,
["Sisterlinks"] = 2800,
["Skip_to_talk"] = 12000,
["Skip_to_talk/styles.css"] = 12000,
["Sky"] = 2700,
["Sky/styles.css"] = 2700,
["Slink"] = 13000,
["Small"] = 597000,
["Small_Solar_System_bodies"] = 3600,
["Smallcaps"] = 18000,
["Smallcaps/styles.css"] = 18000,
["Smallcaps_all"] = 3100,
["Smalldiv"] = 21000,
["Smaller"] = 72000,
["Smallsup"] = 21000,
["Smiley"] = 43000,
["Snd"] = 160000,
["Snds"] = 6300,
["Soccer_icon"] = 130000,
["Soccer_icon2"] = 130000,
["Soccer_icon4"] = 5100,
["Soccerbase"] = 13000,
["Soccerbase_season"] = 6700,
["Soccerway"] = 75000,
["Sock"] = 47000,
["Sock_list"] = 4000,
["Sockcat"] = 2000,
["Sockmaster"] = 9300,
["Sockpuppet"] = 237000,
["Sockpuppet/altmaster"] = 2100,
["Sockpuppet/categorise"] = 237000,
["SockpuppetCheckuser"] = 5500,
["Sockpuppet_category"] = 45000,
["Sockpuppet_category/confirmed"] = 23000,
["Sockpuppet_category/suspected"] = 22000,
["Sockpuppetcheckuser"] = 3600,
["Sockpuppeteer"] = 24000,
["Soft_redirect"] = 6100,
["Soft_redirect_protection"] = 8200,
["Softredirect"] = 3200,
["Solar_luminosity"] = 4400,
["Solar_mass"] = 5200,
["Solar_radius"] = 4200,
["Soldier_icon"] = 3900,
["Soldier_icon2"] = 3900,
["Song"] = 8300,
["Songs"] = 19000,
["Songs_category"] = 8300,
["Songs_category/core"] = 8300,
["Sort"] = 116000,
["Sortname"] = 52000,
["Source-attribution"] = 28000,
["Source_check"] = 965000,
["Sourcecheck"] = 965000,
["Sources"] = 2400,
["South_America_topic"] = 2500,
["Sp"] = 250000,
["Space"] = 55000,
["Space+double"] = 18000,
["Space+single"] = 13000,
["Spaced_en_dash"] = 192000,
["Spaced_en_dash_space"] = 6400,
["Spaced_ndash"] = 23000,
["Spaces"] = 2690000,
["Spain_metadata_Wikidata"] = 7500,
["Spamlink"] = 13000,
["Species_Latin_name_abbreviation_disambiguation"] = 2200,
["Species_list"] = 15000,
["Speciesbox"] = 288000,
["Speciesbox/getGenus"] = 288000,
["Speciesbox/getSpecies"] = 288000,
["Speciesbox/name"] = 288000,
["Speciesbox/parameterCheck"] = 288000,
["Speciesbox/trim"] = 288000,
["Specieslist"] = 5400,
["Split_article"] = 3600,
["Spnd"] = 4100,
["Sport_icon"] = 14000,
["Sport_icon2"] = 15000,
["SportsYearCatUSstate"] = 6500,
["SportsYearCatUSstate/core"] = 6500,
["Sports_links"] = 65000,
["Sports_reference"] = 7300,
["Squad_maintenance"] = 3500,
["Sronly"] = 41000,
["Srt"] = 5100,
["Stack"] = 25000,
["Stack/styles.css"] = 34000,
["Stack_begin"] = 8900,
["Stack_end"] = 8900,
["StaleIP"] = 3200,
["Standings_table_end"] = 54000,
["Standings_table_entry"] = 54000,
["Standings_table_entry/record"] = 54000,
["Standings_table_start"] = 54000,
["Standings_table_start/colheader"] = 54000,
["Standings_table_start/colspan"] = 54000,
["Standings_table_start/styles.css"] = 54000,
["Starbox_astrometry"] = 5100,
["Starbox_begin"] = 5300,
["Starbox_catalog"] = 5200,
["Starbox_character"] = 5100,
["Starbox_detail"] = 5000,
["Starbox_end"] = 5200,
["Starbox_image"] = 2900,
["Starbox_observe"] = 5100,
["Starbox_reference"] = 5200,
["Start-Class"] = 18000,
["Start-date"] = 3800,
["Start_and_end_dates"] = 2700,
["Start_box"] = 8100,
["Start_date"] = 433000,
["Start_date_and_age"] = 138000,
["Start_date_and_years_ago"] = 6600,
["Start_of_course_timeline"] = 6000,
["Start_of_course_week"] = 6200,
["Start_tab"] = 4900,
["Startflatlist"] = 144000,
["Static_IP"] = 5900,
["Station"] = 7700,
["Station_link"] = 16000,
["Stdinchicite"] = 10000,
["Steady"] = 14000,
["Stl"] = 14000,
["Stn"] = 7300,
["Stn_art_lnk"] = 2000,
["Stnlnk"] = 30000,
["Storm_colour"] = 5100,
["Storm_path"] = 2100,
["StoryTeleplay"] = 3400,
["Str_endswith"] = 199000,
["Str_find"] = 115000,
["Str_index"] = 13000,
["Str_left"] = 1580000,
["Str_len"] = 18000,
["Str_letter"] = 175000,
["Str_letter/trim"] = 20000,
["Str_number"] = 8000,
["Str_number/trim"] = 169000,
["Str_rep"] = 311000,
["Str_right"] = 678000,
["Str_trim"] = 5300,
["Str_≠_len"] = 34000,
["Str_≥_len"] = 72000,
["Strfind_short"] = 222000,
["Strikethrough"] = 16000,
["String_split"] = 2600,
["Strip_tags"] = 37000,
["Strong"] = 852000,
["Structurae"] = 2100,
["Stub-Class"] = 17000,
["Stub_Category"] = 13000,
["Stub_category"] = 18000,
["Stub_documentation"] = 36000,
["Student_editor"] = 27000,
["Student_sandbox"] = 4500,
["Student_table_row"] = 5100,
["Students_table"] = 5100,
["Su"] = 9700,
["Su-census1989"] = 4500,
["Sub"] = 4100,
["Subinfobox_bodystyle"] = 35000,
["Subject_bar"] = 18000,
["Suboff"] = 6200,
["Subon"] = 6300,
["Subpage_other"] = 285000,
["Subscription"] = 4300,
["Subscription_required"] = 34000,
["Subsidebar_bodystyle"] = 6700,
["Subst_only"] = 4600,
["Substituted_comment"] = 19000,
["Succession_box"] = 119000,
["Succession_links"] = 162000,
["Summer_Olympics_by_year_category_navigation"] = 2400,
["Summer_Olympics_by_year_category_navigation/core"] = 2400,
["Sunday"] = 2600,
["Sup"] = 58000,
["Suppress_categories"] = 5100,
["Surname"] = 66000,
["Swiss_populations"] = 2400,
["Swiss_populations_NC"] = 3000,
["Swiss_populations_YM"] = 2300,
["Swiss_populations_ref"] = 2400,
["Switcher"] = 2700,
["Module:SDcat"] = 5390000,
["Module:SPI_archive_notice"] = 32000,
["Module:Science_redirect"] = 253000,
["Module:Science_redirect/conf"] = 253000,
["Module:Section_link"] = 52000,
["Module:Section_sizes"] = 3500,
["Module:See_also_if_exists"] = 72000,
["Module:Separated_entries"] = 2270000,
["Module:Series_overview"] = 7700,
["Module:Settlement_short_description"] = 709000,
["Module:Shortcut"] = 23000,
["Module:Shortcut/config"] = 23000,
["Module:Shortcut/styles.css"] = 23000,
["Module:Side_box"] = 1150000,
["Module:Side_box/styles.css"] = 1150000,
["Module:Sidebar"] = 336000,
["Module:Sidebar/configuration"] = 336000,
["Module:Sidebar/styles.css"] = 342000,
["Module:Sidebar_games_events"] = 36000,
["Module:Sidebar_games_events/styles.css"] = 36000,
["Module:Singles"] = 41000,
["Module:Sister_project_links"] = 14000,
["Module:Sister_project_links/bar/styles.css"] = 3300,
["Module:Sister_project_links/styles.css"] = 11000,
["Module:Sock_list"] = 4000,
["Module:Sort_title"] = 17000,
["Module:Sortkey"] = 197000,
["Module:Split_article"] = 3600,
["Module:Sports_career"] = 19000,
["Module:Sports_color"] = 68000,
["Module:Sports_color/baseball"] = 34000,
["Module:Sports_color/basketball"] = 22000,
["Module:Sports_color/ice_hockey"] = 3200,
["Module:Sports_rbr_table"] = 11000,
["Module:Sports_rbr_table/styles.css"] = 11000,
["Module:Sports_reference"] = 7300,
["Module:Sports_results"] = 14000,
["Module:Sports_results/styles.css"] = 9400,
["Module:Sports_table"] = 57000,
["Module:Sports_table/WDL"] = 50000,
["Module:Sports_table/WDL_OT"] = 2600,
["Module:Sports_table/WL"] = 3900,
["Module:Sports_table/argcheck"] = 57000,
["Module:Sports_table/styles.css"] = 57000,
["Module:Sports_table/sub"] = 57000,
["Module:Sports_table/totalscheck"] = 41000,
["Module:Stock_tickers/NYSE"] = 2100,
["Module:Storm_categories"] = 5200,
["Module:Storm_categories/categories"] = 5200,
["Module:Storm_categories/colors"] = 5200,
["Module:Storm_categories/icons"] = 5200,
["Module:String"] = 11900000,
["Module:String2"] = 2280000,
["Module:Su"] = 12000,
["Module:Subject_bar"] = 18000,
["Module:Suppress_categories"] = 5200,
}
03ba019c97a222c7612ec7459698be278cb1bd12
Module:Message box/ombox.css
828
81
165
164
2023-08-10T14:07:44Z
InsaneX
2
1 revision imported: Importing Short description
text
text/plain
/* {{pp|small=y}} */
.ombox {
margin: 4px 0;
border-collapse: collapse;
border: 1px solid #a2a9b1; /* Default "notice" gray */
background-color: #f8f9fa;
box-sizing: border-box;
}
/* For the "small=yes" option. */
.ombox.mbox-small {
font-size: 88%;
line-height: 1.25em;
}
.ombox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
.ombox-delete {
border: 2px solid #b32424; /* Red */
}
.ombox-content {
border: 1px solid #f28500; /* Orange */
}
.ombox-style {
border: 1px solid #fc3; /* Yellow */
}
.ombox-move {
border: 1px solid #9932cc; /* Purple */
}
.ombox-protection {
border: 2px solid #a2a9b1; /* Gray-gold */
}
.ombox .mbox-text {
border: none;
/* @noflip */
padding: 0.25em 0.9em;
width: 100%;
}
.ombox .mbox-image {
border: none;
/* @noflip */
padding: 2px 0 2px 0.9em;
text-align: center;
}
.ombox .mbox-imageright {
border: none;
/* @noflip */
padding: 2px 0.9em 2px 0;
text-align: center;
}
/* An empty narrow cell */
.ombox .mbox-empty-cell {
border: none;
padding: 0;
width: 1px;
}
.ombox .mbox-invalid-type {
text-align: center;
}
@media (min-width: 720px) {
.ombox {
margin: 4px 10%;
}
.ombox.mbox-small {
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin: 4px 0 4px 1em;
width: 238px;
}
}
8fe3df4bb607e699eab2dbd23bd4a1a446391002
Template:Nowiki2
10
82
167
166
2023-08-10T14:07:44Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{#if: {{{tag|}}}
| {{#if: {{{style|}}}
| <{{{tag}}} style="{{{style}}}">
| <{{{tag}}}>
}}
}}{{#invoke:LuaCall | call | mw.text.nowiki |\{{{1|}}}<!-- -->}}{{#if: {{{tag|}}}
| </{{{tag}}}>
}}<noinclude>
{{Documentation}}
</noinclude>
2712eeff2099493a4151603b9ed4ea74e51fa6ed
Module:LuaCall
828
83
169
168
2023-08-10T14:07:45Z
InsaneX
2
1 revision imported: Importing Short description
Scribunto
text/plain
local p={}
function p.main(frame)
local parent = frame.getParent(frame) or {}
local reserved_value = {}
local reserved_function, reserved_contents
for k, v in pairs(parent.args or {}) do
_G[k] = tonumber(v) or v -- transfer every parameter directly to the global variable table
end
for k, v in pairs(frame.args or {}) do
_G[k] = tonumber(v) or v -- transfer every parameter directly to the global variable table
end
--- Alas Scribunto does NOT implement coroutines, according to
--- http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#string.format
--- this will not stop us from trying to implement one single lousy function call
if _G[1] then
reserved_function, reserved_contents = mw.ustring.match(_G[1], "^%s*(%a[^%s%(]*)%(([^%)]*)%)%s*$")
end
if reserved_contents then
local reserved_counter = 0
repeat
reserved_counter = reserved_counter + 1
reserved_value[reserved_counter] = _G[mw.ustring.match(reserved_contents, "([^%,]+)")]
reserved_contents = mw.ustring.match(reserved_contents, "[^%,]+,(.*)$")
until not reserved_contents
end
local reserved_arraypart = _G
while mw.ustring.match(reserved_function, "%.") do
reserved_functionpart, reserved_function = mw.ustring.match(reserved_function, "^(%a[^%.]*)%.(.*)$")
reserved_arraypart = reserved_arraypart[reserved_functionpart]
end
local reserved_call = reserved_arraypart[reserved_function]
if type(reserved_call) ~= "function" then
return tostring(reserved_call)
else
reserved_output = {reserved_call(unpack(reserved_value))}
return reserved_output[reserved_return or 1]
end
end
local function tonumberOrString(v)
return tonumber(v) or v:gsub("^\\", "", 1)
end
local function callWithTonumberOrStringOnPairs(f, ...)
local args = {}
for _, v in ... do
table.insert(args, tonumberOrString(v))
end
return (f(unpack(args)))
end
--[[
------------------------------------------------------------------------------------
-- ipairsAtOffset
-- This is an iterator for arrays. It can be used like ipairs, but with
-- specified i as first index to iterate. i is an offset from 1
--
------------------------------------------------------------------------------------
--]]
local function ipairsAtOffset(t, i)
local f, s, i0 = ipairs(t)
return f, s, i0+i
end
local function get(s)
local G = _G; for _ in mw.text.gsplit(
mw.text.trim(s, '%s'), '%s*%.%s*'
) do
G = G[_]
end
return G
end
--[[
------------------------------------------------------------------------------------
-- call
--
-- This function is usually useful for debugging template parameters.
-- Prefix parameter with backslash (\) to force interpreting parameter as string.
-- The leading backslash will be removed before passed to Lua function.
--
-- Example:
-- {{#invoke:LuaCall|call|mw.log|a|1|2|3}} will return results of mw.log('a', 1, 2, 3)
-- {{#invoke:LuaCall|call|mw.logObject|\a|321|\321| \321 }} will return results of mw.logObject('a', 321, '321', ' \\321 ')
--
-- This example show the debugging to see which Unicode characters are allowed in template parameters,
-- {{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x0061}}}} return 97
-- {{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x0000}}}} return 65533
-- {{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x0001}}}} return 65533
-- {{#invoke:LuaCall|call|string.format|0x%04x|{{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x0002}}}}}} return 0xfffd
-- {{#invoke:LuaCall|call|string.format|0x%04x|{{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x007e}}}}}} return 0x007e
-- {{#invoke:LuaCall|call|string.format|0x%04x|{{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x007f}}}}}} return 0x007f
-- {{#invoke:LuaCall|call|string.format|0x%04x|{{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x0080}}}}}} return 0x0080
-- {{#invoke:LuaCall|call|string.format|0x%04x|{{#invoke:LuaCall|call|mw.ustring.codepoint|{{#invoke:LuaCall|call|mw.ustring.char|0x00a0}}}}}} return 0x00a0
--
------------------------------------------------------------------------------------
--]]
function p.call(frame)
return callWithTonumberOrStringOnPairs(get(frame.args[1]),
ipairsAtOffset(frame.args, 1)
)
end
--local TableTools = require('Module:TableTools')
--[[
------------------------------------------------------------------------------------
-- get
--
-- Example:
-- {{#invoke:LuaCall|get| math.pi }} will return value of math.pi
-- {{#invoke:LuaCall|get|math|pi}} will return value of math.pi
-- {{#invoke:LuaCall|get| math |pi}} will return value of _G[' math '].pi
-- {{#invoke:LuaCall|get|_G| math.pi }} will return value of _G[' math.pi ']
-- {{#invoke:LuaCall|get|obj.a.5.c}} will return value of obj.a['5'].c
-- {{#invoke:LuaCall|get|obj|a|5|c}} will return value of obj.a[5].c
--
------------------------------------------------------------------------------------
--]]
function p.get(frame)
-- #frame.args always return 0, regardless of number of unnamed
-- template parameters, so check manually instead
if frame.args[2] == nil then
-- not do tonumber() for this args style,
-- always treat it as string,
-- so 'obj.1' will mean obj['1'] rather obj[1]
return get(frame.args[1])
else
local G = _G
for _, v in ipairs(frame.args) do
G = G[tonumberOrString(v)]
end
return G
end
end
--[[
------------------------------------------------------------------------------------
-- invoke
--
-- This function is used by Template:Invoke
--
------------------------------------------------------------------------------------
--]]
function p.invoke(frame)
local pframe, usedpargs = frame:getParent(), {}
-- get module and function names from parent args if not provided
local pfargs = setmetatable({frame.args[1], frame.args[2]}, {__index = table})
if not pfargs[1] then
pfargs[1], usedpargs[1] = pframe.args[1], true
if not pfargs[2] then
pfargs[2], usedpargs[2] = pframe.args[2], true
end
elseif not pfargs[2] then
pfargs[2], usedpargs[1] = pframe.args[1], true
end
-- repack sequential args
for i, v in ipairs(pframe.args) do
if not usedpargs[i] then
pfargs:insert(v)
usedpargs[i] = true
end
end
-- copy other args
for k, v in pairs(pframe.args) do
if not pfargs[k] and not usedpargs[k] then
pfargs[k], usedpargs[k] = v, true
end
end
-- #invoke off parent frame so the new frame has the same parent
return pframe:callParserFunction{name = '#invoke', args = pfargs}
end
return p
d6ec342627682bf90e61bbad921fcc6190f2e090
Template:High risk
10
84
171
170
2023-08-10T14:07:45Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
#REDIRECT [[Template:High-use]]
{{Redirect category shell|
{{R avoided double redirect|1=Template:High-risk}}
{{R from alternative hyphenation|'''{{-r|Template:High-risk}}'''}}{{R from template shortcut}}
}}
ce1776d54ed01e65417b2a4ed18778e32694aa48
Template:Short description/test
10
85
173
172
2023-08-10T14:07:46Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
<span class="shortdescription nomobile noexcerpt noprint">{{nowiki2|1={{#invoke:WikidataIB|getDescription|{{{1|}}}|qid={{{qid|}}}}}}}</span><noinclude>
{{documentation}}</noinclude>
880c3d2e1319b90060840b592e30fd9d1abdb27e
Template:Short description/doc
10
86
175
174
2023-08-10T14:07:48Z
InsaneX
2
1 revision imported: Importing Short description
wikitext
text/x-wiki
{{Documentation subpage}}
{{High risk|all-pages = yes}}
{{Warning|'''Please do not use redirects/shortcuts for this template''', as they cause problems with the [[Wikipedia:Shortdesc helper|short description editing gadget]] and other maintenance tools.}}
{{Lua|Module:Check for unknown parameters|Module:String}}
'''[[Template:Short description]]''' is used to add a [[Wikipedia:Short description|short description]] (which can be edited from within Wikipedia) to a Wikipedia page. These descriptions appear in Wikipedia searches and elsewhere, and help users identify the desired article.
== Usage ==
{{tld|Short description|''Write your short description here''}}
This should be limited to about 40 characters, as explained at [[WP:SDFORMAT]], along with the other guidance at [[WP:SDCONTENT]].
== Parameters ==
{{TemplateData header|noheader=1}}
<templatedata>
{
"description": {
"en": "Creates a short description for a Wikipedia page, which is displayed in search results and other locations.",
"es": "Crea una breve descripción, para un artículo de Wikipedia, que se utiliza en el Editor Visual para proporcionar contexto en los wikilinks (wikienlaces)."
},
"params": {
"1": {
"label": {
"en": "Description",
"es": "Descripción"
},
"description": {
"en": "The short description of the article or 'none'. It should be limited to about 40 characters.",
"es": "La descripción corta del artículo"
},
"example": {
"en": "Chinese encyclopedia writer (1947–2001)",
"es": "La enciclopedia en línea que cualquiera puede editar"
},
"required": true,
"type": "content"
},
"2": {
"label": {
"en": "No replace?",
"es": "2"
},
"description": {
"en": "Should be unused or 'noreplace'. Templates with noreplace will not replace a short description defined by an earlier template. Mainly for use within transcluded templates.",
"es": "Se anula una descripción corta si se transcluye. Debe estar sin usar o con 'noreplace' (que significar no reemplazar)."
},
"example": {
"es": "noreplace"
},
"required": false,
"type": "string",
"autovalue": "noreplace",
"suggestedvalues": [
"noreplace"
]
},
"pagetype": {
"type": "string",
"description": {
"en": "The type of page. This puts it in the appropriate category - Things with short description. Normally unneeded, since handled through namespace detection.",
"es": "El tipo de página. La coloca en la categoría apropiada - Cosas con descripción corta"
},
"example": "Redirect, Disambiguation page",
"required": false
}
},
"format": "{{_|_ = _}}\n"
}
</templatedata>
== About writing good short descriptions ==
This page is about the short description {{em|template}}; it does not provide guidelines for writing a good short description. If you plan to use this template, you should make sure you read and follow the detailed guidance at [[WP:HOWTOSD]]. General information can be found at [[Wikipedia:Short description]].
== Template information ==
Eventually all articles should have a short description:
* by directly using this template, in which case the short description will be unique to the article
* transcluded in another template, such as a disambiguation template, where a generic short description is adequate for a large class of pages
* where the short description is assembled from data in an infobox
Automatically generated descriptions within templates should set the second parameter as {{code|noreplace}} so they do not override any short descriptions specifically added to the transcluding article.
Short descriptions are not normally needed for non-article pages, such as redirects, but can be added if useful.
If the article title alone is sufficient to ensure reliable identification of the desired article, a null value of {{tnull|Short description|none}} may be used.
Short descriptions do not necessarily serve the same function as the Wikidata description for an item and they do not have to be the same, but some overlap is expected in many cases. Some Wikidata descriptions may be unsuitable, and if imported must be checked for relevance, accuracy and fitness for purpose. Responsibility for such imports lies with the importer. {{crossref|(See also [[d:Help:Description|Wikidata:Help:Description]].)}}
=== Example ===
At [[Oxygen therapy]], add the following at the very top of the article, above everything else:
* {{tld|Short description|Use of oxygen as medical treatment}}
== Testing ==
For testing purposes, the display of this template can be enabled by adding a line to your [[Special:MyPage/common.css]]:
* <syntaxhighlight lang="CSS" inline>.shortdescription { display:block !important; }</syntaxhighlight>
This can be easily removed or disabled when testing is finished.
If you want to {{em|always}} see short descriptions, you may prefer a more utilitarian layout, such as:
<syntaxhighlight lang="CSS">
.shortdescription {
display:block !important;
white-space: pre-wrap;
}
.shortdescription::before {
content: "\A[Short description:\0020";
}
.shortdescription::after {
content: "]\A";
}
</syntaxhighlight>
There is a test version of this template available as [[Template:Short description/test]] which displays its text by default.
* {{tld|Short description/test}} displays the short description if supplied
* {{tld|Short description/test}} displays nothing if <code>none</code> is supplied
* {{tld|Short description/test}} displays the description from Wikidata if <code>wikidata</code> is supplied.
Taking {{Q|Q1096878}} as an example:
* <code><nowiki>{{short description/test|Underwater diving where breathing is from equipment independent of the surface}}</nowiki></code> → {{short description/test|Underwater diving where breathing is from equipment independent of the surface }}
* <code><nowiki>{{short description/test|none}}</nowiki></code> → {{short description/test|none}}
* <code><nowiki>{{short description/test|wikidata}}</nowiki></code> → {{short description/test|wikidata|qid=Q1096878}}
===Pagetype parameter===
If {{param|Pagetype}} is '''not''' set, then this template adds the article to a category based on the namespace:
* {{clc|Articles with short description}}
* {{clc|Redirects with short description}} {{--}} for redirects in any namespace
If {{param|Pagetype}} '''is''' set, then this template adds the article to a category matching the parameter. For example:
* {{cl|Redirects with short description}} {{--}} {{code|pagetype {{=}} Redirect }}
{{anchor|No-aliases}}
== Aliases ==
{{shortcut|WP:SDNOALIASES}}
While there are currently <span class="plainlinks">[{{fullurl:Special:WhatLinksHere/Template:Short_description|hidetrans=1&hidelinks=1&limit=500}} redirects to this template]</span>, '''they must not be used''', for the reasons below:
:* Other templates and gadgets attempt to extract short descriptions from pages by explicitly searching for the transclusions of the {{tl|Short description}} template.
:* For example, {{tl|Annotated link}} searches for the template in its uppercase "Short description" and lowercase form "short description".
'''Do not''' start the template with a space: {{code|<nowiki> {{ Short description...</nowiki>}}. While this does create a valid short description, the space will prevent searches for the {{code|<nowiki>{{Short description...</nowiki>}} text.
==Tracking categories==
* {{clc|Templates that generate short descriptions}}
* {{clc|Modules that create a short description}}
* {{clc|Short description matches Wikidata}}
* {{clc|Short description is different from Wikidata}}
* {{clc|Short description with empty Wikidata description}}
== Maintenance categories ==
* {{clc|Pages using short description with unknown parameters}}
* {{clc|Articles with long short description}}
* {{clc|Pages with lower-case short description}}
==See also ==
* {{tlx|Auto short description}}
* {{tlx|Annotated link}}
* {{tlx|laal}} – displays an article's pagelinks alongside its short description
* [[Wikipedia:Short descriptions]] — background information
* [[Wikipedia:WikiProject Short descriptions]] — project to add Short descriptions to all articles
<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
<!-- Category:Articles with short description (maintenance category)? -->
[[Category:Templates that add a tracking category]]
[[Category:Templates that generate short descriptions]]
}}</includeonly>
5de7c025a071fa8a4a8dadbf7245386999fb4ea7
220
175
2023-08-10T14:31:43Z
InsaneX
2
/* Tracking categories */
wikitext
text/x-wiki
{{Documentation subpage}}
{{High risk|all-pages = yes}}
{{Warning|'''Please do not use redirects/shortcuts for this template''', as they cause problems with the [[Wikipedia:Shortdesc helper|short description editing gadget]] and other maintenance tools.}}
{{Lua|Module:Check for unknown parameters|Module:String}}
'''[[Template:Short description]]''' is used to add a [[Wikipedia:Short description|short description]] (which can be edited from within Wikipedia) to a Wikipedia page. These descriptions appear in Wikipedia searches and elsewhere, and help users identify the desired article.
== Usage ==
{{tld|Short description|''Write your short description here''}}
This should be limited to about 40 characters, as explained at [[WP:SDFORMAT]], along with the other guidance at [[WP:SDCONTENT]].
== Parameters ==
{{TemplateData header|noheader=1}}
<templatedata>
{
"description": {
"en": "Creates a short description for a Wikipedia page, which is displayed in search results and other locations.",
"es": "Crea una breve descripción, para un artículo de Wikipedia, que se utiliza en el Editor Visual para proporcionar contexto en los wikilinks (wikienlaces)."
},
"params": {
"1": {
"label": {
"en": "Description",
"es": "Descripción"
},
"description": {
"en": "The short description of the article or 'none'. It should be limited to about 40 characters.",
"es": "La descripción corta del artículo"
},
"example": {
"en": "Chinese encyclopedia writer (1947–2001)",
"es": "La enciclopedia en línea que cualquiera puede editar"
},
"required": true,
"type": "content"
},
"2": {
"label": {
"en": "No replace?",
"es": "2"
},
"description": {
"en": "Should be unused or 'noreplace'. Templates with noreplace will not replace a short description defined by an earlier template. Mainly for use within transcluded templates.",
"es": "Se anula una descripción corta si se transcluye. Debe estar sin usar o con 'noreplace' (que significar no reemplazar)."
},
"example": {
"es": "noreplace"
},
"required": false,
"type": "string",
"autovalue": "noreplace",
"suggestedvalues": [
"noreplace"
]
},
"pagetype": {
"type": "string",
"description": {
"en": "The type of page. This puts it in the appropriate category - Things with short description. Normally unneeded, since handled through namespace detection.",
"es": "El tipo de página. La coloca en la categoría apropiada - Cosas con descripción corta"
},
"example": "Redirect, Disambiguation page",
"required": false
}
},
"format": "{{_|_ = _}}\n"
}
</templatedata>
== About writing good short descriptions ==
This page is about the short description {{em|template}}; it does not provide guidelines for writing a good short description. If you plan to use this template, you should make sure you read and follow the detailed guidance at [[WP:HOWTOSD]]. General information can be found at [[Wikipedia:Short description]].
== Template information ==
Eventually all articles should have a short description:
* by directly using this template, in which case the short description will be unique to the article
* transcluded in another template, such as a disambiguation template, where a generic short description is adequate for a large class of pages
* where the short description is assembled from data in an infobox
Automatically generated descriptions within templates should set the second parameter as {{code|noreplace}} so they do not override any short descriptions specifically added to the transcluding article.
Short descriptions are not normally needed for non-article pages, such as redirects, but can be added if useful.
If the article title alone is sufficient to ensure reliable identification of the desired article, a null value of {{tnull|Short description|none}} may be used.
Short descriptions do not necessarily serve the same function as the Wikidata description for an item and they do not have to be the same, but some overlap is expected in many cases. Some Wikidata descriptions may be unsuitable, and if imported must be checked for relevance, accuracy and fitness for purpose. Responsibility for such imports lies with the importer. {{crossref|(See also [[d:Help:Description|Wikidata:Help:Description]].)}}
=== Example ===
At [[Oxygen therapy]], add the following at the very top of the article, above everything else:
* {{tld|Short description|Use of oxygen as medical treatment}}
== Testing ==
For testing purposes, the display of this template can be enabled by adding a line to your [[Special:MyPage/common.css]]:
* <syntaxhighlight lang="CSS" inline>.shortdescription { display:block !important; }</syntaxhighlight>
This can be easily removed or disabled when testing is finished.
If you want to {{em|always}} see short descriptions, you may prefer a more utilitarian layout, such as:
<syntaxhighlight lang="CSS">
.shortdescription {
display:block !important;
white-space: pre-wrap;
}
.shortdescription::before {
content: "\A[Short description:\0020";
}
.shortdescription::after {
content: "]\A";
}
</syntaxhighlight>
There is a test version of this template available as [[Template:Short description/test]] which displays its text by default.
* {{tld|Short description/test}} displays the short description if supplied
* {{tld|Short description/test}} displays nothing if <code>none</code> is supplied
* {{tld|Short description/test}} displays the description from Wikidata if <code>wikidata</code> is supplied.
Taking {{Q|Q1096878}} as an example:
* <code><nowiki>{{short description/test|Underwater diving where breathing is from equipment independent of the surface}}</nowiki></code> → {{short description/test|Underwater diving where breathing is from equipment independent of the surface }}
* <code><nowiki>{{short description/test|none}}</nowiki></code> → {{short description/test|none}}
* <code><nowiki>{{short description/test|wikidata}}</nowiki></code> → {{short description/test|wikidata|qid=Q1096878}}
===Pagetype parameter===
If {{param|Pagetype}} is '''not''' set, then this template adds the article to a category based on the namespace:
* {{clc|Articles with short description}}
* {{clc|Redirects with short description}} {{--}} for redirects in any namespace
If {{param|Pagetype}} '''is''' set, then this template adds the article to a category matching the parameter. For example:
* {{cl|Redirects with short description}} {{--}} {{code|pagetype {{=}} Redirect }}
{{anchor|No-aliases}}
== Aliases ==
{{shortcut|WP:SDNOALIASES}}
While there are currently <span class="plainlinks">[{{fullurl:Special:WhatLinksHere/Template:Short_description|hidetrans=1&hidelinks=1&limit=500}} redirects to this template]</span>, '''they must not be used''', for the reasons below:
:* Other templates and gadgets attempt to extract short descriptions from pages by explicitly searching for the transclusions of the {{tl|Short description}} template.
:* For example, {{tl|Annotated link}} searches for the template in its uppercase "Short description" and lowercase form "short description".
'''Do not''' start the template with a space: {{code|<nowiki> {{ Short description...</nowiki>}}. While this does create a valid short description, the space will prevent searches for the {{code|<nowiki>{{Short description...</nowiki>}} text.
== Maintenance categories ==
* {{clc|Pages using short description with unknown parameters}}
* {{clc|Articles with long short description}}
* {{clc|Pages with lower-case short description}}
==See also ==
* {{tlx|Auto short description}}
* {{tlx|Annotated link}}
* {{tlx|laal}} – displays an article's pagelinks alongside its short description
* [[Wikipedia:Short descriptions]] — background information
* [[Wikipedia:WikiProject Short descriptions]] — project to add Short descriptions to all articles
<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
<!-- Category:Articles with short description (maintenance category)? -->
[[Category:Templates that add a tracking category]]
[[Category:Templates that generate short descriptions]]
}}</includeonly>
a600dc85316239911f8e37d53a842f6942229d69
221
220
2023-08-10T14:31:55Z
InsaneX
2
/* Maintenance categories */
wikitext
text/x-wiki
{{Documentation subpage}}
{{High risk|all-pages = yes}}
{{Warning|'''Please do not use redirects/shortcuts for this template''', as they cause problems with the [[Wikipedia:Shortdesc helper|short description editing gadget]] and other maintenance tools.}}
{{Lua|Module:Check for unknown parameters|Module:String}}
'''[[Template:Short description]]''' is used to add a [[Wikipedia:Short description|short description]] (which can be edited from within Wikipedia) to a Wikipedia page. These descriptions appear in Wikipedia searches and elsewhere, and help users identify the desired article.
== Usage ==
{{tld|Short description|''Write your short description here''}}
This should be limited to about 40 characters, as explained at [[WP:SDFORMAT]], along with the other guidance at [[WP:SDCONTENT]].
== Parameters ==
{{TemplateData header|noheader=1}}
<templatedata>
{
"description": {
"en": "Creates a short description for a Wikipedia page, which is displayed in search results and other locations.",
"es": "Crea una breve descripción, para un artículo de Wikipedia, que se utiliza en el Editor Visual para proporcionar contexto en los wikilinks (wikienlaces)."
},
"params": {
"1": {
"label": {
"en": "Description",
"es": "Descripción"
},
"description": {
"en": "The short description of the article or 'none'. It should be limited to about 40 characters.",
"es": "La descripción corta del artículo"
},
"example": {
"en": "Chinese encyclopedia writer (1947–2001)",
"es": "La enciclopedia en línea que cualquiera puede editar"
},
"required": true,
"type": "content"
},
"2": {
"label": {
"en": "No replace?",
"es": "2"
},
"description": {
"en": "Should be unused or 'noreplace'. Templates with noreplace will not replace a short description defined by an earlier template. Mainly for use within transcluded templates.",
"es": "Se anula una descripción corta si se transcluye. Debe estar sin usar o con 'noreplace' (que significar no reemplazar)."
},
"example": {
"es": "noreplace"
},
"required": false,
"type": "string",
"autovalue": "noreplace",
"suggestedvalues": [
"noreplace"
]
},
"pagetype": {
"type": "string",
"description": {
"en": "The type of page. This puts it in the appropriate category - Things with short description. Normally unneeded, since handled through namespace detection.",
"es": "El tipo de página. La coloca en la categoría apropiada - Cosas con descripción corta"
},
"example": "Redirect, Disambiguation page",
"required": false
}
},
"format": "{{_|_ = _}}\n"
}
</templatedata>
== About writing good short descriptions ==
This page is about the short description {{em|template}}; it does not provide guidelines for writing a good short description. If you plan to use this template, you should make sure you read and follow the detailed guidance at [[WP:HOWTOSD]]. General information can be found at [[Wikipedia:Short description]].
== Template information ==
Eventually all articles should have a short description:
* by directly using this template, in which case the short description will be unique to the article
* transcluded in another template, such as a disambiguation template, where a generic short description is adequate for a large class of pages
* where the short description is assembled from data in an infobox
Automatically generated descriptions within templates should set the second parameter as {{code|noreplace}} so they do not override any short descriptions specifically added to the transcluding article.
Short descriptions are not normally needed for non-article pages, such as redirects, but can be added if useful.
If the article title alone is sufficient to ensure reliable identification of the desired article, a null value of {{tnull|Short description|none}} may be used.
Short descriptions do not necessarily serve the same function as the Wikidata description for an item and they do not have to be the same, but some overlap is expected in many cases. Some Wikidata descriptions may be unsuitable, and if imported must be checked for relevance, accuracy and fitness for purpose. Responsibility for such imports lies with the importer. {{crossref|(See also [[d:Help:Description|Wikidata:Help:Description]].)}}
=== Example ===
At [[Oxygen therapy]], add the following at the very top of the article, above everything else:
* {{tld|Short description|Use of oxygen as medical treatment}}
== Testing ==
For testing purposes, the display of this template can be enabled by adding a line to your [[Special:MyPage/common.css]]:
* <syntaxhighlight lang="CSS" inline>.shortdescription { display:block !important; }</syntaxhighlight>
This can be easily removed or disabled when testing is finished.
If you want to {{em|always}} see short descriptions, you may prefer a more utilitarian layout, such as:
<syntaxhighlight lang="CSS">
.shortdescription {
display:block !important;
white-space: pre-wrap;
}
.shortdescription::before {
content: "\A[Short description:\0020";
}
.shortdescription::after {
content: "]\A";
}
</syntaxhighlight>
There is a test version of this template available as [[Template:Short description/test]] which displays its text by default.
* {{tld|Short description/test}} displays the short description if supplied
* {{tld|Short description/test}} displays nothing if <code>none</code> is supplied
* {{tld|Short description/test}} displays the description from Wikidata if <code>wikidata</code> is supplied.
Taking {{Q|Q1096878}} as an example:
* <code><nowiki>{{short description/test|Underwater diving where breathing is from equipment independent of the surface}}</nowiki></code> → {{short description/test|Underwater diving where breathing is from equipment independent of the surface }}
* <code><nowiki>{{short description/test|none}}</nowiki></code> → {{short description/test|none}}
* <code><nowiki>{{short description/test|wikidata}}</nowiki></code> → {{short description/test|wikidata|qid=Q1096878}}
===Pagetype parameter===
If {{param|Pagetype}} is '''not''' set, then this template adds the article to a category based on the namespace:
* {{clc|Articles with short description}}
* {{clc|Redirects with short description}} {{--}} for redirects in any namespace
If {{param|Pagetype}} '''is''' set, then this template adds the article to a category matching the parameter. For example:
* {{cl|Redirects with short description}} {{--}} {{code|pagetype {{=}} Redirect }}
{{anchor|No-aliases}}
== Aliases ==
{{shortcut|WP:SDNOALIASES}}
While there are currently <span class="plainlinks">[{{fullurl:Special:WhatLinksHere/Template:Short_description|hidetrans=1&hidelinks=1&limit=500}} redirects to this template]</span>, '''they must not be used''', for the reasons below:
:* Other templates and gadgets attempt to extract short descriptions from pages by explicitly searching for the transclusions of the {{tl|Short description}} template.
:* For example, {{tl|Annotated link}} searches for the template in its uppercase "Short description" and lowercase form "short description".
'''Do not''' start the template with a space: {{code|<nowiki> {{ Short description...</nowiki>}}. While this does create a valid short description, the space will prevent searches for the {{code|<nowiki>{{Short description...</nowiki>}} text.
==See also ==
* {{tlx|Auto short description}}
* {{tlx|Annotated link}}
* {{tlx|laal}} – displays an article's pagelinks alongside its short description
* [[Wikipedia:Short descriptions]] — background information
* [[Wikipedia:WikiProject Short descriptions]] — project to add Short descriptions to all articles
<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
<!-- Category:Articles with short description (maintenance category)? -->
[[Category:Templates that add a tracking category]]
[[Category:Templates that generate short descriptions]]
}}</includeonly>
a7bbaf8a87d39182cb20e42c6ef0a536cb73d3b2
Template:Plainlist/styles.css
10
87
177
176
2023-08-10T14:07:48Z
InsaneX
2
1 revision imported: Importing Short description
text
text/plain
/* {{pp-template|small=yes}} */
.plainlist ol,
.plainlist ul {
line-height: inherit;
list-style: none;
margin: 0;
padding: 0; /* Reset Minerva default */
}
.plainlist ol li,
.plainlist ul li {
margin-bottom: 0;
}
51706efa229ff8794c0d94f260a208e7c5e6ec30
Module:Shortcut/styles.css
828
88
179
178
2023-08-10T14:07:49Z
InsaneX
2
1 revision imported: Importing Short description
text
text/plain
/* {{pp-template}} */
.module-shortcutboxplain {
float: right;
margin: 0 0 0 1em;
border: 1px solid #aaa;
background: #fff;
padding: 0.3em 0.6em 0.2em 0.6em;
text-align: center;
font-size: 85%;
}
.module-shortcutboxleft {
float: left;
margin: 0 1em 0 0;
}
.module-shortcutlist {
display: inline-block;
border-bottom: 1px solid #aaa;
margin-bottom: 0.2em;
}
.module-shortcutboxplain ul {
font-weight: bold;
}
.module-shortcutanchordiv {
position: relative;
top: -3em;
}
li .module-shortcutanchordiv {
float: right; /* IE/Edge in list items */
}
.mbox-imageright .module-shortcutboxplain {
padding: 0.4em 1em 0.4em 1em;
line-height: 1.3;
margin: 0;
}
ccf3877e4b14726147d3b1d8a297fbecacdb2cf8
Umar Edits
0
4
180
13
2023-08-10T14:10:16Z
InsaneX
2
wikitext
text/x-wiki
{{Short description|Umar Edits on TOP}}
'''Umar Edits'''
5403f21e4908e5c077e6043de8e070f9e5d353af
222
180
2023-08-10T14:32:32Z
InsaneX
2
wikitext
text/x-wiki
'''Umar Edits'''
47964e30b13755911c7ca8e108450dfa724f2a86
224
222
2023-08-10T15:15:23Z
InsaneX
2
wikitext
text/x-wiki
{{Infobox Name
|title = Geotuber's Info
|name = John Doe
|country = USA
|channel_link = https://www.youtube.com/user/johndoe
}}
'''Umar Edits'''
741dae5046569f1a41a50c8a8c5aec2d365b1056
225
224
2023-08-10T15:15:52Z
InsaneX
2
wikitext
text/x-wiki
{{Infobox Geotuber
|title = Geotuber's Info
|name = John Doe
|country = USA
|channel_link = https://www.youtube.com/user/johndoe
}}
'''Umar Edits'''
9c4b509139be6f13f54478c5cec8f5b5c20d35e1
Template:SDcat
10
89
182
181
2023-08-10T14:16:19Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:SDcat |setCat}}</includeonly><noinclude>
{{documentation}}
</noinclude>
8c6e8783ddb0dc699d6fb60370db97b73725b9a6
Template:SDcat/doc
10
90
184
183
2023-08-10T14:16:28Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{Documentation subpage}}
{{High risk}}
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{lua|Module:SDcat}}
This template is merely a wrapper for [[Module:SDcat]], which adds tracking categories to articles depending on whether their [[WP:short description|short description]] matches the associated description field on Wikidata. Complete documentation is available at [[Module:SDcat]].
== Usage ==
<code><nowiki>{{SDcat |sd={{{shortdescription|}}} }}</nowiki></code>
=== For testing ===
<code><nowiki>{{SDcat |sd=short description |qid=Wikidata entity ID |lp=link prefix (usually ":") }}</nowiki></code>
<includeonly>{{sandbox other||
<!-- Categories below this line; interwikis at Wikidata -->
[[Category:WikiProject Short descriptions]]
}}</includeonly>
2a2e572b915cc316e39d344979cbca621b80c828
Template:Pagetype
10
91
186
185
2023-08-10T14:17:01Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:pagetype|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
b8e6aa66678cd57877ea2c607372a45070f030a7
Module:Pagetype
828
92
188
187
2023-08-10T14:17:03Z
InsaneX
2
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- --
-- PAGETYPE --
-- --
-- This is a meta-module intended to replace {{pagetype}} and similar --
-- templates. It automatically detects namespaces, and allows for a --
-- great deal of customisation. It can easily be ported to other --
-- wikis by changing the values in the [[Module:Pagetype/config]]. --
-- --
--------------------------------------------------------------------------------
-- Load config.
local cfg = mw.loadData('Module:Pagetype/config')
-- Load required modules.
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local nsDetectModule = require('Module:Namespace detect')
local nsDetect = nsDetectModule._main
local getParamMappings = nsDetectModule.getParamMappings
local getPageObject = nsDetectModule.getPageObject
local p = {}
local function shallowCopy(t)
-- Makes a shallow copy of a table.
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
local function checkPagetypeInput(namespace, val)
-- Checks to see whether we need the default value for the given namespace,
-- and if so gets it from the pagetypes table.
-- The yesno function returns true/false for "yes", "no", etc., and returns
-- val for other input.
local ret = yesno(val, val)
if ret and type(ret) ~= 'string' then
ret = cfg.pagetypes[namespace]
end
return ret
end
local function getPagetypeFromClass(class, param, aliasTable, default)
-- Gets the pagetype from a class specified from the first positional
-- parameter.
param = yesno(param, param)
if param ~= false then -- No check if specifically disallowed.
for _, alias in ipairs(aliasTable) do
if class == alias then
if type(param) == 'string' then
return param
else
return default
end
end
end
end
end
local function getNsDetectValue(args)
-- Builds the arguments to pass to [[Module:Namespace detect]] and returns
-- the result.
-- Get the default values.
local ndArgs = {}
local defaultns = args[cfg.defaultns]
if defaultns == cfg.defaultnsAll then
ndArgs = shallowCopy(cfg.pagetypes)
else
local defaultnsArray
if defaultns == cfg.defaultnsExtended then
defaultnsArray = cfg.extendedNamespaces
elseif defaultns == cfg.defaultnsNone then
defaultnsArray = {}
else
defaultnsArray = cfg.defaultNamespaces
end
for _, namespace in ipairs(defaultnsArray) do
ndArgs[namespace] = cfg.pagetypes[namespace]
end
end
--[[
-- Add custom values passed in from the arguments. These overwrite the
-- defaults. The possible argument names are fetched from
-- Module:Namespace detect automatically in case new namespaces are
-- added. Although we accept namespace aliases as parameters, we only pass
-- the local namespace name as a parameter to Module:Namespace detect.
-- This means that the "image" parameter can overwrite defaults for the
-- File: namespace, which wouldn't work if we passed the parameters through
-- separately.
--]]
local mappings = getParamMappings()
for ns, paramAliases in pairs(mappings) do
-- Copy the aliases table, as # doesn't work with tables returned from
-- mw.loadData.
paramAliases = shallowCopy(paramAliases)
local paramName = paramAliases[1]
-- Iterate backwards along the array so that any values for the local
-- namespace names overwrite those for namespace aliases.
for i = #paramAliases, 1, -1 do
local paramAlias = paramAliases[i]
local ndArg = checkPagetypeInput(paramAlias, args[paramAlias])
if ndArg == false then
-- If any arguments are false, convert them to nil to protect
-- against breakage by future changes to
-- [[Module:Namespace detect]].
ndArgs[paramName] = nil
elseif ndArg then
ndArgs[paramName] = ndArg
end
end
end
-- Check for disambiguation-class and N/A-class pages in mainspace.
if ndArgs.main then
local class = args[1]
if type(class) == 'string' then
-- Put in lower case so e.g. "Dab" and "dab" will both match.
class = mw.ustring.lower(class)
end
local dab = getPagetypeFromClass(
class,
args[cfg.dab],
cfg.dabAliases,
cfg.dabDefault
)
if dab then
ndArgs.main = dab
else
local na = getPagetypeFromClass(
class,
args[cfg.na],
cfg.naAliases,
cfg.naDefault
)
if na then
ndArgs.main = na
end
end
end
-- If there is no talk value specified, use the corresponding subject
-- namespace for talk pages.
if not ndArgs.talk then
ndArgs.subjectns = true
end
-- Add the fallback value. This can also be customised, but it cannot be
-- disabled.
local other = args[cfg.other]
-- We will ignore true/false/nil results from yesno here, but using it
-- anyway for consistency.
other = yesno(other, other)
if type(other) == 'string' then
ndArgs.other = other
else
ndArgs.other = cfg.otherDefault
end
-- Allow custom page values.
ndArgs.page = args.page
return nsDetect(ndArgs)
end
local function detectRedirects(args)
local redirect = args[cfg.redirect]
-- The yesno function returns true/false for "yes", "no", etc., and returns
-- redirect for other input.
redirect = yesno(redirect, redirect)
if redirect == false then
-- Detect redirects unless they have been explicitly disallowed with
-- "redirect=no" or similar.
return
end
local pageObject = getPageObject(args.page)
-- If we are using subject namespaces elsewhere, do so here as well.
if pageObject
and not yesno(args.talk, true)
and args[cfg.defaultns] ~= cfg.defaultnsAll
then
pageObject = getPageObject(
pageObject.subjectNsText .. ':' .. pageObject.text
)
end
-- Allow custom values for redirects.
if pageObject and pageObject.isRedirect then
if type(redirect) == 'string' then
return redirect
else
return cfg.redirectDefault
end
end
end
function p._main(args)
local redirect = detectRedirects(args)
local pagetype = ""
if redirect then
pagetype = redirect
else
pagetype = getNsDetectValue(args)
end
if yesno(args.plural, false) then
if cfg.irregularPlurals[pagetype] then
pagetype = cfg.irregularPlurals[pagetype]
else
pagetype = pagetype .. cfg.plural -- often 's'
end
end
if yesno(args.caps, false) then
pagetype = mw.ustring.upper(mw.ustring.sub(pagetype, 1, 1)) ..
mw.ustring.sub(pagetype, 2)
end
return pagetype
end
function p.main(frame)
local args = getArgs(frame)
return p._main(args)
end
return p
210524e0c60e3354325aea88c508e94423ad228d
Module:Pagetype/config
828
93
190
189
2023-08-10T14:17:03Z
InsaneX
2
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Pagetype configuration data --
-- This page holds localisation and configuration data for Module:Pagetype. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Start configuration data --
--------------------------------------------------------------------------------
-- This table holds the values to use for "main=true", "user=true", etc. Keys to
-- this table should be namespace parameters that can be used with
-- [[Module:Namespace detect]].
cfg.pagetypes = {
['main'] = 'article',
['user'] = 'user page',
['project'] = 'project page',
['wikipedia'] = 'project page',
['wp'] = 'project page',
['file'] = 'file',
['image'] = 'file',
['mediawiki'] = 'interface page',
['template'] = 'template',
['help'] = 'help page',
['category'] = 'category',
['portal'] = 'portal',
['draft'] = 'draft',
['timedtext'] = 'Timed Text page',
['module'] = 'module',
['topic'] = 'topic',
['gadget'] = 'gadget',
['gadget definition'] = 'gadget definition',
['talk'] = 'talk page',
['special'] = 'special page',
['media'] = 'file',
}
-- This table holds the names of the namespaces to be looked up from
-- cfg.pagetypes by default.
cfg.defaultNamespaces = {
'main',
'file',
'template',
'category',
'module'
}
-- This table holds the names of the namespaces to be looked up from
-- cfg.pagetypes if cfg.defaultnsExtended is set.
cfg.extendedNamespaces = {
'main',
'user',
'project',
'file',
'mediawiki',
'template',
'category',
'help',
'portal',
'module',
'draft'
}
-- The parameter name to set which default namespace values to be looked up from
-- cfg.pagetypes.
cfg.defaultns = 'defaultns'
-- The value of cfg.defaultns to set all namespaces, including talk.
cfg.defaultnsAll = 'all'
-- The value of cfg.defaultns to set the namespaces listed in
-- cfg.extendedNamespaces
cfg.defaultnsExtended = 'extended'
-- The value of cfg.defaultns to set no default namespaces.
cfg.defaultnsNone = 'none'
-- The parameter name to use for disambiguation pages page.
cfg.dab = 'dab'
-- This table holds the different possible aliases for disambiguation-class
-- pages. These should be lower-case.
cfg.dabAliases = {
'disambiguation',
'disambig',
'disamb',
'dab'
}
-- The default value for disambiguation pages.
cfg.dabDefault = 'page'
-- The parameter name to use for N/A-class page.
cfg.na = 'na'
-- This table holds the different possible aliases for N/A-class pages. These
-- should be lower-case.
cfg.naAliases = {'na', 'n/a'}
-- The default value for N/A-class pages.
cfg.naDefault = 'page'
-- The parameter name to use for redirects.
cfg.redirect = 'redirect'
-- The default value to use for redirects.
cfg.redirectDefault = 'redirect'
-- The parameter name for undefined namespaces.
cfg.other = 'other'
-- The value used if the module detects an undefined namespace.
cfg.otherDefault = 'page'
-- The usual suffix denoting a plural.
cfg.plural = 's'
-- This table holds plurals not formed by a simple suffix.
cfg.irregularPlurals = {
["category"] = "categories"
}
--------------------------------------------------------------------------------
-- End configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line
e2eb36d6c43611a422bae37947ebeb04b695dcba
Module:Namespace detect
828
94
192
191
2023-08-10T14:17:03Z
InsaneX
2
1 revision imported
Scribunto
text/plain
--[[
--------------------------------------------------------------------------------
-- --
-- NAMESPACE DETECT --
-- --
-- This module implements the {{namespace detect}} template in Lua, with a --
-- few improvements: all namespaces and all namespace aliases are supported, --
-- and namespace names are detected automatically for the local wiki. The --
-- module can also use the corresponding subject namespace value if it is --
-- used on a talk page. Parameter names can be configured for different wikis --
-- by altering the values in the "cfg" table in --
-- Module:Namespace detect/config. --
-- --
--------------------------------------------------------------------------------
--]]
local data = mw.loadData('Module:Namespace detect/data')
local argKeys = data.argKeys
local cfg = data.cfg
local mappings = data.mappings
local yesno = require('Module:Yesno')
local mArguments -- Lazily initialise Module:Arguments
local mTableTools -- Lazily initilalise Module:TableTools
local ustringLower = mw.ustring.lower
local p = {}
local function fetchValue(t1, t2)
-- Fetches a value from the table t1 for the first key in array t2 where
-- a non-nil value of t1 exists.
for i, key in ipairs(t2) do
local value = t1[key]
if value ~= nil then
return value
end
end
return nil
end
local function equalsArrayValue(t, value)
-- Returns true if value equals a value in the array t. Otherwise
-- returns false.
for i, arrayValue in ipairs(t) do
if value == arrayValue then
return true
end
end
return false
end
function p.getPageObject(page)
-- Get the page object, passing the function through pcall in case of
-- errors, e.g. being over the expensive function count limit.
if page then
local success, pageObject = pcall(mw.title.new, page)
if success then
return pageObject
else
return nil
end
else
return mw.title.getCurrentTitle()
end
end
-- Provided for backward compatibility with other modules
function p.getParamMappings()
return mappings
end
local function getNamespace(args)
-- This function gets the namespace name from the page object.
local page = fetchValue(args, argKeys.demopage)
if page == '' then
page = nil
end
local demospace = fetchValue(args, argKeys.demospace)
if demospace == '' then
demospace = nil
end
local subjectns = fetchValue(args, argKeys.subjectns)
local ret
if demospace then
-- Handle "demospace = main" properly.
if equalsArrayValue(argKeys.main, ustringLower(demospace)) then
ret = mw.site.namespaces[0].name
else
ret = demospace
end
else
local pageObject = p.getPageObject(page)
if pageObject then
if pageObject.isTalkPage then
-- Get the subject namespace if the option is set,
-- otherwise use "talk".
if yesno(subjectns) then
ret = mw.site.namespaces[pageObject.namespace].subject.name
else
ret = 'talk'
end
else
ret = pageObject.nsText
end
else
return nil -- return nil if the page object doesn't exist.
end
end
ret = ret:gsub('_', ' ')
return ustringLower(ret)
end
function p._main(args)
-- Check the parameters stored in the mappings table for any matches.
local namespace = getNamespace(args) or 'other' -- "other" avoids nil table keys
local params = mappings[namespace] or {}
local ret = fetchValue(args, params)
--[[
-- If there were no matches, return parameters for other namespaces.
-- This happens if there was no text specified for the namespace that
-- was detected or if the demospace parameter is not a valid
-- namespace. Note that the parameter for the detected namespace must be
-- completely absent for this to happen, not merely blank.
--]]
if ret == nil then
ret = fetchValue(args, argKeys.other)
end
return ret
end
function p.main(frame)
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {removeBlanks = false})
local ret = p._main(args)
return ret or ''
end
function p.table(frame)
--[[
-- Create a wikitable of all subject namespace parameters, for
-- documentation purposes. The talk parameter is optional, in case it
-- needs to be excluded in the documentation.
--]]
-- Load modules and initialise variables.
mTableTools = require('Module:TableTools')
local namespaces = mw.site.namespaces
local cfg = data.cfg
local useTalk = type(frame) == 'table'
and type(frame.args) == 'table'
and yesno(frame.args.talk) -- Whether to use the talk parameter.
-- Get the header names.
local function checkValue(value, default)
if type(value) == 'string' then
return value
else
return default
end
end
local nsHeader = checkValue(cfg.wikitableNamespaceHeader, 'Namespace')
local aliasesHeader = checkValue(cfg.wikitableAliasesHeader, 'Aliases')
-- Put the namespaces in order.
local mappingsOrdered = {}
for nsname, params in pairs(mappings) do
if useTalk or nsname ~= 'talk' then
local nsid = namespaces[nsname].id
-- Add 1, as the array must start with 1; nsid 0 would be lost otherwise.
nsid = nsid + 1
mappingsOrdered[nsid] = params
end
end
mappingsOrdered = mTableTools.compressSparseArray(mappingsOrdered)
-- Build the table.
local ret = '{| class="wikitable"'
.. '\n|-'
.. '\n! ' .. nsHeader
.. '\n! ' .. aliasesHeader
for i, params in ipairs(mappingsOrdered) do
for j, param in ipairs(params) do
if j == 1 then
ret = ret .. '\n|-'
.. '\n| <code>' .. param .. '</code>'
.. '\n| '
elseif j == 2 then
ret = ret .. '<code>' .. param .. '</code>'
else
ret = ret .. ', <code>' .. param .. '</code>'
end
end
end
ret = ret .. '\n|-'
.. '\n|}'
return ret
end
return p
a4757000273064f151f0f22dc0e139092e5ff443
Module:Namespace detect/data
828
95
194
193
2023-08-10T14:17:04Z
InsaneX
2
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect data --
-- This module holds data for [[Module:Namespace detect]] to be loaded per --
-- page, rather than per #invoke, for performance reasons. --
--------------------------------------------------------------------------------
local cfg = require('Module:Namespace detect/config')
local function addKey(t, key, defaultKey)
if key ~= defaultKey then
t[#t + 1] = key
end
end
-- Get a table of parameters to query for each default parameter name.
-- This allows wikis to customise parameter names in the cfg table while
-- ensuring that default parameter names will always work. The cfg table
-- values can be added as a string, or as an array of strings.
local defaultKeys = {
'main',
'talk',
'other',
'subjectns',
'demospace',
'demopage'
}
local argKeys = {}
for i, defaultKey in ipairs(defaultKeys) do
argKeys[defaultKey] = {defaultKey}
end
for defaultKey, t in pairs(argKeys) do
local cfgValue = cfg[defaultKey]
local cfgValueType = type(cfgValue)
if cfgValueType == 'string' then
addKey(t, cfgValue, defaultKey)
elseif cfgValueType == 'table' then
for i, key in ipairs(cfgValue) do
addKey(t, key, defaultKey)
end
end
cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more.
end
local function getParamMappings()
--[[
-- Returns a table of how parameter names map to namespace names. The keys
-- are the actual namespace names, in lower case, and the values are the
-- possible parameter names for that namespace, also in lower case. The
-- table entries are structured like this:
-- {
-- [''] = {'main'},
-- ['wikipedia'] = {'wikipedia', 'project', 'wp'},
-- ...
-- }
--]]
local mappings = {}
local mainNsName = mw.site.subjectNamespaces[0].name
mainNsName = mw.ustring.lower(mainNsName)
mappings[mainNsName] = mw.clone(argKeys.main)
mappings['talk'] = mw.clone(argKeys.talk)
for nsid, ns in pairs(mw.site.subjectNamespaces) do
if nsid ~= 0 then -- Exclude main namespace.
local nsname = mw.ustring.lower(ns.name)
local canonicalName = mw.ustring.lower(ns.canonicalName)
mappings[nsname] = {nsname}
if canonicalName ~= nsname then
table.insert(mappings[nsname], canonicalName)
end
for _, alias in ipairs(ns.aliases) do
table.insert(mappings[nsname], mw.ustring.lower(alias))
end
end
end
return mappings
end
return {
argKeys = argKeys,
cfg = cfg,
mappings = getParamMappings()
}
d224f42a258bc308ef3ad8cc8686cd7a4f47d005
Module:Namespace detect/config
828
96
196
195
2023-08-10T14:17:04Z
InsaneX
2
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect configuration data --
-- --
-- This module stores configuration data for Module:Namespace detect. Here --
-- you can localise the module to your wiki's language. --
-- --
-- To activate a configuration item, you need to uncomment it. This means --
-- that you need to remove the text "-- " at the start of the line. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Parameter names --
-- These configuration items specify custom parameter names. Values added --
-- here will work in addition to the default English parameter names. --
-- To add one extra name, you can use this format: --
-- --
-- cfg.foo = 'parameter name' --
-- --
-- To add multiple names, you can use this format: --
-- --
-- cfg.foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'} --
--------------------------------------------------------------------------------
---- This parameter displays content for the main namespace:
-- cfg.main = 'main'
---- This parameter displays in talk namespaces:
-- cfg.talk = 'talk'
---- This parameter displays content for "other" namespaces (namespaces for which
---- parameters have not been specified):
-- cfg.other = 'other'
---- This parameter makes talk pages behave as though they are the corresponding
---- subject namespace. Note that this parameter is used with [[Module:Yesno]].
---- Edit that module to change the default values of "yes", "no", etc.
-- cfg.subjectns = 'subjectns'
---- This parameter sets a demonstration namespace:
-- cfg.demospace = 'demospace'
---- This parameter sets a specific page to compare:
cfg.demopage = 'page'
--------------------------------------------------------------------------------
-- Table configuration --
-- These configuration items allow customisation of the "table" function, --
-- used to generate a table of possible parameters in the module --
-- documentation. --
--------------------------------------------------------------------------------
---- The header for the namespace column in the wikitable containing the list of
---- possible subject-space parameters.
-- cfg.wikitableNamespaceHeader = 'Namespace'
---- The header for the wikitable containing the list of possible subject-space
---- parameters.
-- cfg.wikitableAliasesHeader = 'Aliases'
--------------------------------------------------------------------------------
-- End of configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line.
0e4ff08d13c4b664d66b32c232deb129b77c1a56
Template:Tick
10
97
198
197
2023-08-10T14:17:08Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
[[{{ safesubst:<noinclude/>#switch:{{ safesubst:<noinclude/>lc:{{{color|{{{colour|}}}}}} }}
|green |grn |gn =File:Yes check.svg
|lightgreen |lgreen |lgrn |lgn =File:Light green check.svg
|red |rd |r =File:Red check.svg
|darkred |dkred |drd |dr =File:Check-188-25-49-red.svg
|pink |pnk |pk =File:Pink check.svg
|orange |or |o =File:Check.svg
|yellow |yel |y =File:Yellow check.svg
|black |blk |k =File:Black check.svg
|blue |blu |u =File:Check-blue.svg
|lightblue |lblue |lblu |lb =File:Cornflower blue check.svg
|cyan |cy |c =File:B-check.svg
|purple |pur |pu =File:Purple check.svg
|grey |gray |gry |gy =File:SemiTransBlack v.svg
|brown |brn |bn =File:Brown check.svg
<!--default--> |File:Yes check.svg
}}|{{ safesubst:<noinclude/>#if:{{{1|}}}|{{Str number/trim|{{{1}}}}}|20}}px|link=|alt={{#if:{{{alt|}}}|{{{alt}}}|check}}]]<span style="display:none">Y</span><!--template:tick--><noinclude>
{{documentation}}
</noinclude>
2a5da56c38689fc7e1a8ccfd7a51892df49d6253
Template:Cross
10
101
206
205
2023-08-10T14:17:10Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Xmark]]
{{Redirect category shell|
{{R from move}}
}}
e97e23c5fb1a53fbf972794777b17b669b615ad4
Template:High use
10
104
212
211
2023-08-10T14:17:15Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
#Redirect [[Template:High-use]]
{{Redirect category shell|{{R from modification}}{{R from template shortcut}}}}
65ce33c8f2d9659b46256ceb1f7fe57859f66fb2
Template:Short description
10
6
219
15
2023-08-10T14:31:24Z
InsaneX
2
wikitext
text/x-wiki
{{#ifeq:{{lc:{{{1|}}}}}|none|<nowiki /><!--Prevents whitespace issues when used with adjacent newlines-->|<div class="shortdescription nomobile noexcerpt noprint searchaux" style="display:none">{{{1|}}}{{SHORTDESC:{{{1|}}}|{{{2|}}}}}</div>}}
<includeonly>
<!-- Commenting out category assignments:
{{#ifeq:{{{pagetype}}}|Disambiguation pages||{{#ifeq:{{pagetype |defaultns = all |user=exclude}}|exclude||{{#ifeq:{{#switch: {{NAMESPACENUMBER}} | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 100 | 101 | 118 | 119 | 828 | 829 | = exclude|#default=}}|exclude||[[Category:{{{pagetype|{{pagetype |defaultns = extended |plural=y}}}}} with short description]]}}}}}}
-->
</includeonly>
<!-- Start tracking -->
<!-- Commenting out category assignments:
{{#invoke:Check for unknown parameters|check|unknown={{Main other|[[Category:Pages using short description with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Short description]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | pagetype | bot |plural }}
-->
<!-- Commenting out category assignments:
{{#ifexpr: {{#invoke:String|len|{{{1|}}}}}>100 | [[Category:{{{pagetype|{{pagetype |defaultns = extended |plural=y}}}}} with long short description]]}}
-->
<includeonly>
<!-- Commenting out category assignments:
{{#if:{{{1|}}}||[[Category:Pages with empty short description]]}}
-->
</includeonly>
<!--
{{Short description/lowercasecheck|{{{1|}}}}}
-->
<!-- Commenting out category assignments:
{{Main other |{{SDcat |sd={{{1|}}} }} }}
-->
<noinclude>
{{Documentation}}
</noinclude>
76ae66d645c9dadb3641230cf413db6f1b7a033b
Template:Infobox Geotuber
10
108
223
2023-08-10T15:14:53Z
InsaneX
2
Created page with "{| class="infobox" |- ! colspan="2" style="text-align:center; background:#B0C4DE;" | {{{title|Default Title}}} |- | '''Name''' || {{{name|}}} |- | '''Country''' || {{{country|}}} |- | '''Channel Link''' || [{{{channel_link|}}} {{{name}}}] |}"
wikitext
text/x-wiki
{| class="infobox"
|-
! colspan="2" style="text-align:center; background:#B0C4DE;" | {{{title|Default Title}}}
|-
| '''Name''' || {{{name|}}}
|-
| '''Country''' || {{{country|}}}
|-
| '''Channel Link''' || [{{{channel_link|}}} {{{name}}}]
|}
03179890e24b3ad1fe33021f52940567bfe9609e
Template:Infobox YouTube personality
10
109
227
226
2023-08-10T15:23:06Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Infobox_YouTube_personality]]
wikitext
text/x-wiki
<includeonly>{{Infobox
| child = {{Yesno|{{{subbox|{{{embed|}}}}}}}}
| templatestyles = Template:Infobox YouTube personality/styles.css
| bodyclass = ib-youtube biography vcard
| title = {{#if:{{Yesno|{{{subbox|{{{embed|}}}}}}}}|<div {{#if:{{Yesno|{{{subbox|}}}}}|class="ib-youtube-title"}}>'''YouTube information'''</div>}}
| aboveclass = ib-youtube-above
| above = {{#if:{{Yesno|{{{subbox|{{{embed|}}}}}}}}||{{br separated entries
|1={{#if:{{{honorific_prefix|{{{honorific prefix|}}}}}}|<span class="honorific-prefix">{{{honorific_prefix|{{{honorific prefix|}}}}}}</span>}}
|2=<span class="fn">{{{name|{{PAGENAMEBASE}}}}}</span>
|3={{#if:{{{honorific_suffix|{{{honorific suffix|}}}}}}|<span class="honorific-suffix">{{{honorific_suffix|{{{honorific suffix|}}}}}}</span>}}
}}
}}
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{logo|}}}|size={{{logo_size|}}}|sizedefault=250px|alt={{{logo_alt|}}}}}
| caption = {{{logo_caption|{{{logo caption|}}}}}}
| image2 = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_size|{{{image size|{{{imagesize|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|{{{upright|1}}}}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
| caption2 = {{{image_caption|{{{caption|{{{image caption|}}}}}}}}}
| headerclass = ib-youtube-header
| header1 = {{#if:{{{birth_name|}}}{{{birth_date|}}}{{{birth_place|}}}{{{death_date|}}}{{{death_place|}}}{{{nationality|}}}{{{occupation|{{{occupations|}}}}}}|Personal information}}
| label2 = Born
| data2 = {{br separated entries|1={{#if:{{{birth_name|}}}|<div class="nickname">{{{birth_name}}}</div>}}|2={{{birth_date|}}}|3={{#if:{{{birth_place|}}}|<div class="birthplace">{{{birth_place|}}}</div>}}}}
| label3 = Died
| data3 = {{br separated entries|1={{{death_date|}}}|2={{#if:{{{death_place|}}}|<div class="deathplace">{{{death_place|}}}</div>}}}}
| label4 = Origin
| data4 = {{{origin|}}}
| label5 = Nationality
| data5 = {{{nationality|}}}
| class5 = category
| label6 = Other names
| data6 = {{{other_names|}}}
| class6 = nickname
| label7 = Education
| data7 = {{{education|}}}
| label8 = Occupation{{#if:{{{occupations|}}}|s|{{Pluralize from text|{{{occupation|}}}|likely=(s)|plural=s}}}}
| data8 = {{{occupation|{{{occupations|}}}}}}
| class8 = role
| label9 = Spouse{{#if:{{{spouses|}}}|s|{{Pluralize from text|{{{spouse|}}}|likely=(s)|plural=s}}}}
| data9 = {{{spouse|{{{spouses|}}}}}}
| label10 = Partner{{#if:{{{partners|}}}|s|{{Pluralize from text|{{{partner|}}}|likely=(s)|plural=s}}}}
| data10 = {{{partner|{{{partners|}}}}}}
| label11 = Children
| data11 = {{{children|}}}
| label12 = Parent{{if either|{{{parents|}}}|{{if both|{{{mother|}}}|{{{father|}}}|true}}|s|{{Pluralize from text|{{{parent|}}}|likely=(s)|plural=s}}}}
| data12 = {{#if:{{{parent|{{{parents|}}}}}}|{{{parent|{{{parents}}}}}}|{{Unbulleted list|{{#if:{{{father|}}}|{{{father}}} (father)}}|{{#if:{{{mother|}}}|{{{mother}}} (mother)}}}}}}
| label13 = Relatives
| data13 = {{{relatives|}}}
| label14 = Organi{{#if:{{{organisation|{{{organisations|}}}}}}|s|z}}ation{{#if:{{{organizations|{{{organisations|}}}}}}|s|{{pluralize from text|{{{organization|{{{organisation|}}}}}}|likely=(s)|plural=s}}}}
| data14 = {{{organization|{{{organisation|{{{organizations|{{{organisations|}}}}}}}}}}}}
| class14 = org
| label15 = Signature
| data15 = {{#invoke:InfoboxImage|InfoboxImage|image={{{signature|}}}|size={{{signature_size|}}}|sizedefault=150px|alt={{{signature_alt|{{{signature alt|}}}}}}}}
| label16 = Website
| data16 = {{{website|{{{homepage|{{{URL|}}}}}}}}}
| data17 = {{{module_personal|}}}
| header20 = {{#if:{{Yesno|{{{subbox|{{{embed|}}}}}}}}||{{#if:{{{pseudonym|}}}{{{channel_name|}}}{{{channel_url|}}}{{{channel_direct_url|}}}{{{channels|}}}{{{years_active|{{{years active|{{{yearsactive|}}}}}}}}}{{{genre|{{{genres|}}}}}}{{#switch:{{#invoke:YouTubeSubscribers|subCountNice}}|-404|-412|-424={{{subscribers|}}}|{{#invoke:YouTubeSubscribers|subCountNice}}}}{{{views|}}}{{{network|}}}{{{associated_acts|}}}|YouTube information}}}}
| label21 = {{Nowrap|Also known as}}
| data21 = {{{pseudonym|}}}
| class21 = nickname
| label22 = Channel{{#if:{{{channels|}}}{{{channel_name2|}}}{{{channel_url2|}}}{{{channel_direct_url2|}}}|s}}
| data22 = {{#if:{{{channel_name|}}}{{{channel_url|}}}{{{channel_direct_url|}}}|{{flatlist|
* [https://www.youtube.com/{{#switch:{{if empty|{{{channel_name|}}}|{{{channel_url|}}}|{{{channel_direct_url|}}}}}|{{{channel_name}}}=user/{{{channel_name}}}|{{{channel_url}}}=channel/{{{channel_url}}}|{{{channel_direct_url}}}}} {{if empty|{{{channel_display_name|}}}|{{{channel_name|}}}|{{{channel_direct_url|}}}|YouTube channel}}]{{#if:{{{channel_name2|}}}{{{channel_url2|}}}{{{channel_direct_url2|}}}|
* [https://www.youtube.com/{{#switch:{{if empty|{{{channel_name2|}}}|{{{channel_url2|}}}|{{{channel_direct_url2|}}}}}|{{{channel_name2}}}=user/{{{channel_name2}}}|{{{channel_url2}}}=channel/{{{channel_url2}}}|{{{channel_direct_url2}}}}} {{if empty|{{{channel_display_name2|}}}|{{{channel_name2|}}}|{{{channel_direct_url2|}}}|YouTube channel}}]{{#if:{{{channel_name3|}}}{{{channel_url3|}}}{{{channel_direct_url3|}}}|
* [https://www.youtube.com/{{#switch:{{if empty|{{{channel_name3|}}}|{{{channel_url3|}}}|{{{channel_direct_url3|}}}}}|{{{channel_name3}}}=user/{{{channel_name3}}}|{{{channel_url3}}}=channel/{{{channel_url3}}}|{{{channel_direct_url3}}}}} {{if empty|{{{channel_display_name3|}}}|{{{channel_name3|}}}|{{{channel_direct_url3|}}}|YouTube channel}}]}} }} }}|{{{channels|}}} }}
| label23 = Created by
| data23 = {{{creator|{{{creators|{{{created_by|}}}}}}}}}
| label24 = Presented by
| data24 = {{{presenter|{{{presenters|{{{presented_by|}}}}}}}}}
| label25 = Location
| data25 = {{{location|}}}
| label26 = Years active
| data26 = {{{years_active|{{{years active|{{{yearsactive|}}}}}}}}}
| label27 = Genre{{#if:{{{genres|}}}|s|{{Pluralize from text|{{{genre|}}}|likely=(s)|plural=s}}}}
| data27 = {{{genre|{{{genres|}}}}}}
| label28 = Subscribers
| data28 = {{#if:{{#switch:{{#invoke:YouTubeSubscribers|subCountNice}}|-404|-412|-424={{{subscribers|}}}|{{#invoke:YouTubeSubscribers|subCountNice}}}}|{{br separated entries|1={{#if:{{{subscribers|}}}|{{{subscribers}}}|{{#switch:{{#invoke:YouTubeSubscribers|subCountNice}}|-404|-412|-424={{main other|[[Category:Pages with YouTubeSubscribers module errors]]}}|{{#invoke:YouTubeSubscribers|subCountNice}}}}}}{{#if:{{{channel_name|}}}{{{channel_url|}}}{{{channel_direct_url|}}}|{{#tag:ref|{{Cite web|title=About {{if empty|{{{channel_display_name|}}}|{{{channel_name|}}}|{{{channel_direct_url|}}}|YouTube channel}}|url=https://www.youtube.com/{{#switch:{{if empty|{{{channel_name|}}}|{{{channel_url|}}}|{{{channel_direct_url|}}}}}|{{{channel_name}}}=user/{{{channel_name}}}|{{{channel_url}}}=channel/{{{channel_url}}}|{{{channel_direct_url}}}}}/about |publisher=[[YouTube]]}}|name="YouTubeStats{{Plain text|{{if empty|{{{channel_display_name|}}}|{{{channel_name|}}}|{{{name|}}}}}}}"}} }}|2={{#if:{{{subscriber_date|}}}|({{{subscriber_date}}})|{{#if:{{{subscribers|}}}||{{#iferror:{{#invoke:YouTubeSubscribers|dateNice}}||({{#invoke:YouTubeSubscribers|dateNice}})}}}}}}}}}}
| label29 = Total views
| data29 = {{#if:{{{views|}}}|{{br separated entries|1={{{views}}}{{if both|{{#switch:{{#invoke:YouTubeSubscribers|subCountNice}}|-404|-412|-424={{{subscribers|}}}|{{#invoke:YouTubeSubscribers|subCountNice}}}}|{{{channel_name|}}}{{{channel_url|}}}{{{channel_direct_url|}}}|{{#tag:ref||name="YouTubeStats{{Plain text|{{if empty|{{{channel_display_name|}}}|{{{channel_name|}}}|{{{name|}}}}}}}"}} }}|2={{#if:{{{view_date|}}}|({{{view_date|}}})}} }} }}
| label30 = [[Multi-channel network|Network]]
| data30 = {{{network|}}}
| label31 = Contents are in
| data31 = {{{language|}}}
| label32 = Associated acts
| data32 = {{{associated_acts|}}}
| label33 = Website
| data33 = {{{channel_website|}}}
| data42 = {{#if:{{{silver_year|}}}{{{silver_button|}}}{{{gold_year|}}}{{{gold_button|}}}{{{diamond_year|}}}{{{diamond_button|}}}{{{ruby_year|}}}{{{ruby_button|}}}{{{red_diamond_year|}}}{{{red_diamond_button|}}}|
<table class="ib-youtube-awards mw-collapsible {{#if:{{Yesno|{{{expand|}}}}}||mw-collapsed}}">
<tr><th colspan="3" {{#if:{{Yesno|{{{embed|}}}}}||class="ib-youtube-awards-color"}}><div>[[YouTube Creator Awards|Creator Awards]]</div></th></tr>
{{If either|{{{silver_year|}}}|{{Yesno|{{{silver_button|}}}}}|then=<tr><td>[[File:YouTube Silver Play Button 2.svg|32px|link=]]</td><td>100,000 subscribers</td><td>{{{silver_year|}}}</td></tr>}}
{{If either|{{{gold_year|}}}|{{Yesno|{{{gold_button|}}}}}|then=<tr><td>[[File:YouTube Gold Play Button 2.svg|32px|link=]]</td><td>1,000,000 subscribers</td><td>{{{gold_year|}}}</td></tr>}}
{{If either|{{{diamond_year|}}}|{{Yesno|{{{diamond_button|}}}}}|then=<tr><td>[[File:YouTube Diamond Play Button.svg|32px|link=]]</td><td>10,000,000 subscribers</td><td>{{{diamond_year|}}}</td></tr>}}
{{If either|{{{ruby_year|}}}|{{Yesno|{{{ruby_button|}}}}}|then=<tr><td>[[File:YouTube Ruby Play Button 2.svg|32px|link=]]</td><td>50,000,000 subscribers</td><td>{{{ruby_year|}}}</td></tr>}}
{{If either|{{{red_diamond_year|}}}|{{Yesno|{{{red_diamond_button|}}}}}|then=<tr><td>[[File:YouTube Red Diamond Play Button.svg|32px|link=]]</td><td>100,000,000 subscribers</td><td>{{{red_diamond_year|}}}</td></tr>}}
</table>}}
| data52 = {{{module|}}}
| belowclass = ib-youtube-below
| below = {{#if:{{{stats_update|}}}|{{hr}}''Last updated:'' {{{stats_update}}}}}{{#if:{{{extra_information|}}}|{{hr}}{{{extra_information}}}}}
}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox YouTube personality with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox YouTube personality]] with unknown parameter "_VALUE_"|ignoreblank=y| alt | associated_acts | birth_date | birth_name | birth_place | caption | channel_name | channel_name2 | channel_name3 | channel_url | channel_url2 | channel_url3 | channel_direct_url | channel_direct_url2 | channel_direct_url3 | channels | channel_display_name | channel_display_name2 | channel_display_name3 | channel_website | children | created_by | creator | creators | father | presented_by | presenter | presenters | death_date | death_place | diamond_button | diamond_year | education | embed | expand | extra_information | genre | genres | gold_button | gold_year | homepage | honorific prefix | honorific suffix | honorific_prefix | honorific_suffix | image | image caption | image size | image_caption | image_size | image_upright | imagesize | language | location | logo | logo caption | logo_caption | logo_alt | logo_size | module | module_personal | mother | name | nationality | network | occupation | occupations | organisation | organisations | organization | organizations | origin | other_names | parent | parents | partner | partners | pseudonym | red_diamond_button | red_diamond_year | relatives | ruby_button | ruby_year | subbox | signature | signature alt | signature_alt | signature_size | silver_button | silver_year | spouse | spouses | stats_update | subscriber_date | subscribers | upright | URL | view_date | views | website | years active | years_active | yearsactive }}</includeonly><noinclude>{{documentation}}</noinclude>
08cd10a16ba44c06a8803113d2bbca0a9127a601
Template:Nowrap
10
110
229
228
2023-08-10T15:23:07Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Nowrap]]
wikitext
text/x-wiki
<span class="nowrap">{{{1}}}</span><noinclude>
{{documentation}}
<!-- Categories go on the /doc page; interwikis go to Wikidata. -->
</noinclude>
5d0dc6b6d89b37f4356242404f46138a4017f015
Module:Citation/CS1
828
111
231
230
2023-08-10T15:23:09Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Citation/CS1]]
Scribunto
text/plain
require('strict');
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
each of these counts against the Lua upvalue limit
]]
local validation; -- functions in Module:Citation/CS1/Date_validation
local utilities; -- functions in Module:Citation/CS1/Utilities
local z = {}; -- table of tables in Module:Citation/CS1/Utilities
local identifiers; -- functions and tables in Module:Citation/CS1/Identifiers
local metadata; -- functions in Module:Citation/CS1/COinS
local cfg = {}; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
local whitelist = {}; -- table of tables listing valid template parameter names; defined in Module:Citation/CS1/Whitelist
--[[------------------< P A G E S C O P E V A R I A B L E S >---------------
declare variables here that have page-wide scope that are not brought in from
other modules; that are created here and used here
]]
local added_deprecated_cat; -- Boolean flag so that the category is added only once
local added_vanc_errs; -- Boolean flag so we only emit one Vancouver error / category
local added_generic_name_errs; -- Boolean flag so we only emit one generic name error / category and stop testing names once an error is encountered
local Frame; -- holds the module's frame table
local is_preview_mode; -- true when article is in preview mode; false when using 'Preview page with this template' (previewing the module)
local is_sandbox; -- true when using sandbox modules to render citation
--[[--------------------------< F I R S T _ S E T >------------------------------------------------------------
Locates and returns the first set value in a table of values where the order established in the table,
left-to-right (or top-to-bottom), is the order in which the values are evaluated. Returns nil if none are set.
This version replaces the original 'for _, val in pairs do' and a similar version that used ipairs. With the pairs
version the order of evaluation could not be guaranteed. With the ipairs version, a nil value would terminate
the for-loop before it reached the actual end of the list.
]]
local function first_set (list, count)
local i = 1;
while i <= count do -- loop through all items in list
if utilities.is_set( list[i] ) then
return list[i]; -- return the first set list member
end
i = i + 1; -- point to next
end
end
--[[--------------------------< A D D _ V A N C _ E R R O R >----------------------------------------------------
Adds a single Vancouver system error message to the template's output regardless of how many error actually exist.
To prevent duplication, added_vanc_errs is nil until an error message is emitted.
added_vanc_errs is a Boolean declared in page scope variables above
]]
local function add_vanc_error (source, position)
if added_vanc_errs then return end
added_vanc_errs = true; -- note that we've added this category
utilities.set_message ('err_vancouver', {source, position});
end
--[[--------------------------< I S _ S C H E M E >------------------------------------------------------------
does this thing that purports to be a URI scheme seem to be a valid scheme? The scheme is checked to see if it
is in agreement with http://tools.ietf.org/html/std66#section-3.1 which says:
Scheme names consist of a sequence of characters beginning with a
letter and followed by any combination of letters, digits, plus
("+"), period ("."), or hyphen ("-").
returns true if it does, else false
]]
local function is_scheme (scheme)
return scheme and scheme:match ('^%a[%a%d%+%.%-]*:'); -- true if scheme is set and matches the pattern
end
--[=[-------------------------< I S _ D O M A I N _ N A M E >--------------------------------------------------
Does this thing that purports to be a domain name seem to be a valid domain name?
Syntax defined here: http://tools.ietf.org/html/rfc1034#section-3.5
BNF defined here: https://tools.ietf.org/html/rfc4234
Single character names are generally reserved; see https://tools.ietf.org/html/draft-ietf-dnsind-iana-dns-01#page-15;
see also [[Single-letter second-level domain]]
list of TLDs: https://www.iana.org/domains/root/db
RFC 952 (modified by RFC 1123) requires the first and last character of a hostname to be a letter or a digit. Between
the first and last characters the name may use letters, digits, and the hyphen.
Also allowed are IPv4 addresses. IPv6 not supported
domain is expected to be stripped of any path so that the last character in the last character of the TLD. tld
is two or more alpha characters. Any preceding '//' (from splitting a URL with a scheme) will be stripped
here. Perhaps not necessary but retained in case it is necessary for IPv4 dot decimal.
There are several tests:
the first character of the whole domain name including subdomains must be a letter or a digit
internationalized domain name (ASCII characters with .xn-- ASCII Compatible Encoding (ACE) prefix xn-- in the TLD) see https://tools.ietf.org/html/rfc3490
single-letter/digit second-level domains in the .org, .cash, and .today TLDs
q, x, and z SL domains in the .com TLD
i and q SL domains in the .net TLD
single-letter SL domains in the ccTLDs (where the ccTLD is two letters)
two-character SL domains in gTLDs (where the gTLD is two or more letters)
three-plus-character SL domains in gTLDs (where the gTLD is two or more letters)
IPv4 dot-decimal address format; TLD not allowed
returns true if domain appears to be a proper name and TLD or IPv4 address, else false
]=]
local function is_domain_name (domain)
if not domain then
return false; -- if not set, abandon
end
domain = domain:gsub ('^//', ''); -- strip '//' from domain name if present; done here so we only have to do it once
if not domain:match ('^[%w]') then -- first character must be letter or digit
return false;
end
if domain:match ('^%a+:') then -- hack to detect things that look like s:Page:Title where Page: is namespace at Wikisource
return false;
end
local patterns = { -- patterns that look like URLs
'%f[%w][%w][%w%-]+[%w]%.%a%a+$', -- three or more character hostname.hostname or hostname.tld
'%f[%w][%w][%w%-]+[%w]%.xn%-%-[%w]+$', -- internationalized domain name with ACE prefix
'%f[%a][qxz]%.com$', -- assigned one character .com hostname (x.com times out 2015-12-10)
'%f[%a][iq]%.net$', -- assigned one character .net hostname (q.net registered but not active 2015-12-10)
'%f[%w][%w]%.%a%a$', -- one character hostname and ccTLD (2 chars)
'%f[%w][%w][%w]%.%a%a+$', -- two character hostname and TLD
'^%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?', -- IPv4 address
}
for _, pattern in ipairs (patterns) do -- loop through the patterns list
if domain:match (pattern) then
return true; -- if a match then we think that this thing that purports to be a URL is a URL
end
end
for _, d in ipairs (cfg.single_letter_2nd_lvl_domains_t) do -- look for single letter second level domain names for these top level domains
if domain:match ('%f[%w][%w]%.' .. d) then
return true
end
end
return false; -- no matches, we don't know what this thing is
end
--[[--------------------------< I S _ U R L >------------------------------------------------------------------
returns true if the scheme and domain parts of a URL appear to be a valid URL; else false.
This function is the last step in the validation process. This function is separate because there are cases that
are not covered by split_url(), for example is_parameter_ext_wikilink() which is looking for bracketted external
wikilinks.
]]
local function is_url (scheme, domain)
if utilities.is_set (scheme) then -- if scheme is set check it and domain
return is_scheme (scheme) and is_domain_name (domain);
else
return is_domain_name (domain); -- scheme not set when URL is protocol-relative
end
end
--[[--------------------------< S P L I T _ U R L >------------------------------------------------------------
Split a URL into a scheme, authority indicator, and domain.
First remove Fully Qualified Domain Name terminator (a dot following TLD) (if any) and any path(/), query(?) or fragment(#).
If protocol-relative URL, return nil scheme and domain else return nil for both scheme and domain.
When not protocol-relative, get scheme, authority indicator, and domain. If there is an authority indicator (one
or more '/' characters immediately following the scheme's colon), make sure that there are only 2.
Any URL that does not have news: scheme must have authority indicator (//). TODO: are there other common schemes
like news: that don't use authority indicator?
Strip off any port and path;
]]
local function split_url (url_str)
local scheme, authority, domain;
url_str = url_str:gsub ('([%a%d])%.?[/%?#].*$', '%1'); -- strip FQDN terminator and path(/), query(?), fragment (#) (the capture prevents false replacement of '//')
if url_str:match ('^//%S*') then -- if there is what appears to be a protocol-relative URL
domain = url_str:match ('^//(%S*)')
elseif url_str:match ('%S-:/*%S+') then -- if there is what appears to be a scheme, optional authority indicator, and domain name
scheme, authority, domain = url_str:match ('(%S-:)(/*)(%S+)'); -- extract the scheme, authority indicator, and domain portions
if utilities.is_set (authority) then
authority = authority:gsub ('//', '', 1); -- replace place 1 pair of '/' with nothing;
if utilities.is_set(authority) then -- if anything left (1 or 3+ '/' where authority should be) then
return scheme; -- return scheme only making domain nil which will cause an error message
end
else
if not scheme:match ('^news:') then -- except for news:..., MediaWiki won't link URLs that do not have authority indicator; TODO: a better way to do this test?
return scheme; -- return scheme only making domain nil which will cause an error message
end
end
domain = domain:gsub ('(%a):%d+', '%1'); -- strip port number if present
end
return scheme, domain;
end
--[[--------------------------< L I N K _ P A R A M _ O K >---------------------------------------------------
checks the content of |title-link=, |series-link=, |author-link=, etc. for properly formatted content: no wikilinks, no URLs
Link parameters are to hold the title of a Wikipedia article, so none of the WP:TITLESPECIALCHARACTERS are allowed:
# < > [ ] | { } _
except the underscore which is used as a space in wiki URLs and # which is used for section links
returns false when the value contains any of these characters.
When there are no illegal characters, this function returns TRUE if value DOES NOT appear to be a valid URL (the
|<param>-link= parameter is ok); else false when value appears to be a valid URL (the |<param>-link= parameter is NOT ok).
]]
local function link_param_ok (value)
local scheme, domain;
if value:find ('[<>%[%]|{}]') then -- if any prohibited characters
return false;
end
scheme, domain = split_url (value); -- get scheme or nil and domain or nil from URL;
return not is_url (scheme, domain); -- return true if value DOES NOT appear to be a valid URL
end
--[[--------------------------< L I N K _ T I T L E _ O K >---------------------------------------------------
Use link_param_ok() to validate |<param>-link= value and its matching |<title>= value.
|<title>= may be wiki-linked but not when |<param>-link= has a value. This function emits an error message when
that condition exists
check <link> for inter-language interwiki-link prefix. prefix must be a MediaWiki-recognized language
code and must begin with a colon.
]]
local function link_title_ok (link, lorig, title, torig)
local orig;
if utilities.is_set (link) then -- don't bother if <param>-link doesn't have a value
if not link_param_ok (link) then -- check |<param>-link= markup
orig = lorig; -- identify the failing link parameter
elseif title:find ('%[%[') then -- check |title= for wikilink markup
orig = torig; -- identify the failing |title= parameter
elseif link:match ('^%a+:') then -- if the link is what looks like an interwiki
local prefix = link:match ('^(%a+):'):lower(); -- get the interwiki prefix
if cfg.inter_wiki_map[prefix] then -- if prefix is in the map, must have preceding colon
orig = lorig; -- flag as error
end
end
end
if utilities.is_set (orig) then
link = ''; -- unset
utilities.set_message ('err_bad_paramlink', orig); -- URL or wikilink in |title= with |title-link=;
end
return link; -- link if ok, empty string else
end
--[[--------------------------< C H E C K _ U R L >------------------------------------------------------------
Determines whether a URL string appears to be valid.
First we test for space characters. If any are found, return false. Then split the URL into scheme and domain
portions, or for protocol-relative (//example.com) URLs, just the domain. Use is_url() to validate the two
portions of the URL. If both are valid, or for protocol-relative if domain is valid, return true, else false.
Because it is different from a standard URL, and because this module used external_link() to make external links
that work for standard and news: links, we validate newsgroup names here. The specification for a newsgroup name
is at https://tools.ietf.org/html/rfc5536#section-3.1.4
]]
local function check_url( url_str )
if nil == url_str:match ("^%S+$") then -- if there are any spaces in |url=value it can't be a proper URL
return false;
end
local scheme, domain;
scheme, domain = split_url (url_str); -- get scheme or nil and domain or nil from URL;
if 'news:' == scheme then -- special case for newsgroups
return domain:match('^[%a%d%+%-_]+%.[%a%d%+%-_%.]*[%a%d%+%-_]$');
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[=[-------------------------< I S _ P A R A M E T E R _ E X T _ W I K I L I N K >----------------------------
Return true if a parameter value has a string that begins and ends with square brackets [ and ] and the first
non-space characters following the opening bracket appear to be a URL. The test will also find external wikilinks
that use protocol-relative URLs. Also finds bare URLs.
The frontier pattern prevents a match on interwiki-links which are similar to scheme:path URLs. The tests that
find bracketed URLs are required because the parameters that call this test (currently |title=, |chapter=, |work=,
and |publisher=) may have wikilinks and there are articles or redirects like '//Hus' so, while uncommon, |title=[[//Hus]]
is possible as might be [[en://Hus]].
]=]
local function is_parameter_ext_wikilink (value)
local scheme, domain;
if value:match ('%f[%[]%[%a%S*:%S+.*%]') then -- if ext. wikilink with scheme and domain: [xxxx://yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(%a%S*:%S+).*%]'));
elseif value:match ('%f[%[]%[//%S+.*%]') then -- if protocol-relative ext. wikilink: [//yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(//%S+).*%]'));
elseif value:match ('%a%S*:%S+') then -- if bare URL with scheme; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(%a%S*:%S+)'));
elseif value:match ('//%S+') then -- if protocol-relative bare URL: //yyyyy.zzz; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(//%S+)')); -- what is left should be the domain
else
return false; -- didn't find anything that is obviously a URL
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[[-------------------------< C H E C K _ F O R _ U R L >-----------------------------------------------------
loop through a list of parameters and their values. Look at the value and if it has an external link, emit an error message.
]]
local function check_for_url (parameter_list, error_list)
for k, v in pairs (parameter_list) do -- for each parameter in the list
if is_parameter_ext_wikilink (v) then -- look at the value; if there is a URL add an error message
table.insert (error_list, utilities.wrap_style ('parameter', k));
end
end
end
--[[--------------------------< S A F E _ F O R _ U R L >------------------------------------------------------
Escape sequences for content that will be used for URL descriptions
]]
local function safe_for_url( str )
if str:match( "%[%[.-%]%]" ) ~= nil then
utilities.set_message ('err_wikilink_in_url', {});
end
return str:gsub( '[%[%]\n]', {
['['] = '[',
[']'] = ']',
['\n'] = ' ' } );
end
--[[--------------------------< E X T E R N A L _ L I N K >----------------------------------------------------
Format an external link with error checking
]]
local function external_link (URL, label, source, access)
local err_msg = '';
local domain;
local path;
local base_url;
if not utilities.is_set (label) then
label = URL;
if utilities.is_set (source) then
utilities.set_message ('err_bare_url_missing_title', {utilities.wrap_style ('parameter', source)});
else
error (cfg.messages["bare_url_no_origin"]); -- programmer error; valid parameter name does not have matching meta-parameter
end
end
if not check_url (URL) then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)});
end
domain, path = URL:match ('^([/%.%-%+:%a%d]+)([/%?#].*)$'); -- split the URL into scheme plus domain and path
if path then -- if there is a path portion
path = path:gsub ('[%[%]]', {['['] = '%5b', [']'] = '%5d'}); -- replace '[' and ']' with their percent-encoded values
URL = table.concat ({domain, path}); -- and reassemble
end
base_url = table.concat ({ "[", URL, " ", safe_for_url (label), "]" }); -- assemble a wiki-markup URL
if utilities.is_set (access) then -- access level (subscription, registration, limited)
base_url = utilities.substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[access].class, cfg.presentation[access].title, base_url}); -- add the appropriate icon
end
return base_url;
end
--[[--------------------------< D E P R E C A T E D _ P A R A M E T E R >--------------------------------------
Categorize and emit an error message when the citation contains one or more deprecated parameters. The function includes the
offending parameter name to the error message. Only one error message is emitted regardless of the number of deprecated
parameters in the citation.
added_deprecated_cat is a Boolean declared in page scope variables above
]]
local function deprecated_parameter(name)
if not added_deprecated_cat then
added_deprecated_cat = true; -- note that we've added this category
utilities.set_message ('err_deprecated_params', {name}); -- add error message
end
end
--[=[-------------------------< K E R N _ Q U O T E S >--------------------------------------------------------
Apply kerning to open the space between the quote mark provided by the module and a leading or trailing quote
mark contained in a |title= or |chapter= parameter's value.
This function will positive kern either single or double quotes:
"'Unkerned title with leading and trailing single quote marks'"
" 'Kerned title with leading and trailing single quote marks' " (in real life the kerning isn't as wide as this example)
Double single quotes (italic or bold wiki-markup) are not kerned.
Replaces Unicode quote marks in plain text or in the label portion of a [[L|D]] style wikilink with typewriter
quote marks regardless of the need for kerning. Unicode quote marks are not replaced in simple [[D]] wikilinks.
Call this function for chapter titles, for website titles, etc.; not for book titles.
]=]
local function kern_quotes (str)
local cap = '';
local wl_type, label, link;
wl_type, label, link = utilities.is_wikilink (str); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
if 1 == wl_type then -- [[D]] simple wikilink with or without quote marks
if mw.ustring.match (str, '%[%[[\"“”\'‘’].+[\"“”\'‘’]%]%]') then -- leading and trailing quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
str = utilities.substitute (cfg.presentation['kern-right'], str);
elseif mw.ustring.match (str, '%[%[[\"“”\'‘’].+%]%]') then -- leading quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
elseif mw.ustring.match (str, '%[%[.+[\"“”\'‘’]%]%]') then -- trailing quote marks
str = utilities.substitute (cfg.presentation['kern-right'], str);
end
else -- plain text or [[L|D]]; text in label variable
label = mw.ustring.gsub (label, '[“”]', '\"'); -- replace “” (U+201C & U+201D) with " (typewriter double quote mark)
label = mw.ustring.gsub (label, '[‘’]', '\''); -- replace ‘’ (U+2018 & U+2019) with ' (typewriter single quote mark)
cap = mw.ustring.match (label, "^([\"\'][^\'].+)"); -- match leading double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-left'], cap);
end
cap = mw.ustring.match (label, "^(.+[^\'][\"\'])$") -- match trailing double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-right'], cap);
end
if 2 == wl_type then
str = utilities.make_wikilink (link, label); -- reassemble the wikilink
else
str = label;
end
end
return str;
end
--[[--------------------------< F O R M A T _ S C R I P T _ V A L U E >----------------------------------------
|script-title= holds title parameters that are not written in Latin-based scripts: Chinese, Japanese, Arabic, Hebrew, etc. These scripts should
not be italicized and may be written right-to-left. The value supplied by |script-title= is concatenated onto Title after Title has been wrapped
in italic markup.
Regardless of language, all values provided by |script-title= are wrapped in <bdi>...</bdi> tags to isolate RTL languages from the English left to right.
|script-title= provides a unique feature. The value in |script-title= may be prefixed with a two-character ISO 639-1 language code and a colon:
|script-title=ja:*** *** (where * represents a Japanese character)
Spaces between the two-character code and the colon and the colon and the first script character are allowed:
|script-title=ja : *** ***
|script-title=ja: *** ***
|script-title=ja :*** ***
Spaces preceding the prefix are allowed: |script-title = ja:*** ***
The prefix is checked for validity. If it is a valid ISO 639-1 language code, the lang attribute (lang="ja") is added to the <bdi> tag so that browsers can
know the language the tag contains. This may help the browser render the script more correctly. If the prefix is invalid, the lang attribute
is not added. At this time there is no error message for this condition.
Supports |script-title=, |script-chapter=, |script-<periodical>=
]]
local function format_script_value (script_value, script_param)
local lang=''; -- initialize to empty string
local name;
if script_value:match('^%l%l%l?%s*:') then -- if first 3 or 4 non-space characters are script language prefix
lang = script_value:match('^(%l%l%l?)%s*:%s*%S.*'); -- get the language prefix or nil if there is no script
if not utilities.is_set (lang) then
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing title part']}); -- prefix without 'title'; add error message
return ''; -- script_value was just the prefix so return empty string
end
-- if we get this far we have prefix and script
name = cfg.lang_code_remap[lang] or mw.language.fetchLanguageName( lang, cfg.this_wiki_code ); -- get language name so that we can use it to categorize
if utilities.is_set (name) then -- is prefix a proper ISO 639-1 language code?
script_value = script_value:gsub ('^%l+%s*:%s*', ''); -- strip prefix from script
-- is prefix one of these language codes?
if utilities.in_array (lang, cfg.script_lang_codes) then
utilities.add_prop_cat ('script', {name, lang})
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['unknown language code']}); -- unknown script-language; add error message
end
lang = ' lang="' .. lang .. '" '; -- convert prefix into a lang attribute
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['invalid language code']}); -- invalid language code; add error message
lang = ''; -- invalid so set lang to empty string
end
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing prefix']}); -- no language code prefix; add error message
end
script_value = utilities.substitute (cfg.presentation['bdi'], {lang, script_value}); -- isolate in case script is RTL
return script_value;
end
--[[--------------------------< S C R I P T _ C O N C A T E N A T E >------------------------------------------
Initially for |title= and |script-title=, this function concatenates those two parameter values after the script
value has been wrapped in <bdi> tags.
]]
local function script_concatenate (title, script, script_param)
if utilities.is_set (script) then
script = format_script_value (script, script_param); -- <bdi> tags, lang attribute, categorization, etc.; returns empty string on error
if utilities.is_set (script) then
title = title .. ' ' .. script; -- concatenate title and script title
end
end
return title;
end
--[[--------------------------< W R A P _ M S G >--------------------------------------------------------------
Applies additional message text to various parameter values. Supplied string is wrapped using a message_list
configuration taking one argument. Supports lower case text for {{citation}} templates. Additional text taken
from citation_config.messages - the reason this function is similar to but separate from wrap_style().
]]
local function wrap_msg (key, str, lower)
if not utilities.is_set ( str ) then
return "";
end
if true == lower then
local msg;
msg = cfg.messages[key]:lower(); -- set the message to lower case before
return utilities.substitute ( msg, str ); -- including template text
else
return utilities.substitute ( cfg.messages[key], str );
end
end
--[[----------------< W I K I S O U R C E _ U R L _ M A K E >-------------------
Makes a Wikisource URL from Wikisource interwiki-link. Returns the URL and appropriate
label; nil else.
str is the value assigned to |chapter= (or aliases) or |title= or |title-link=
]]
local function wikisource_url_make (str)
local wl_type, D, L;
local ws_url, ws_label;
local wikisource_prefix = table.concat ({'https://', cfg.this_wiki_code, '.wikisource.org/wiki/'});
wl_type, D, L = utilities.is_wikilink (str); -- wl_type is 0 (not a wikilink), 1 (simple wikilink), 2 (complex wikilink)
if 0 == wl_type then -- not a wikilink; might be from |title-link=
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 1 == wl_type then -- simple wikilink: [[Wikisource:ws article]]
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 2 == wl_type then -- non-so-simple wikilink: [[Wikisource:ws article|displayed text]] ([[L|D]])
str = L:match ('^[Ww]ikisource:(.+)') or L:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_label = D; -- get ws article name from display portion of interwiki link
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title without namespace from link portion of wikilink
});
end
end
if ws_url then
ws_url = mw.uri.encode (ws_url, 'WIKI'); -- make a usable URL
ws_url = ws_url:gsub ('%%23', '#'); -- undo percent-encoding of fragment marker
end
return ws_url, ws_label, L or D; -- return proper URL or nil and a label or nil
end
--[[----------------< F O R M A T _ P E R I O D I C A L >-----------------------
Format the three periodical parameters: |script-<periodical>=, |<periodical>=,
and |trans-<periodical>= into a single Periodical meta-parameter.
]]
local function format_periodical (script_periodical, script_periodical_source, periodical, trans_periodical)
if not utilities.is_set (periodical) then
periodical = ''; -- to be safe for concatenation
else
periodical = utilities.wrap_style ('italic-title', periodical); -- style
end
periodical = script_concatenate (periodical, script_periodical, script_periodical_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (trans_periodical) then
trans_periodical = utilities.wrap_style ('trans-italic-title', trans_periodical);
if utilities.is_set (periodical) then
periodical = periodical .. ' ' .. trans_periodical;
else -- here when trans-periodical without periodical or script-periodical
periodical = trans_periodical;
utilities.set_message ('err_trans_missing_title', {'periodical'});
end
end
return periodical;
end
--[[------------------< F O R M A T _ C H A P T E R _ T I T L E >---------------
Format the four chapter parameters: |script-chapter=, |chapter=, |trans-chapter=,
and |chapter-url= into a single chapter meta- parameter (chapter_url_source used
for error messages).
]]
local function format_chapter_title (script_chapter, script_chapter_source, chapter, chapter_source, trans_chapter, trans_chapter_source, chapter_url, chapter_url_source, no_quotes, access)
local ws_url, ws_label, L = wikisource_url_make (chapter); -- make a wikisource URL and label from a wikisource interwiki link
if ws_url then
ws_label = ws_label:gsub ('_', ' '); -- replace underscore separators with space characters
chapter = ws_label;
end
if not utilities.is_set (chapter) then
chapter = ''; -- to be safe for concatenation
else
if false == no_quotes then
chapter = kern_quotes (chapter); -- if necessary, separate chapter title's leading and trailing quote marks from module provided quote marks
chapter = utilities.wrap_style ('quoted-title', chapter);
end
end
chapter = script_concatenate (chapter, script_chapter, script_chapter_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (chapter_url) then
chapter = external_link (chapter_url, chapter, chapter_url_source, access); -- adds bare_url_missing_title error if appropriate
elseif ws_url then
chapter = external_link (ws_url, chapter .. ' ', 'ws link in chapter'); -- adds bare_url_missing_title error if appropriate; space char to move icon away from chap text; TODO: better way to do this?
chapter = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, chapter});
end
if utilities.is_set (trans_chapter) then
trans_chapter = utilities.wrap_style ('trans-quoted-title', trans_chapter);
if utilities.is_set (chapter) then
chapter = chapter .. ' ' .. trans_chapter;
else -- here when trans_chapter without chapter or script-chapter
chapter = trans_chapter;
chapter_source = trans_chapter_source:match ('trans%-?(.+)'); -- when no chapter, get matching name from trans-<param>
utilities.set_message ('err_trans_missing_title', {chapter_source});
end
end
return chapter;
end
--[[----------------< H A S _ I N V I S I B L E _ C H A R S >-------------------
This function searches a parameter's value for non-printable or invisible characters.
The search stops at the first match.
This function will detect the visible replacement character when it is part of the Wikisource.
Detects but ignores nowiki and math stripmarkers. Also detects other named stripmarkers
(gallery, math, pre, ref) and identifies them with a slightly different error message.
See also coins_cleanup().
Output of this function is an error message that identifies the character or the
Unicode group, or the stripmarker that was detected along with its position (or,
for multi-byte characters, the position of its first byte) in the parameter value.
]]
local function has_invisible_chars (param, v)
local position = ''; -- position of invisible char or starting position of stripmarker
local capture; -- used by stripmarker detection to hold name of the stripmarker
local stripmarker; -- boolean set true when a stripmarker is found
capture = string.match (v, '[%w%p ]*'); -- test for values that are simple ASCII text and bypass other tests if true
if capture == v then -- if same there are no Unicode characters
return;
end
for _, invisible_char in ipairs (cfg.invisible_chars) do
local char_name = invisible_char[1]; -- the character or group name
local pattern = invisible_char[2]; -- the pattern used to find it
position, _, capture = mw.ustring.find (v, pattern); -- see if the parameter value contains characters that match the pattern
if position and (cfg.invisible_defs.zwj == capture) then -- if we found a zero-width joiner character
if mw.ustring.find (v, cfg.indic_script) then -- it's ok if one of the Indic scripts
position = nil; -- unset position
elseif cfg.emoji_t[mw.ustring.codepoint (v, position+1)] then -- is zwj followed by a character listed in emoji{}?
position = nil; -- unset position
end
end
if position then
if 'nowiki' == capture or 'math' == capture or -- nowiki and math stripmarkers (not an error condition)
('templatestyles' == capture and utilities.in_array (param, {'id', 'quote'})) then -- templatestyles stripmarker allowed in these parameters
stripmarker = true; -- set a flag
elseif true == stripmarker and cfg.invisible_defs.del == capture then -- because stripmakers begin and end with the delete char, assume that we've found one end of a stripmarker
position = nil; -- unset
else
local err_msg;
if capture and not (cfg.invisible_defs.del == capture or cfg.invisible_defs.zwj == capture) then
err_msg = capture .. ' ' .. char_name;
else
err_msg = char_name .. ' ' .. 'character';
end
utilities.set_message ('err_invisible_char', {err_msg, utilities.wrap_style ('parameter', param), position}); -- add error message
return; -- and done with this parameter
end
end
end
end
--[[-------------------< A R G U M E N T _ W R A P P E R >----------------------
Argument wrapper. This function provides support for argument mapping defined
in the configuration file so that multiple names can be transparently aliased to
single internal variable.
]]
local function argument_wrapper ( args )
local origin = {};
return setmetatable({
ORIGIN = function ( self, k )
local dummy = self[k]; -- force the variable to be loaded.
return origin[k];
end
},
{
__index = function ( tbl, k )
if origin[k] ~= nil then
return nil;
end
local args, list, v = args, cfg.aliases[k];
if type( list ) == 'table' then
v, origin[k] = utilities.select_one ( args, list, 'err_redundant_parameters' );
if origin[k] == nil then
origin[k] = ''; -- Empty string, not nil
end
elseif list ~= nil then
v, origin[k] = args[list], list;
else
-- maybe let through instead of raising an error?
-- v, origin[k] = args[k], k;
error( cfg.messages['unknown_argument_map'] .. ': ' .. k);
end
-- Empty strings, not nil;
if v == nil then
v = '';
origin[k] = '';
end
tbl = rawset( tbl, k, v );
return v;
end,
});
end
--[[--------------------------< N O W R A P _ D A T E >-------------------------
When date is YYYY-MM-DD format wrap in nowrap span: <span ...>YYYY-MM-DD</span>.
When date is DD MMMM YYYY or is MMMM DD, YYYY then wrap in nowrap span:
<span ...>DD MMMM</span> YYYY or <span ...>MMMM DD,</span> YYYY
DOES NOT yet support MMMM YYYY or any of the date ranges.
]]
local function nowrap_date (date)
local cap = '';
local cap2 = '';
if date:match("^%d%d%d%d%-%d%d%-%d%d$") then
date = utilities.substitute (cfg.presentation['nowrap1'], date);
elseif date:match("^%a+%s*%d%d?,%s+%d%d%d%d$") or date:match ("^%d%d?%s*%a+%s+%d%d%d%d$") then
cap, cap2 = string.match (date, "^(.*)%s+(%d%d%d%d)$");
date = utilities.substitute (cfg.presentation['nowrap2'], {cap, cap2});
end
return date;
end
--[[--------------------------< S E T _ T I T L E T Y P E >---------------------
This function sets default title types (equivalent to the citation including
|type=<default value>) for those templates that have defaults. Also handles the
special case where it is desirable to omit the title type from the rendered citation
(|type=none).
]]
local function set_titletype (cite_class, title_type)
if utilities.is_set (title_type) then
if 'none' == cfg.keywords_xlate[title_type] then
title_type = ''; -- if |type=none then type parameter not displayed
end
return title_type; -- if |type= has been set to any other value use that value
end
return cfg.title_types [cite_class] or ''; -- set template's default title type; else empty string for concatenation
end
--[[--------------------------< S A F E _ J O I N >-----------------------------
Joins a sequence of strings together while checking for duplicate separation characters.
]]
local function safe_join( tbl, duplicate_char )
local f = {}; -- create a function table appropriate to type of 'duplicate character'
if 1 == #duplicate_char then -- for single byte ASCII characters use the string library functions
f.gsub = string.gsub
f.match = string.match
f.sub = string.sub
else -- for multi-byte characters use the ustring library functions
f.gsub = mw.ustring.gsub
f.match = mw.ustring.match
f.sub = mw.ustring.sub
end
local str = ''; -- the output string
local comp = ''; -- what does 'comp' mean?
local end_chr = '';
local trim;
for _, value in ipairs( tbl ) do
if value == nil then value = ''; end
if str == '' then -- if output string is empty
str = value; -- assign value to it (first time through the loop)
elseif value ~= '' then
if value:sub(1, 1) == '<' then -- special case of values enclosed in spans and other markup.
comp = value:gsub( "%b<>", "" ); -- remove HTML markup (<span>string</span> -> string)
else
comp = value;
end
-- typically duplicate_char is sepc
if f.sub(comp, 1, 1) == duplicate_char then -- is first character same as duplicate_char? why test first character?
-- Because individual string segments often (always?) begin with terminal punct for the
-- preceding segment: 'First element' .. 'sepc next element' .. etc.?
trim = false;
end_chr = f.sub(str, -1, -1); -- get the last character of the output string
-- str = str .. "<HERE(enchr=" .. end_chr .. ")" -- debug stuff?
if end_chr == duplicate_char then -- if same as separator
str = f.sub(str, 1, -2); -- remove it
elseif end_chr == "'" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "''" then -- if last three chars of str are sepc''
str = f.sub(str, 1, -4) .. "''"; -- remove them and add back ''
elseif f.sub(str, -5, -1) == duplicate_char .. "]]''" then -- if last five chars of str are sepc]]''
trim = true; -- why? why do this and next differently from previous?
elseif f.sub(str, -4, -1) == duplicate_char .. "]''" then -- if last four chars of str are sepc]''
trim = true; -- same question
end
elseif end_chr == "]" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "]]" then -- if last three chars of str are sepc]] wikilink
trim = true;
elseif f.sub(str, -3, -1) == duplicate_char .. '"]' then -- if last three chars of str are sepc"] quoted external link
trim = true;
elseif f.sub(str, -2, -1) == duplicate_char .. "]" then -- if last two chars of str are sepc] external link
trim = true;
elseif f.sub(str, -4, -1) == duplicate_char .. "'']" then -- normal case when |url=something & |title=Title.
trim = true;
end
elseif end_chr == " " then -- if last char of output string is a space
if f.sub(str, -2, -1) == duplicate_char .. " " then -- if last two chars of str are <sepc><space>
str = f.sub(str, 1, -3); -- remove them both
end
end
if trim then
if value ~= comp then -- value does not equal comp when value contains HTML markup
local dup2 = duplicate_char;
if f.match(dup2, "%A" ) then dup2 = "%" .. dup2; end -- if duplicate_char not a letter then escape it
value = f.gsub(value, "(%b<>)" .. dup2, "%1", 1 ) -- remove duplicate_char if it follows HTML markup
else
value = f.sub(value, 2, -1 ); -- remove duplicate_char when it is first character
end
end
end
str = str .. value; -- add it to the output string
end
end
return str;
end
--[[--------------------------< I S _ S U F F I X >-----------------------------
returns true if suffix is properly formed Jr, Sr, or ordinal in the range 1–9.
Puncutation not allowed.
]]
local function is_suffix (suffix)
if utilities.in_array (suffix, {'Jr', 'Sr', 'Jnr', 'Snr', '1st', '2nd', '3rd'}) or suffix:match ('^%dth$') then
return true;
end
return false;
end
--[[--------------------< I S _ G O O D _ V A N C _ N A M E >-------------------
For Vancouver style, author/editor names are supposed to be rendered in Latin
(read ASCII) characters. When a name uses characters that contain diacritical
marks, those characters are to be converted to the corresponding Latin
character. When a name is written using a non-Latin alphabet or logogram, that
name is to be transliterated into Latin characters. The module doesn't do this
so editors may/must.
This test allows |first= and |last= names to contain any of the letters defined
in the four Unicode Latin character sets
[http://www.unicode.org/charts/PDF/U0000.pdf C0 Controls and Basic Latin] 0041–005A, 0061–007A
[http://www.unicode.org/charts/PDF/U0080.pdf C1 Controls and Latin-1 Supplement] 00C0–00D6, 00D8–00F6, 00F8–00FF
[http://www.unicode.org/charts/PDF/U0100.pdf Latin Extended-A] 0100–017F
[http://www.unicode.org/charts/PDF/U0180.pdf Latin Extended-B] 0180–01BF, 01C4–024F
|lastn= also allowed to contain hyphens, spaces, and apostrophes.
(http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
|firstn= also allowed to contain hyphens, spaces, apostrophes, and periods
This original test:
if nil == mw.ustring.find (last, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%']*$")
or nil == mw.ustring.find (first, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%'%.]+[2-6%a]*$") then
was written outside of the code editor and pasted here because the code editor
gets confused between character insertion point and cursor position. The test has
been rewritten to use decimal character escape sequence for the individual bytes
of the Unicode characters so that it is not necessary to use an external editor
to maintain this code.
\195\128-\195\150 – À-Ö (U+00C0–U+00D6 – C0 controls)
\195\152-\195\182 – Ø-ö (U+00D8-U+00F6 – C0 controls)
\195\184-\198\191 – ø-ƿ (U+00F8-U+01BF – C0 controls, Latin extended A & B)
\199\132-\201\143 – DŽ-ɏ (U+01C4-U+024F – Latin extended B)
]]
local function is_good_vanc_name (last, first, suffix, position)
if not suffix then
if first:find ('[,%s]') then -- when there is a space or comma, might be first name/initials + generational suffix
first = first:match ('(.-)[,%s]+'); -- get name/initials
suffix = first:match ('[,%s]+(.+)$'); -- get generational suffix
end
end
if utilities.is_set (suffix) then
if not is_suffix (suffix) then
add_vanc_error (cfg.err_msg_supl.suffix, position);
return false; -- not a name with an appropriate suffix
end
end
if nil == mw.ustring.find (last, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%']*$") or
nil == mw.ustring.find (first, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%'%.]*$") then
add_vanc_error (cfg.err_msg_supl['non-Latin char'], position);
return false; -- not a string of Latin characters; Vancouver requires Romanization
end;
return true;
end
--[[--------------------------< R E D U C E _ T O _ I N I T I A L S >------------------------------------------
Attempts to convert names to initials in support of |name-list-style=vanc.
Names in |firstn= may be separated by spaces or hyphens, or for initials, a period.
See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35062/.
Vancouver style requires family rank designations (Jr, II, III, etc.) to be rendered
as Jr, 2nd, 3rd, etc. See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35085/.
This code only accepts and understands generational suffix in the Vancouver format
because Roman numerals look like, and can be mistaken for, initials.
This function uses ustring functions because firstname initials may be any of the
Unicode Latin characters accepted by is_good_vanc_name ().
]]
local function reduce_to_initials(first, position)
local name, suffix = mw.ustring.match(first, "^(%u+) ([%dJS][%drndth]+)$");
if not name then -- if not initials and a suffix
name = mw.ustring.match(first, "^(%u+)$"); -- is it just initials?
end
if name then -- if first is initials with or without suffix
if 3 > mw.ustring.len (name) then -- if one or two initials
if suffix then -- if there is a suffix
if is_suffix (suffix) then -- is it legitimate?
return first; -- one or two initials and a valid suffix so nothing to do
else
add_vanc_error (cfg.err_msg_supl.suffix, position); -- one or two initials with invalid suffix so error message
return first; -- and return first unmolested
end
else
return first; -- one or two initials without suffix; nothing to do
end
end
end -- if here then name has 3 or more uppercase letters so treat them as a word
local initials, names = {}, {}; -- tables to hold name parts and initials
local i = 1; -- counter for number of initials
names = mw.text.split (first, '[%s,]+'); -- split into a table of names and possible suffix
while names[i] do -- loop through the table
if 1 < i and names[i]:match ('[%dJS][%drndth]+%.?$') then -- if not the first name, and looks like a suffix (may have trailing dot)
names[i] = names[i]:gsub ('%.', ''); -- remove terminal dot if present
if is_suffix (names[i]) then -- if a legitimate suffix
table.insert (initials, ' ' .. names[i]); -- add a separator space, insert at end of initials table
break; -- and done because suffix must fall at the end of a name
end -- no error message if not a suffix; possibly because of Romanization
end
if 3 > i then
table.insert (initials, mw.ustring.sub(names[i], 1, 1)); -- insert the initial at end of initials table
end
i = i + 1; -- bump the counter
end
return table.concat(initials) -- Vancouver format does not include spaces.
end
--[[--------------------------< I N T E R W I K I _ P R E F I X E N _ G E T >----------------------------------
extract interwiki prefixen from <value>. Returns two one or two values:
false – no prefixen
nil – prefix exists but not recognized
project prefix, language prefix – when value has either of:
:<project>:<language>:<article>
:<language>:<project>:<article>
project prefix, nil – when <value> has only a known single-letter prefix
nil, language prefix – when <value> has only a known language prefix
accepts single-letter project prefixen: 'd' (wikidata), 's' (wikisource), and 'w' (wikipedia) prefixes; at this
writing, the other single-letter prefixen (b (wikibook), c (commons), m (meta), n (wikinews), q (wikiquote), and
v (wikiversity)) are not supported.
]]
local function interwiki_prefixen_get (value, is_link)
if not value:find (':%l+:') then -- if no prefix
return false; -- abandon; boolean here to distinguish from nil fail returns later
end
local prefix_patterns_linked_t = { -- sequence of valid interwiki and inter project prefixen
'^%[%[:([dsw]):(%l%l+):', -- wikilinked; project and language prefixes
'^%[%[:(%l%l+):([dsw]):', -- wikilinked; language and project prefixes
'^%[%[:([dsw]):', -- wikilinked; project prefix
'^%[%[:(%l%l+):', -- wikilinked; language prefix
}
local prefix_patterns_unlinked_t = { -- sequence of valid interwiki and inter project prefixen
'^:([dsw]):(%l%l+):', -- project and language prefixes
'^:(%l%l+):([dsw]):', -- language and project prefixes
'^:([dsw]):', -- project prefix
'^:(%l%l+):', -- language prefix
}
local cap1, cap2;
for _, pattern in ipairs ((is_link and prefix_patterns_linked_t) or prefix_patterns_unlinked_t) do
cap1, cap2 = value:match (pattern);
if cap1 then
break; -- found a match so stop looking
end
end
if cap1 and cap2 then -- when both then :project:language: or :language:project: (both forms allowed)
if 1 == #cap1 then -- length == 1 then :project:language:
if cfg.inter_wiki_map[cap2] then -- is language prefix in the interwiki map?
return cap1, cap2; -- return interwiki project and interwiki language
end
else -- here when :language:project:
if cfg.inter_wiki_map[cap1] then -- is language prefix in the interwiki map?
return cap2, cap1; -- return interwiki project and interwiki language
end
end
return nil; -- unknown interwiki language
elseif not (cap1 or cap2) then -- both are nil?
return nil; -- we got something that looks like a project prefix but isn't; return fail
elseif 1 == #cap1 then -- here when one capture
return cap1, nil; -- length is 1 so return project, nil language
else -- here when one capture and its length it more than 1
if cfg.inter_wiki_map[cap1] then -- is language prefix in the interwiki map?
return nil, cap1; -- return nil project, language
end
end
end
--[[--------------------------< L I S T _ P E O P L E >--------------------------
Formats a list of people (authors, contributors, editors, interviewers, translators)
names in the list will be linked when
|<name>-link= has a value
|<name>-mask- does NOT have a value; masked names are presumed to have been
rendered previously so should have been linked there
when |<name>-mask=0, the associated name is not rendered
]]
local function list_people (control, people, etal)
local sep;
local namesep;
local format = control.format;
local maximum = control.maximum;
local name_list = {};
if 'vanc' == format then -- Vancouver-like name styling?
sep = cfg.presentation['sep_nl_vanc']; -- name-list separator between names is a comma
namesep = cfg.presentation['sep_name_vanc']; -- last/first separator is a space
else
sep = cfg.presentation['sep_nl']; -- name-list separator between names is a semicolon
namesep = cfg.presentation['sep_name']; -- last/first separator is <comma><space>
end
if sep:sub (-1, -1) ~= " " then sep = sep .. " " end
if utilities.is_set (maximum) and maximum < 1 then return "", 0; end -- returned 0 is for EditorCount; not used for other names
for i, person in ipairs (people) do
if utilities.is_set (person.last) then
local mask = person.mask;
local one;
local sep_one = sep;
if utilities.is_set (maximum) and i > maximum then
etal = true;
break;
end
if mask then
local n = tonumber (mask); -- convert to a number if it can be converted; nil else
if n then
one = 0 ~= n and string.rep("—", n) or nil; -- make a string of (n > 0) mdashes, nil else, to replace name
person.link = nil; -- don't create link to name if name is replaces with mdash string or has been set nil
else
one = mask; -- replace name with mask text (must include name-list separator)
sep_one = " "; -- modify name-list separator
end
else
one = person.last; -- get surname
local first = person.first -- get given name
if utilities.is_set (first) then
if ("vanc" == format) then -- if Vancouver format
one = one:gsub ('%.', ''); -- remove periods from surnames (http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
if not person.corporate and is_good_vanc_name (one, first, nil, i) then -- and name is all Latin characters; corporate authors not tested
first = reduce_to_initials (first, i); -- attempt to convert first name(s) to initials
end
end
one = one .. namesep .. first;
end
end
if utilities.is_set (person.link) then
one = utilities.make_wikilink (person.link, one); -- link author/editor
end
if one then -- if <one> has a value (name, mdash replacement, or mask text replacement)
local proj, tag = interwiki_prefixen_get (one, true); -- get the interwiki prefixen if present
if 'w' == proj and ('Wikipedia' == mw.site.namespaces.Project['name']) then
proj = nil; -- for stuff like :w:de:<article>, :w is unnecessary TODO: maint cat?
end
if proj then
proj = ({['d'] = 'Wikidata', ['s'] = 'Wikisource', ['w'] = 'Wikipedia'})[proj]; -- :w (wikipedia) for linking from a non-wikipedia project
if proj then
one = one .. utilities.wrap_style ('interproj', proj); -- add resized leading space, brackets, static text, language name
tag = nil; -- unset; don't do both project and language
end
end
if tag == cfg.this_wiki_code then
tag = nil; -- stuff like :en:<article> at en.wiki is pointless TODO: maint cat?
end
if tag then
local lang = cfg.lang_code_remap[tag] or cfg.mw_languages_by_tag_t[tag];
if lang then -- error messaging done in extract_names() where we know parameter names
one = one .. utilities.wrap_style ('interwiki', lang); -- add resized leading space, brackets, static text, language name
end
end
table.insert (name_list, one); -- add it to the list of names
table.insert (name_list, sep_one); -- add the proper name-list separator
end
end
end
local count = #name_list / 2; -- (number of names + number of separators) divided by 2
if 0 < count then
if 1 < count and not etal then
if 'amp' == format then
name_list[#name_list-2] = " & "; -- replace last separator with ampersand text
elseif 'and' == format then
if 2 == count then
name_list[#name_list-2] = cfg.presentation.sep_nl_and; -- replace last separator with 'and' text
else
name_list[#name_list-2] = cfg.presentation.sep_nl_end; -- replace last separator with '(sep) and' text
end
end
end
name_list[#name_list] = nil; -- erase the last separator
end
local result = table.concat (name_list); -- construct list
if etal and utilities.is_set (result) then -- etal may be set by |display-authors=etal but we might not have a last-first list
result = result .. sep .. ' ' .. cfg.messages['et al']; -- we've got a last-first list and etal so add et al.
end
return result, count; -- return name-list string and count of number of names (count used for editor names only)
end
--[[--------------------< M A K E _ C I T E R E F _ I D >-----------------------
Generates a CITEREF anchor ID if we have at least one name or a date. Otherwise
returns an empty string.
namelist is one of the contributor-, author-, or editor-name lists chosen in that
order. year is Year or anchor_year.
]]
local function make_citeref_id (namelist, year)
local names={}; -- a table for the one to four names and year
for i,v in ipairs (namelist) do -- loop through the list and take up to the first four last names
names[i] = v.last
if i == 4 then break end -- if four then done
end
table.insert (names, year); -- add the year at the end
local id = table.concat(names); -- concatenate names and year for CITEREF id
if utilities.is_set (id) then -- if concatenation is not an empty string
return "CITEREF" .. id; -- add the CITEREF portion
else
return ''; -- return an empty string; no reason to include CITEREF id in this citation
end
end
--[[--------------------------< C I T E _ C L A S S _A T T R I B U T E _M A K E >------------------------------
construct <cite> tag class attribute for this citation.
<cite_class> – config.CitationClass from calling template
<mode> – value from |mode= parameter
]]
local function cite_class_attribute_make (cite_class, mode)
local class_t = {};
table.insert (class_t, 'citation'); -- required for blue highlight
if 'citation' ~= cite_class then
table.insert (class_t, cite_class); -- identify this template for user css
table.insert (class_t, utilities.is_set (mode) and mode or 'cs1'); -- identify the citation style for user css or javascript
else
table.insert (class_t, utilities.is_set (mode) and mode or 'cs2'); -- identify the citation style for user css or javascript
end
for _, prop_key in ipairs (z.prop_keys_t) do
table.insert (class_t, prop_key); -- identify various properties for user css or javascript
end
return table.concat (class_t, ' '); -- make a big string and done
end
--[[---------------------< N A M E _ H A S _ E T A L >--------------------------
Evaluates the content of name parameters (author, editor, etc.) for variations on
the theme of et al. If found, the et al. is removed, a flag is set to true and
the function returns the modified name and the flag.
This function never sets the flag to false but returns its previous state because
it may have been set by previous passes through this function or by the associated
|display-<names>=etal parameter
]]
local function name_has_etal (name, etal, nocat, param)
if utilities.is_set (name) then -- name can be nil in which case just return
local patterns = cfg.et_al_patterns; -- get patterns from configuration
for _, pattern in ipairs (patterns) do -- loop through all of the patterns
if name:match (pattern) then -- if this 'et al' pattern is found in name
name = name:gsub (pattern, ''); -- remove the offending text
etal = true; -- set flag (may have been set previously here or by |display-<names>=etal)
if not nocat then -- no categorization for |vauthors=
utilities.set_message ('err_etal', {param}); -- and set an error if not added
end
end
end
end
return name, etal;
end
--[[---------------------< N A M E _ I S _ N U M E R I C >----------------------
Add maint cat when name parameter value does not contain letters. Does not catch
mixed alphanumeric names so |last=A. Green (1922-1987) does not get caught in the
current version of this test but |first=(1888) is caught.
returns nothing
]]
local function name_is_numeric (name, list_name)
if utilities.is_set (name) then
if mw.ustring.match (name, '^[%A]+$') then -- when name does not contain any letters
utilities.set_message ('maint_numeric_names', cfg.special_case_translation [list_name]); -- add a maint cat for this template
end
end
end
--[[-----------------< N A M E _ H A S _ M U L T _ N A M E S >------------------
Evaluates the content of last/surname (authors etc.) parameters for multiple names.
Multiple names are indicated if there is more than one comma or any "unescaped"
semicolons. Escaped semicolons are ones used as part of selected HTML entities.
If the condition is met, the function adds the multiple name maintenance category.
returns nothing
]]
local function name_has_mult_names (name, list_name)
local _, commas, semicolons, nbsps;
if utilities.is_set (name) then
_, commas = name:gsub (',', ''); -- count the number of commas
_, semicolons = name:gsub (';', ''); -- count the number of semicolons
-- nbsps probably should be its own separate count rather than merged in
-- some way with semicolons because Lua patterns do not support the
-- grouping operator that regex does, which means there is no way to add
-- more entities to escape except by adding more counts with the new
-- entities
_, nbsps = name:gsub (' ',''); -- count nbsps
-- There is exactly 1 semicolon per entity, so subtract nbsps
-- from semicolons to 'escape' them. If additional entities are added,
-- they also can be subtracted.
if 1 < commas or 0 < (semicolons - nbsps) then
utilities.set_message ('maint_mult_names', cfg.special_case_translation [list_name]); -- add a maint message
end
end
end
--[=[-------------------------< I S _ G E N E R I C >----------------------------------------------------------
Compares values assigned to various parameters according to the string provided as <item> in the function call.
<item> can have on of two values:
'generic_names' – for name-holding parameters: |last=, |first=, |editor-last=, etc
'generic_titles' – for |title=
There are two types of generic tests. The 'accept' tests look for a pattern that should not be rejected by the
'reject' test. For example,
|author=[[John Smith (author)|Smith, John]]
would be rejected by the 'author' reject test. But piped wikilinks with 'author' disambiguation should not be
rejected so the 'accept' test prevents that from happening. Accept tests are always performed before reject
tests.
Each of the 'accept' and 'reject' sequence tables hold tables for en.wiki (['en']) and local.wiki (['local'])
that each can hold a test sequence table The sequence table holds, at index [1], a test pattern, and, at index
[2], a boolean control value. The control value tells string.find() or mw.ustring.find() to do plain-text search (true)
or a pattern search (false). The intent of all this complexity is to make these searches as fast as possible so
that we don't run out of processing time on very large articles.
Returns
true when a reject test finds the pattern or string
false when an accept test finds the pattern or string
nil else
]=]
local function is_generic (item, value, wiki)
local test_val;
local str_lower = { -- use string.lower() for en.wiki (['en']) and use mw.ustring.lower() or local.wiki (['local'])
['en'] = string.lower,
['local'] = mw.ustring.lower,
}
local str_find = { -- use string.find() for en.wiki (['en']) and use mw.ustring.find() or local.wiki (['local'])
['en'] = string.find,
['local'] = mw.ustring.find,
}
local function test (val, test_t, wiki) -- local function to do the testing; <wiki> selects lower() and find() functions
val = test_t[2] and str_lower[wiki](value) or val; -- when <test_t[2]> set to 'true', plaintext search using lowercase value
return str_find[wiki] (val, test_t[1], 1, test_t[2]); -- return nil when not found or matched
end
local test_types_t = {'accept', 'reject'}; -- test accept patterns first, then reject patterns
local wikis_t = {'en', 'local'}; -- do tests for each of these keys; en.wiki first, local.wiki second
for _, test_type in ipairs (test_types_t) do -- for each test type
for _, generic_value in pairs (cfg.special_case_translation[item][test_type]) do -- spin through the list of generic value fragments to accept or reject
for _, wiki in ipairs (wikis_t) do
if generic_value[wiki] then
if test (value, generic_value[wiki], wiki) then -- go do the test
return ('reject' == test_type); -- param value rejected, return true; false else
end
end
end
end
end
end
--[[--------------------------< N A M E _ I S _ G E N E R I C >------------------------------------------------
calls is_generic() to determine if <name> is a 'generic name' listed in cfg.generic_names; <name_alias> is the
parameter name used in error messaging
]]
local function name_is_generic (name, name_alias)
if not added_generic_name_errs and is_generic ('generic_names', name) then
utilities.set_message ('err_generic_name', name_alias); -- set an error message
added_generic_name_errs = true;
end
end
--[[--------------------------< N A M E _ C H E C K S >--------------------------------------------------------
This function calls various name checking functions used to validate the content of the various name-holding parameters.
]]
local function name_checks (last, first, list_name, last_alias, first_alias)
local accept_name;
if utilities.is_set (last) then
last, accept_name = utilities.has_accept_as_written (last); -- remove accept-this-as-written markup when it wraps all of <last>
if not accept_name then -- <last> not wrapped in accept-as-written markup
name_has_mult_names (last, list_name); -- check for multiple names in the parameter (last only)
name_is_numeric (last, list_name); -- check for names that are composed of digits and punctuation
name_is_generic (last, last_alias); -- check for names found in the generic names list
end
end
if utilities.is_set (first) then
first, accept_name = utilities.has_accept_as_written (first); -- remove accept-this-as-written markup when it wraps all of <first>
if not accept_name then -- <first> not wrapped in accept-as-written markup
name_is_numeric (first, list_name); -- check for names that are composed of digits and punctuation
name_is_generic (first, first_alias); -- check for names found in the generic names list
end
local wl_type, D = utilities.is_wikilink (first);
if 0 ~= wl_type then
first = D;
utilities.set_message ('err_bad_paramlink', first_alias);
end
end
return last, first; -- done
end
--[[----------------------< E X T R A C T _ N A M E S >-------------------------
Gets name list from the input arguments
Searches through args in sequential order to find |lastn= and |firstn= parameters
(or their aliases), and their matching link and mask parameters. Stops searching
when both |lastn= and |firstn= are not found in args after two sequential attempts:
found |last1=, |last2=, and |last3= but doesn't find |last4= and |last5= then the
search is done.
This function emits an error message when there is a |firstn= without a matching
|lastn=. When there are 'holes' in the list of last names, |last1= and |last3=
are present but |last2= is missing, an error message is emitted. |lastn= is not
required to have a matching |firstn=.
When an author or editor parameter contains some form of 'et al.', the 'et al.'
is stripped from the parameter and a flag (etal) returned that will cause list_people()
to add the static 'et al.' text from Module:Citation/CS1/Configuration. This keeps
'et al.' out of the template's metadata. When this occurs, an error is emitted.
]]
local function extract_names(args, list_name)
local names = {}; -- table of names
local last; -- individual name components
local first;
local link;
local mask;
local i = 1; -- loop counter/indexer
local n = 1; -- output table indexer
local count = 0; -- used to count the number of times we haven't found a |last= (or alias for authors, |editor-last or alias for editors)
local etal = false; -- return value set to true when we find some form of et al. in an author parameter
local last_alias, first_alias, link_alias; -- selected parameter aliases used in error messaging
while true do
last, last_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'err_redundant_parameters', i ); -- search through args for name components beginning at 1
first, first_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'err_redundant_parameters', i );
link, link_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i );
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
if last then -- error check |lastn= alias for unknown interwiki link prefix; done here because this is where we have the parameter name
local project, language = interwiki_prefixen_get (last, true); -- true because we expect interwiki links in |lastn= to be wikilinked
if nil == project and nil == language then -- when both are nil
utilities.set_message ('err_bad_paramlink', last_alias); -- not known, emit an error message -- TODO: err_bad_interwiki?
last = utilities.remove_wiki_link (last); -- remove wikilink markup; show display value only
end
end
if link then -- error check |linkn= alias for unknown interwiki link prefix
local project, language = interwiki_prefixen_get (link, false); -- false because wiki links in |author-linkn= is an error
if nil == project and nil == language then -- when both are nil
utilities.set_message ('err_bad_paramlink', link_alias); -- not known, emit an error message -- TODO: err_bad_interwiki?
link = nil; -- unset so we don't link
link_alias = nil;
end
end
last, etal = name_has_etal (last, etal, false, last_alias); -- find and remove variations on et al.
first, etal = name_has_etal (first, etal, false, first_alias); -- find and remove variations on et al.
last, first = name_checks (last, first, list_name, last_alias, first_alias); -- multiple names, extraneous annotation, etc. checks
if first and not last then -- if there is a firstn without a matching lastn
local alias = first_alias:find ('given', 1, true) and 'given' or 'first'; -- get first or given form of the alias
utilities.set_message ('err_first_missing_last', {
first_alias, -- param name of alias missing its mate
first_alias:gsub (alias, {['first'] = 'last', ['given'] = 'surname'}), -- make param name appropriate to the alias form
}); -- add this error message
elseif not first and not last then -- if both firstn and lastn aren't found, are we done?
count = count + 1; -- number of times we haven't found last and first
if 2 <= count then -- two missing names and we give up
break; -- normal exit or there is a two-name hole in the list; can't tell which
end
else -- we have last with or without a first
local result;
link = link_title_ok (link, link_alias, last, last_alias); -- check for improper wiki-markup
if first then
link = link_title_ok (link, link_alias, first, first_alias); -- check for improper wiki-markup
end
names[n] = {last = last, first = first, link = link, mask = mask, corporate = false}; -- add this name to our names list (corporate for |vauthors= only)
n = n + 1; -- point to next location in the names table
if 1 == count then -- if the previous name was missing
utilities.set_message ('err_missing_name', {list_name:match ("(%w+)List"):lower(), i - 1}); -- add this error message
end
count = 0; -- reset the counter, we're looking for two consecutive missing names
end
i = i + 1; -- point to next args location
end
return names, etal; -- all done, return our list of names and the etal flag
end
--[[--------------------------< N A M E _ T A G _ G E T >------------------------------------------------------
attempt to decode |language=<lang_param> and return language name and matching tag; nil else.
This function looks for:
<lang_param> as a tag in cfg.lang_code_remap{}
<lang_param> as a name in cfg.lang_name_remap{}
<lang_param> as a name in cfg.mw_languages_by_name_t
<lang_param> as a tag in cfg.mw_languages_by_tag_t
when those fail, presume that <lang_param> is an IETF-like tag that MediaWiki does not recognize. Strip all
script, region, variant, whatever subtags from <lang_param> to leave just a two or three character language tag
and look for the new <lang_param> in cfg.mw_languages_by_tag_t{}
on success, returns name (in properly capitalized form) and matching tag (in lowercase); on failure returns nil
]]
local function name_tag_get (lang_param)
local lang_param_lc = mw.ustring.lower (lang_param); -- use lowercase as an index into the various tables
local name;
local tag;
name = cfg.lang_code_remap[lang_param_lc]; -- assume <lang_param_lc> is a tag; attempt to get remapped language name
if name then -- when <name>, <lang_param> is a tag for a remapped language name
return name, lang_param_lc; -- so return <name> from remap and <lang_param_lc>
end
tag = lang_param_lc:match ('^(%a%a%a?)%-.*'); -- still assuming that <lang_param_lc> is a tag; strip script, region, variant subtags
name = cfg.lang_code_remap[tag]; -- attempt to get remapped language name with language subtag only
if name then -- when <name>, <tag> is a tag for a remapped language name
return name, tag; -- so return <name> from remap and <tag>
end
if cfg.lang_name_remap[lang_param_lc] then -- not a tag, assume <lang_param_lc> is a name; attempt to get remapped language tag
return cfg.lang_name_remap[lang_param_lc][1], cfg.lang_name_remap[lang_param_lc][2]; -- for this <lang_param_lc>, return a (possibly) new name and appropriate tag
end
tag = cfg.mw_languages_by_name_t[lang_param_lc]; -- assume that <lang_param_lc> is a language name; attempt to get its matching tag
if tag then
return cfg.mw_languages_by_tag_t[tag], tag; -- <lang_param_lc> is a name so return the name from the table and <tag>
end
name = cfg.mw_languages_by_tag_t[lang_param_lc]; -- assume that <lang_param_lc> is a tag; attempt to get its matching language name
if name then
return name, lang_param_lc; -- <lang_param_lc> is a tag so return it and <name>
end
tag = lang_param_lc:match ('^(%a%a%a?)%-.*'); -- is <lang_param_lc> an IETF-like tag that MediaWiki doesn't recognize? <tag> gets the language subtag; nil else
if tag then
name = cfg.mw_languages_by_tag_t[tag]; -- attempt to get a language name using the shortened <tag>
if name then
return name, tag; -- <lang_param_lc> is an unrecognized IETF-like tag so return <name> and language subtag
end
end
end
--[[-------------------< L A N G U A G E _ P A R A M E T E R >------------------
Gets language name from a provided two- or three-character ISO 639 code. If a code
is recognized by MediaWiki, use the returned name; if not, then use the value that
was provided with the language parameter.
When |language= contains a recognized language (either code or name), the page is
assigned to the category for that code: Category:Norwegian-language sources (no).
For valid three-character code languages, the page is assigned to the single category
for '639-2' codes: Category:CS1 ISO 639-2 language sources.
Languages that are the same as the local wiki are not categorized. MediaWiki does
not recognize three-character equivalents of two-character codes: code 'ar' is
recognized but code 'ara' is not.
This function supports multiple languages in the form |language=nb, French, th
where the language names or codes are separated from each other by commas with
optional space characters.
]]
local function language_parameter (lang)
local tag; -- some form of IETF-like language tag; language subtag with optional region, sript, vatiant, etc subtags
local lang_subtag; -- ve populates |language= with mostly unecessary region subtags the MediaWiki does not recognize; this is the base language subtag
local name; -- the language name
local language_list = {}; -- table of language names to be rendered
local names_t = {}; -- table made from the value assigned to |language=
local this_wiki_name = mw.language.fetchLanguageName (cfg.this_wiki_code, cfg.this_wiki_code); -- get this wiki's language name
names_t = mw.text.split (lang, '%s*,%s*'); -- names should be a comma separated list
for _, lang in ipairs (names_t) do -- reuse lang here because we don't yet know if lang is a language name or a language tag
name, tag = name_tag_get (lang); -- attempt to get name/tag pair for <lang>; <name> has proper capitalization; <tag> is lowercase
if utilities.is_set (tag) then
lang_subtag = tag:gsub ('^(%a%a%a?)%-.*', '%1'); -- for categorization, strip any IETF-like tags from language tag
if cfg.this_wiki_code ~= lang_subtag then -- when the language is not the same as this wiki's language
if 2 == lang_subtag:len() then -- and is a two-character tag
utilities.add_prop_cat ('foreign-lang-source', {name, tag}, lang_subtag); -- categorize it; tag appended to allow for multiple language categorization
else -- or is a recognized language (but has a three-character tag)
utilities.add_prop_cat ('foreign-lang-source-2', {lang_subtag}, lang_subtag); -- categorize it differently TODO: support multiple three-character tag categories per cs1|2 template?
end
elseif cfg.local_lang_cat_enable then -- when the language and this wiki's language are the same and categorization is enabled
utilities.add_prop_cat ('local-lang-source', {name, lang_subtag}); -- categorize it
end
else
name = lang; -- return whatever <lang> has so that we show something
utilities.set_message ('maint_unknown_lang'); -- add maint category if not already added
end
table.insert (language_list, name);
name = ''; -- so we can reuse it
end
name = utilities.make_sep_list (#language_list, language_list);
if (1 == #language_list) and (lang_subtag == cfg.this_wiki_code) then -- when only one language, find lang name in this wiki lang name; for |language=en-us, 'English' in 'American English'
return ''; -- if one language and that language is this wiki's return an empty string (no annotation)
end
return (" " .. wrap_msg ('language', name)); -- otherwise wrap with '(in ...)'
--[[ TODO: should only return blank or name rather than full list
so we can clean up the bunched parenthetical elements Language, Type, Format
]]
end
--[[-----------------------< S E T _ C S _ S T Y L E >--------------------------
Gets the default CS style configuration for the given mode.
Returns default separator and either postscript as passed in or the default.
In CS1, the default postscript and separator are '.'.
In CS2, the default postscript is the empty string and the default separator is ','.
]]
local function set_cs_style (postscript, mode)
if utilities.is_set(postscript) then
-- emit a maintenance message if user postscript is the default cs1 postscript
-- we catch the opposite case for cs2 in set_style
if mode == 'cs1' and postscript == cfg.presentation['ps_' .. mode] then
utilities.set_message ('maint_postscript');
end
else
postscript = cfg.presentation['ps_' .. mode];
end
return cfg.presentation['sep_' .. mode], postscript;
end
--[[--------------------------< S E T _ S T Y L E >-----------------------------
Sets the separator and postscript styles. Checks the |mode= first and the
#invoke CitationClass second. Removes the postscript if postscript == none.
]]
local function set_style (mode, postscript, cite_class)
local sep;
if 'cs2' == mode then
sep, postscript = set_cs_style (postscript, 'cs2');
elseif 'cs1' == mode then
sep, postscript = set_cs_style (postscript, 'cs1');
elseif 'citation' == cite_class then
sep, postscript = set_cs_style (postscript, 'cs2');
else
sep, postscript = set_cs_style (postscript, 'cs1');
end
if cfg.keywords_xlate[postscript:lower()] == 'none' then
-- emit a maintenance message if user postscript is the default cs2 postscript
-- we catch the opposite case for cs1 in set_cs_style
if 'cs2' == mode or 'citation' == cite_class then
utilities.set_message ('maint_postscript');
end
postscript = '';
end
return sep, postscript
end
--[=[-------------------------< I S _ P D F >-----------------------------------
Determines if a URL has the file extension that is one of the PDF file extensions
used by [[MediaWiki:Common.css]] when applying the PDF icon to external links.
returns true if file extension is one of the recognized extensions, else false
]=]
local function is_pdf (url)
return url:match ('%.pdf$') or url:match ('%.PDF$') or
url:match ('%.pdf[%?#]') or url:match ('%.PDF[%?#]') or
url:match ('%.PDF#') or url:match ('%.pdf#');
end
--[[--------------------------< S T Y L E _ F O R M A T >-----------------------
Applies CSS style to |format=, |chapter-format=, etc. Also emits an error message
if the format parameter does not have a matching URL parameter. If the format parameter
is not set and the URL contains a file extension that is recognized as a PDF document
by MediaWiki's commons.css, this code will set the format parameter to (PDF) with
the appropriate styling.
]]
local function style_format (format, url, fmt_param, url_param)
if utilities.is_set (format) then
format = utilities.wrap_style ('format', format); -- add leading space, parentheses, resize
if not utilities.is_set (url) then
utilities.set_message ('err_format_missing_url', {fmt_param, url_param}); -- add an error message
end
elseif is_pdf (url) then -- format is not set so if URL is a PDF file then
format = utilities.wrap_style ('format', 'PDF'); -- set format to PDF
else
format = ''; -- empty string for concatenation
end
return format;
end
--[[---------------------< G E T _ D I S P L A Y _ N A M E S >------------------
Returns a number that defines the number of names displayed for author and editor
name lists and a Boolean flag to indicate when et al. should be appended to the name list.
When the value assigned to |display-xxxxors= is a number greater than or equal to zero,
return the number and the previous state of the 'etal' flag (false by default
but may have been set to true if the name list contains some variant of the text 'et al.').
When the value assigned to |display-xxxxors= is the keyword 'etal', return a number
that is one greater than the number of authors in the list and set the 'etal' flag true.
This will cause the list_people() to display all of the names in the name list followed by 'et al.'
In all other cases, returns nil and the previous state of the 'etal' flag.
inputs:
max: A['DisplayAuthors'] or A['DisplayEditors']; a number or some flavor of etal
count: #a or #e
list_name: 'authors' or 'editors'
etal: author_etal or editor_etal
]]
local function get_display_names (max, count, list_name, etal, param)
if utilities.is_set (max) then
if 'etal' == max:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings
max = count + 1; -- number of authors + 1 so display all author name plus et al.
etal = true; -- overrides value set by extract_names()
elseif max:match ('^%d+$') then -- if is a string of numbers
max = tonumber (max); -- make it a number
if max >= count then -- if |display-xxxxors= value greater than or equal to number of authors/editors
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil;
end
else -- not a valid keyword or number
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil; -- unset; as if |display-xxxxors= had not been set
end
end
return max, etal;
end
--[[----------< E X T R A _ T E X T _ I N _ P A G E _ C H E C K >---------------
Adds error if |page=, |pages=, |quote-page=, |quote-pages= has what appears to be
some form of p. or pp. abbreviation in the first characters of the parameter content.
check page for extraneous p, p., pp, pp., pg, pg. at start of parameter value:
good pattern: '^P[^%.P%l]' matches when page begins PX or P# but not Px
where x and X are letters and # is a digit
bad pattern: '^[Pp][PpGg]' matches when page begins pp, pP, Pp, PP, pg, pG, Pg, PG
]]
local function extra_text_in_page_check (val, name)
if not val:match (cfg.vol_iss_pg_patterns.good_ppattern) then
for _, pattern in ipairs (cfg.vol_iss_pg_patterns.bad_ppatterns) do -- spin through the selected sequence table of patterns
if val:match (pattern) then -- when a match, error so
utilities.set_message ('err_extra_text_pages', name); -- add error message
return; -- and done
end
end
end
end
--[[--------------------------< E X T R A _ T E X T _ I N _ V O L _ I S S _ C H E C K >------------------------
Adds error if |volume= or |issue= has what appears to be some form of redundant 'type' indicator.
For |volume=:
'V.', or 'Vol.' (with or without the dot) abbreviations or 'Volume' in the first characters of the parameter
content (all case insensitive). 'V' and 'v' (without the dot) are presumed to be roman numerals so
are allowed.
For |issue=:
'No.', 'I.', 'Iss.' (with or without the dot) abbreviations, or 'Issue' in the first characters of the
parameter content (all case insensitive).
Single character values ('v', 'i', 'n') allowed when not followed by separator character ('.', ':', '=', or
whitespace character) – param values are trimmed of whitespace by MediaWiki before delivered to the module.
<val> is |volume= or |issue= parameter value
<name> is |volume= or |issue= parameter name for error message
<selector> is 'v' for |volume=, 'i' for |issue=
sets error message on failure; returns nothing
]]
local function extra_text_in_vol_iss_check (val, name, selector)
if not utilities.is_set (val) then
return;
end
local patterns = 'v' == selector and cfg.vol_iss_pg_patterns.vpatterns or cfg.vol_iss_pg_patterns.ipatterns;
local handler = 'v' == selector and 'err_extra_text_volume' or 'err_extra_text_issue';
val = val:lower(); -- force parameter value to lower case
for _, pattern in ipairs (patterns) do -- spin through the selected sequence table of patterns
if val:match (pattern) then -- when a match, error so
utilities.set_message (handler, name); -- add error message
return; -- and done
end
end
end
--[=[-------------------------< G E T _ V _ N A M E _ T A B L E >----------------------------------------------
split apart a |vauthors= or |veditors= parameter. This function allows for corporate names, wrapped in doubled
parentheses to also have commas; in the old version of the code, the doubled parentheses were included in the
rendered citation and in the metadata. Individual author names may be wikilinked
|vauthors=Jones AB, [[E. B. White|White EB]], ((Black, Brown, and Co.))
]=]
local function get_v_name_table (vparam, output_table, output_link_table)
local name_table = mw.text.split(vparam, "%s*,%s*"); -- names are separated by commas
local wl_type, label, link; -- wl_type not used here; just a placeholder
local i = 1;
while name_table[i] do
if name_table[i]:match ('^%(%(.*[^%)][^%)]$') then -- first segment of corporate with one or more commas; this segment has the opening doubled parentheses
local name = name_table[i];
i = i + 1; -- bump indexer to next segment
while name_table[i] do
name = name .. ', ' .. name_table[i]; -- concatenate with previous segments
if name_table[i]:match ('^.*%)%)$') then -- if this table member has the closing doubled parentheses
break; -- and done reassembling so
end
i = i + 1; -- bump indexer
end
table.insert (output_table, name); -- and add corporate name to the output table
table.insert (output_link_table, ''); -- no wikilink
else
wl_type, label, link = utilities.is_wikilink (name_table[i]); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
table.insert (output_table, label); -- add this name
if 1 == wl_type then
table.insert (output_link_table, label); -- simple wikilink [[D]]
else
table.insert (output_link_table, link); -- no wikilink or [[L|D]]; add this link if there is one, else empty string
end
end
i = i + 1;
end
return output_table;
end
--[[--------------------------< P A R S E _ V A U T H O R S _ V E D I T O R S >--------------------------------
This function extracts author / editor names from |vauthors= or |veditors= and finds matching |xxxxor-maskn= and
|xxxxor-linkn= in args. It then returns a table of assembled names just as extract_names() does.
Author / editor names in |vauthors= or |veditors= must be in Vancouver system style. Corporate or institutional names
may sometimes be required and because such names will often fail the is_good_vanc_name() and other format compliance
tests, are wrapped in doubled parentheses ((corporate name)) to suppress the format tests.
Supports generational suffixes Jr, 2nd, 3rd, 4th–6th.
This function sets the Vancouver error when a required comma is missing and when there is a space between an author's initials.
]]
local function parse_vauthors_veditors (args, vparam, list_name)
local names = {}; -- table of names assembled from |vauthors=, |author-maskn=, |author-linkn=
local v_name_table = {};
local v_link_table = {}; -- when name is wikilinked, targets go in this table
local etal = false; -- return value set to true when we find some form of et al. vauthors parameter
local last, first, link, mask, suffix;
local corporate = false;
vparam, etal = name_has_etal (vparam, etal, true); -- find and remove variations on et al. do not categorize (do it here because et al. might have a period)
v_name_table = get_v_name_table (vparam, v_name_table, v_link_table); -- names are separated by commas
for i, v_name in ipairs(v_name_table) do
first = ''; -- set to empty string for concatenation and because it may have been set for previous author/editor
local accept_name;
v_name, accept_name = utilities.has_accept_as_written (v_name); -- remove accept-this-as-written markup when it wraps all of <v_name>
if accept_name then
last = v_name;
corporate = true; -- flag used in list_people()
elseif string.find(v_name, "%s") then
if v_name:find('[;%.]') then -- look for commonly occurring punctuation characters;
add_vanc_error (cfg.err_msg_supl.punctuation, i);
end
local lastfirstTable = {}
lastfirstTable = mw.text.split(v_name, "%s+")
first = table.remove(lastfirstTable); -- removes and returns value of last element in table which should be initials or generational suffix
if not mw.ustring.match (first, '^%u+$') then -- mw.ustring here so that later we will catch non-Latin characters
suffix = first; -- not initials so assume that whatever we got is a generational suffix
first = table.remove(lastfirstTable); -- get what should be the initials from the table
end
last = table.concat(lastfirstTable, ' ') -- returns a string that is the concatenation of all other names that are not initials and generational suffix
if not utilities.is_set (last) then
first = ''; -- unset
last = v_name; -- last empty because something wrong with first
add_vanc_error (cfg.err_msg_supl.name, i);
end
if mw.ustring.match (last, '%a+%s+%u+%s+%a+') then
add_vanc_error (cfg.err_msg_supl['missing comma'], i); -- matches last II last; the case when a comma is missing
end
if mw.ustring.match (v_name, ' %u %u$') then -- this test is in the wrong place TODO: move or replace with a more appropriate test
add_vanc_error (cfg.err_msg_supl.initials, i); -- matches a space between two initials
end
else
last = v_name; -- last name or single corporate name? Doesn't support multiword corporate names? do we need this?
end
if utilities.is_set (first) then
if not mw.ustring.match (first, "^%u?%u$") then -- first shall contain one or two upper-case letters, nothing else
add_vanc_error (cfg.err_msg_supl.initials, i); -- too many initials; mixed case initials (which may be ok Romanization); hyphenated initials
end
is_good_vanc_name (last, first, suffix, i); -- check first and last before restoring the suffix which may have a non-Latin digit
if utilities.is_set (suffix) then
first = first .. ' ' .. suffix; -- if there was a suffix concatenate with the initials
suffix = ''; -- unset so we don't add this suffix to all subsequent names
end
else
if not corporate then
is_good_vanc_name (last, '', nil, i);
end
end
link = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i ) or v_link_table[i];
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
names[i] = {last = last, first = first, link = link, mask = mask, corporate = corporate}; -- add this assembled name to our names list
end
return names, etal; -- all done, return our list of names
end
--[[--------------------------< S E L E C T _ A U T H O R _ E D I T O R _ S O U R C E >------------------------
Select one of |authors=, |authorn= / |lastn / firstn=, or |vauthors= as the source of the author name list or
select one of |editorn= / editor-lastn= / |editor-firstn= or |veditors= as the source of the editor name list.
Only one of these appropriate three will be used. The hierarchy is: |authorn= (and aliases) highest and |authors= lowest;
|editorn= (and aliases) highest and |veditors= lowest (support for |editors= withdrawn)
When looking for |authorn= / |editorn= parameters, test |xxxxor1= and |xxxxor2= (and all of their aliases); stops after the second
test which mimicks the test used in extract_names() when looking for a hole in the author name list. There may be a better
way to do this, I just haven't discovered what that way is.
Emits an error message when more than one xxxxor name source is provided.
In this function, vxxxxors = vauthors or veditors; xxxxors = authors as appropriate.
]]
local function select_author_editor_source (vxxxxors, xxxxors, args, list_name)
local lastfirst = false;
if utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 1 ) or -- do this twice in case we have a |first1= without a |last1=; this ...
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 1 ) or -- ... also catches the case where |first= is used with |vauthors=
utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 2 ) or
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 2 ) then
lastfirst = true;
end
if (utilities.is_set (vxxxxors) and true == lastfirst) or -- these are the three error conditions
(utilities.is_set (vxxxxors) and utilities.is_set (xxxxors)) or
(true == lastfirst and utilities.is_set (xxxxors)) then
local err_name;
if 'AuthorList' == list_name then -- figure out which name should be used in error message
err_name = 'author';
else
err_name = 'editor';
end
utilities.set_message ('err_redundant_parameters', err_name .. '-name-list parameters'); -- add error message
end
if true == lastfirst then return 1 end; -- return a number indicating which author name source to use
if utilities.is_set (vxxxxors) then return 2 end;
if utilities.is_set (xxxxors) then return 3 end;
return 1; -- no authors so return 1; this allows missing author name test to run in case there is a first without last
end
--[[--------------------------< I S _ V A L I D _ P A R A M E T E R _ V A L U E >------------------------------
This function is used to validate a parameter's assigned value for those parameters that have only a limited number
of allowable values (yes, y, true, live, dead, etc.). When the parameter value has not been assigned a value (missing
or empty in the source template) the function returns the value specified by ret_val. If the parameter value is one
of the list of allowed values returns the translated value; else, emits an error message and returns the value
specified by ret_val.
TODO: explain <invert>
]]
local function is_valid_parameter_value (value, name, possible, ret_val, invert)
if not utilities.is_set (value) then
return ret_val; -- an empty parameter is ok
end
if (not invert and utilities.in_array (value, possible)) then -- normal; <value> is in <possible> table
return cfg.keywords_xlate[value]; -- return translation of parameter keyword
elseif invert and not utilities.in_array (value, possible) then -- invert; <value> is not in <possible> table
return value; -- return <value> as it is
else
utilities.set_message ('err_invalid_param_val', {name, value}); -- not an allowed value so add error message
return ret_val;
end
end
--[[--------------------------< T E R M I N A T E _ N A M E _ L I S T >----------------------------------------
This function terminates a name list (author, contributor, editor) with a separator character (sepc) and a space
when the last character is not a sepc character or when the last three characters are not sepc followed by two
closing square brackets (close of a wikilink). When either of these is true, the name_list is terminated with a
single space character.
]]
local function terminate_name_list (name_list, sepc)
if (string.sub (name_list, -3, -1) == sepc .. '. ') then -- if already properly terminated
return name_list; -- just return the name list
elseif (string.sub (name_list, -1, -1) == sepc) or (string.sub (name_list, -3, -1) == sepc .. ']]') then -- if last name in list ends with sepc char
return name_list .. " "; -- don't add another
else
return name_list .. sepc .. ' '; -- otherwise terminate the name list
end
end
--[[-------------------------< F O R M A T _ V O L U M E _ I S S U E >-----------------------------------------
returns the concatenation of the formatted volume and issue (or journal article number) parameters as a single
string; or formatted volume or formatted issue, or an empty string if neither are set.
]]
local function format_volume_issue (volume, issue, article, cite_class, origin, sepc, lower)
if not utilities.is_set (volume) and not utilities.is_set (issue) and not utilities.is_set (article) then
return '';
end
-- same condition as in format_pages_sheets()
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
local is_numeric_vol = volume and (volume:match ('^[MDCLXVI]+$') or volume:match ('^%d+$')); -- is only uppercase roman numerals or only digits?
local is_long_vol = volume and (4 < mw.ustring.len(volume)); -- is |volume= value longer than 4 characters?
if volume and (not is_numeric_vol and is_long_vol) then -- when not all digits or Roman numerals, is |volume= longer than 4 characters?
utilities.add_prop_cat ('long-vol'); -- yes, add properties cat
end
if is_journal then -- journal-style formatting
local vol = '';
if utilities.is_set (volume) then
if is_numeric_vol then -- |volume= value all digits or all uppercase Roman numerals?
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, volume}); -- render in bold face
elseif is_long_vol then -- not all digits or Roman numerals; longer than 4 characters?
vol = utilities.substitute (cfg.messages['j-vol'], {sepc, utilities.hyphen_to_dash (volume)}); -- not bold
else -- four or fewer characters
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, utilities.hyphen_to_dash (volume)}); -- bold
end
end
vol = vol .. (utilities.is_set (issue) and utilities.substitute (cfg.messages['j-issue'], issue) or '')
vol = vol .. (utilities.is_set (article) and utilities.substitute (cfg.messages['j-article-num'], article) or '')
return vol;
end
if 'podcast' == cite_class and utilities.is_set (issue) then
return wrap_msg ('issue', {sepc, issue}, lower);
end
if 'conference' == cite_class and utilities.is_set (article) then -- |article-number= supported only in journal and conference cites
if utilities.is_set (volume) and utilities.is_set (article) then -- both volume and article number
return wrap_msg ('vol-art', {sepc, utilities.hyphen_to_dash (volume), article}, lower);
elseif utilities.is_set (article) then -- article number alone; when volume alone, handled below
return wrap_msg ('art', {sepc, article}, lower);
end
end
-- all other types of citation
if utilities.is_set (volume) and utilities.is_set (issue) then
return wrap_msg ('vol-no', {sepc, utilities.hyphen_to_dash (volume), issue}, lower);
elseif utilities.is_set (volume) then
return wrap_msg ('vol', {sepc, utilities.hyphen_to_dash (volume)}, lower);
else
return wrap_msg ('issue', {sepc, issue}, lower);
end
end
--[[-------------------------< F O R M A T _ P A G E S _ S H E E T S >-----------------------------------------
adds static text to one of |page(s)= or |sheet(s)= values and returns it with all of the others set to empty strings.
The return order is:
page, pages, sheet, sheets
Singular has priority over plural when both are provided.
]]
local function format_pages_sheets (page, pages, sheet, sheets, cite_class, origin, sepc, nopp, lower)
if 'map' == cite_class then -- only cite map supports sheet(s) as in-source locators
if utilities.is_set (sheet) then
if 'journal' == origin then
return '', '', wrap_msg ('j-sheet', sheet, lower), '';
else
return '', '', wrap_msg ('sheet', {sepc, sheet}, lower), '';
end
elseif utilities.is_set (sheets) then
if 'journal' == origin then
return '', '', '', wrap_msg ('j-sheets', sheets, lower);
else
return '', '', '', wrap_msg ('sheets', {sepc, sheets}, lower);
end
end
end
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
if utilities.is_set (page) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], page), '', '', '';
elseif not nopp then
return utilities.substitute (cfg.messages['p-prefix'], {sepc, page}), '', '', '';
else
return utilities.substitute (cfg.messages['nopp'], {sepc, page}), '', '', '';
end
elseif utilities.is_set (pages) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], pages), '', '', '';
elseif tonumber(pages) ~= nil and not nopp then -- if pages is only digits, assume a single page number
return '', utilities.substitute (cfg.messages['p-prefix'], {sepc, pages}), '', '';
elseif not nopp then
return '', utilities.substitute (cfg.messages['pp-prefix'], {sepc, pages}), '', '';
else
return '', utilities.substitute (cfg.messages['nopp'], {sepc, pages}), '', '';
end
end
return '', '', '', ''; -- return empty strings
end
--[[--------------------------< I N S O U R C E _ L O C _ G E T >----------------------------------------------
returns one of the in-source locators: page, pages, or at.
If any of these are interwiki links to Wikisource, returns the label portion of the interwiki-link as plain text
for use in COinS. This COinS thing is done because here we convert an interwiki-link to an external link and
add an icon span around that; get_coins_pages() doesn't know about the span. TODO: should it?
TODO: add support for sheet and sheets?; streamline;
TODO: make it so that this function returns only one of the three as the single in-source (the return value assigned
to a new name)?
]]
local function insource_loc_get (page, page_orig, pages, pages_orig, at)
local ws_url, ws_label, coins_pages, L; -- for Wikisource interwiki-links; TODO: this corrupts page metadata (span remains in place after cleanup; fix there?)
if utilities.is_set (page) then
if utilities.is_set (pages) or utilities.is_set (at) then
pages = ''; -- unset the others
at = '';
end
extra_text_in_page_check (page, page_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (page); -- make ws URL from |page= interwiki link; link portion L becomes tooltip label
if ws_url then
page = external_link (ws_url, ws_label .. ' ', 'ws link in page'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
page = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, page});
coins_pages = ws_label;
end
elseif utilities.is_set (pages) then
if utilities.is_set (at) then
at = ''; -- unset
end
extra_text_in_page_check (pages, pages_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (pages); -- make ws URL from |pages= interwiki link; link portion L becomes tooltip label
if ws_url then
pages = external_link (ws_url, ws_label .. ' ', 'ws link in pages'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
pages = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, pages});
coins_pages = ws_label;
end
elseif utilities.is_set (at) then
ws_url, ws_label, L = wikisource_url_make (at); -- make ws URL from |at= interwiki link; link portion L becomes tooltip label
if ws_url then
at = external_link (ws_url, ws_label .. ' ', 'ws link in at'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
at = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, at});
coins_pages = ws_label;
end
end
return page, pages, at, coins_pages;
end
--[[--------------------------< I S _ U N I Q U E _ A R C H I V E _ U R L >------------------------------------
add error message when |archive-url= value is same as |url= or chapter-url= (or alias...) value
]]
local function is_unique_archive_url (archive, url, c_url, source, date)
if utilities.is_set (archive) then
if archive == url or archive == c_url then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)}); -- add error message
return '', ''; -- unset |archive-url= and |archive-date= because same as |url= or |chapter-url=
end
end
return archive, date;
end
--[=[-------------------------< A R C H I V E _ U R L _ C H E C K >--------------------------------------------
Check archive.org URLs to make sure they at least look like they are pointing at valid archives and not to the
save snapshot URL or to calendar pages. When the archive URL is 'https://web.archive.org/save/' (or http://...)
archive.org saves a snapshot of the target page in the URL. That is something that Wikipedia should not allow
unwitting readers to do.
When the archive.org URL does not have a complete timestamp, archive.org chooses a snapshot according to its own
algorithm or provides a calendar 'search' result. [[WP:ELNO]] discourages links to search results.
This function looks at the value assigned to |archive-url= and returns empty strings for |archive-url= and
|archive-date= and an error message when:
|archive-url= holds an archive.org save command URL
|archive-url= is an archive.org URL that does not have a complete timestamp (YYYYMMDDhhmmss 14 digits) in the
correct place
otherwise returns |archive-url= and |archive-date=
There are two mostly compatible archive.org URLs:
//web.archive.org/<timestamp>... -- the old form
//web.archive.org/web/<timestamp>... -- the new form
The old form does not support or map to the new form when it contains a display flag. There are four identified flags
('id_', 'js_', 'cs_', 'im_') but since archive.org ignores others following the same form (two letters and an underscore)
we don't check for these specific flags but we do check the form.
This function supports a preview mode. When the article is rendered in preview mode, this function may return a modified
archive URL:
for save command errors, return undated wildcard (/*/)
for timestamp errors when the timestamp has a wildcard, return the URL unmodified
for timestamp errors when the timestamp does not have a wildcard, return with timestamp limited to six digits plus wildcard (/yyyymm*/)
]=]
local function archive_url_check (url, date)
local err_msg = ''; -- start with the error message empty
local path, timestamp, flag; -- portions of the archive.org URL
if (not url:match('//web%.archive%.org/')) and (not url:match('//liveweb%.archive%.org/')) then -- also deprecated liveweb Wayback machine URL
return url, date; -- not an archive.org archive, return ArchiveURL and ArchiveDate
end
if url:match('//web%.archive%.org/save/') then -- if a save command URL, we don't want to allow saving of the target page
err_msg = cfg.err_msg_supl.save;
url = url:gsub ('(//web%.archive%.org)/save/', '%1/*/', 1); -- for preview mode: modify ArchiveURL
elseif url:match('//liveweb%.archive%.org/') then
err_msg = cfg.err_msg_supl.liveweb;
else
path, timestamp, flag = url:match('//web%.archive%.org/([^%d]*)(%d+)([^/]*)/'); -- split out some of the URL parts for evaluation
if not path then -- malformed in some way; pattern did not match
err_msg = cfg.err_msg_supl.timestamp;
elseif 14 ~= timestamp:len() then -- path and flag optional, must have 14-digit timestamp here
err_msg = cfg.err_msg_supl.timestamp;
if '*' ~= flag then
local replacement = timestamp:match ('^%d%d%d%d%d%d') or timestamp:match ('^%d%d%d%d'); -- get the first 6 (YYYYMM) or first 4 digits (YYYY)
if replacement then -- nil if there aren't at least 4 digits (year)
replacement = replacement .. string.rep ('0', 14 - replacement:len()); -- year or yearmo (4 or 6 digits) zero-fill to make 14-digit timestamp
url=url:gsub ('(//web%.archive%.org/[^%d]*)%d[^/]*', '%1' .. replacement .. '*', 1) -- for preview, modify ts to 14 digits plus splat for calendar display
end
end
elseif utilities.is_set (path) and 'web/' ~= path then -- older archive URLs do not have the extra 'web/' path element
err_msg = cfg.err_msg_supl.path;
elseif utilities.is_set (flag) and not utilities.is_set (path) then -- flag not allowed with the old form URL (without the 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
elseif utilities.is_set (flag) and not flag:match ('%a%a_') then -- flag if present must be two alpha characters and underscore (requires 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
else
return url, date; -- return ArchiveURL and ArchiveDate
end
end
-- if here, something not right so
utilities.set_message ('err_archive_url', {err_msg}); -- add error message and
if is_preview_mode then
return url, date; -- preview mode so return ArchiveURL and ArchiveDate
else
return '', ''; -- return empty strings for ArchiveURL and ArchiveDate
end
end
--[[--------------------------< P L A C E _ C H E C K >--------------------------------------------------------
check |place=, |publication-place=, |location= to see if these params include digits. This function added because
many editors misuse location to specify the in-source location (|page(s)= and |at= are supposed to do that)
returns the original parameter value without modification; added maint cat when parameter value contains digits
]]
local function place_check (param_val)
if not utilities.is_set (param_val) then -- parameter empty or omitted
return param_val; -- return that empty state
end
if mw.ustring.find (param_val, '%d') then -- not empty, are there digits in the parameter value
utilities.set_message ('maint_location'); -- yep, add maint cat
end
return param_val; -- and done
end
--[[--------------------------< I S _ A R C H I V E D _ C O P Y >----------------------------------------------
compares |title= to 'Archived copy' (placeholder added by bots that can't find proper title); if matches, return true; nil else
]]
local function is_archived_copy (title)
title = mw.ustring.lower(title); -- switch title to lower case
if title:find (cfg.special_case_translation.archived_copy.en) then -- if title is 'Archived copy'
return true;
elseif cfg.special_case_translation.archived_copy['local'] then
if mw.ustring.find (title, cfg.special_case_translation.archived_copy['local']) then -- mw.ustring() because might not be Latin script
return true;
end
end
end
--[[--------------------------< C I T A T I O N 0 >------------------------------------------------------------
This is the main function doing the majority of the citation formatting.
]]
local function citation0( config, args )
--[[
Load Input Parameters
The argument_wrapper facilitates the mapping of multiple aliases to single internal variable.
]]
local A = argument_wrapper ( args );
local i
-- Pick out the relevant fields from the arguments. Different citation templates
-- define different field names for the same underlying things.
local author_etal;
local a = {}; -- authors list from |lastn= / |firstn= pairs or |vauthors=
local Authors;
local NameListStyle = is_valid_parameter_value (A['NameListStyle'], A:ORIGIN('NameListStyle'), cfg.keywords_lists['name-list-style'], '');
local Collaboration = A['Collaboration'];
do -- to limit scope of selected
local selected = select_author_editor_source (A['Vauthors'], A['Authors'], args, 'AuthorList');
if 1 == selected then
a, author_etal = extract_names (args, 'AuthorList'); -- fetch author list from |authorn= / |lastn= / |firstn=, |author-linkn=, and |author-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
a, author_etal = parse_vauthors_veditors (args, args.vauthors, 'AuthorList'); -- fetch author list from |vauthors=, |author-linkn=, and |author-maskn=
elseif 3 == selected then
Authors = A['Authors']; -- use content of |authors=
if 'authors' == A:ORIGIN('Authors') then -- but add a maint cat if the parameter is |authors=
utilities.set_message ('maint_authors'); -- because use of this parameter is discouraged; what to do about the aliases is a TODO:
end
end
if utilities.is_set (Collaboration) then
author_etal = true; -- so that |display-authors=etal not required
end
end
local editor_etal;
local e = {}; -- editors list from |editor-lastn= / |editor-firstn= pairs or |veditors=
do -- to limit scope of selected
local selected = select_author_editor_source (A['Veditors'], nil, args, 'EditorList'); -- support for |editors= withdrawn
if 1 == selected then
e, editor_etal = extract_names (args, 'EditorList'); -- fetch editor list from |editorn= / |editor-lastn= / |editor-firstn=, |editor-linkn=, and |editor-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
e, editor_etal = parse_vauthors_veditors (args, args.veditors, 'EditorList'); -- fetch editor list from |veditors=, |editor-linkn=, and |editor-maskn=
end
end
local Chapter = A['Chapter']; -- done here so that we have access to |contribution= from |chapter= aliases
local Chapter_origin = A:ORIGIN ('Chapter');
local Contribution; -- because contribution is required for contributor(s)
if 'contribution' == Chapter_origin then
Contribution = Chapter; -- get the name of the contribution
end
local c = {}; -- contributors list from |contributor-lastn= / contributor-firstn= pairs
if utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (A['Periodical']) then -- |contributor= and |contribution= only supported in book cites
c = extract_names (args, 'ContributorList'); -- fetch contributor list from |contributorn= / |contributor-lastn=, -firstn=, -linkn=, -maskn=
if 0 < #c then
if not utilities.is_set (Contribution) then -- |contributor= requires |contribution=
utilities.set_message ('err_contributor_missing_required_param', 'contribution'); -- add missing contribution error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
if 0 == #a then -- |contributor= requires |author=
utilities.set_message ('err_contributor_missing_required_param', 'author'); -- add missing author error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
end
else -- if not a book cite
if utilities.select_one (args, cfg.aliases['ContributorList-Last'], 'err_redundant_parameters', 1 ) then -- are there contributor name list parameters?
utilities.set_message ('err_contributor_ignored'); -- add contributor ignored error message
end
Contribution = nil; -- unset
end
local Title = A['Title'];
local TitleLink = A['TitleLink'];
local auto_select = ''; -- default is auto
local accept_link;
TitleLink, accept_link = utilities.has_accept_as_written (TitleLink, true); -- test for accept-this-as-written markup
if (not accept_link) and utilities.in_array (TitleLink, {'none', 'pmc', 'doi'}) then -- check for special keywords
auto_select = TitleLink; -- remember selection for later
TitleLink = ''; -- treat as if |title-link= would have been empty
end
TitleLink = link_title_ok (TitleLink, A:ORIGIN ('TitleLink'), Title, 'title'); -- check for wiki-markup in |title-link= or wiki-markup in |title= when |title-link= is set
local Section = ''; -- {{cite map}} only; preset to empty string for concatenation if not used
if 'map' == config.CitationClass and 'section' == Chapter_origin then
Section = A['Chapter']; -- get |section= from |chapter= alias list; |chapter= and the other aliases not supported in {{cite map}}
Chapter = ''; -- unset for now; will be reset later from |map= if present
end
local Periodical = A['Periodical'];
local Periodical_origin = '';
if utilities.is_set (Periodical) then
Periodical_origin = A:ORIGIN('Periodical'); -- get the name of the periodical parameter
local i;
Periodical, i = utilities.strip_apostrophe_markup (Periodical); -- strip apostrophe markup so that metadata isn't contaminated
if i then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {Periodical_origin});
end
end
if 'mailinglist' == config.CitationClass then -- special case for {{cite mailing list}}
if utilities.is_set (Periodical) and utilities.is_set (A ['MailingList']) then -- both set emit an error TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', Periodical_origin) .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'mailinglist')});
end
Periodical = A ['MailingList']; -- error or no, set Periodical to |mailinglist= value because this template is {{cite mailing list}}
Periodical_origin = A:ORIGIN('MailingList');
end
local ScriptPeriodical = A['ScriptPeriodical'];
-- web and news not tested for now because of
-- Wikipedia:Administrators%27_noticeboard#Is_there_a_semi-automated_tool_that_could_fix_these_annoying_"Cite_Web"_errors?
if not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) then -- 'periodical' templates require periodical parameter
-- local p = {['journal'] = 'journal', ['magazine'] = 'magazine', ['news'] = 'newspaper', ['web'] = 'website'}; -- for error message
local p = {['journal'] = 'journal', ['magazine'] = 'magazine'}; -- for error message
if p[config.CitationClass] then
utilities.set_message ('err_missing_periodical', {config.CitationClass, p[config.CitationClass]});
end
end
local Volume;
local ScriptPeriodical_origin = A:ORIGIN('ScriptPeriodical');
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) then
if not utilities.in_array (Periodical_origin, cfg.citation_no_volume_t) then -- {{citation}} does not render |volume= when these parameters are used
Volume = A['Volume']; -- but does for all other 'periodicals'
end
elseif utilities.is_set (ScriptPeriodical) then
if 'script-website' ~= ScriptPeriodical_origin then -- {{citation}} does not render volume for |script-website=
Volume = A['Volume']; -- but does for all other 'periodicals'
end
else
Volume = A['Volume']; -- and does for non-'periodical' cites
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_volume) then -- render |volume= for cs1 according to the configuration settings
Volume = A['Volume'];
end
extra_text_in_vol_iss_check (Volume, A:ORIGIN ('Volume'), 'v');
local Issue;
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) and utilities.in_array (Periodical_origin, cfg.citation_issue_t) then -- {{citation}} may render |issue= when these parameters are used
Issue = utilities.hyphen_to_dash (A['Issue']);
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_issue) then -- conference & map books do not support issue; {{citation}} listed here because included in settings table
if not (utilities.in_array (config.CitationClass, {'conference', 'map', 'citation'}) and not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical))) then
Issue = utilities.hyphen_to_dash (A['Issue']);
end
end
local ArticleNumber;
if utilities.in_array (config.CitationClass, {'journal', 'conference'}) or ('citation' == config.CitationClass and utilities.is_set (Periodical) and 'journal' == Periodical_origin) then
ArticleNumber = A['ArticleNumber'];
end
extra_text_in_vol_iss_check (Issue, A:ORIGIN ('Issue'), 'i');
local Page;
local Pages;
local At;
local QuotePage;
local QuotePages;
if not utilities.in_array (config.CitationClass, cfg.templates_not_using_page) then -- TODO: rewrite to emit ignored parameter error message?
Page = A['Page'];
Pages = utilities.hyphen_to_dash (A['Pages']);
At = A['At'];
QuotePage = A['QuotePage'];
QuotePages = utilities.hyphen_to_dash (A['QuotePages']);
end
local Edition = A['Edition'];
local PublicationPlace = place_check (A['PublicationPlace'], A:ORIGIN('PublicationPlace'));
local Place = place_check (A['Place'], A:ORIGIN('Place'));
local PublisherName = A['PublisherName'];
local PublisherName_origin = A:ORIGIN('PublisherName');
if utilities.is_set (PublisherName) then
local i = 0;
PublisherName, i = utilities.strip_apostrophe_markup (PublisherName); -- strip apostrophe markup so that metadata isn't contaminated; publisher is never italicized
if i then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {PublisherName_origin});
end
end
local Newsgroup = A['Newsgroup']; -- TODO: strip apostrophe markup?
local Newsgroup_origin = A:ORIGIN('Newsgroup');
if 'newsgroup' == config.CitationClass then
if utilities.is_set (PublisherName) then -- general use parameter |publisher= not allowed in cite newsgroup
utilities.set_message ('err_parameter_ignored', {PublisherName_origin});
end
PublisherName = nil; -- ensure that this parameter is unset for the time being; will be used again after COinS
end
local URL = A['URL']; -- TODO: better way to do this for URL, ChapterURL, and MapURL?
local UrlAccess = is_valid_parameter_value (A['UrlAccess'], A:ORIGIN('UrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (URL) and utilities.is_set (UrlAccess) then
UrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', 'url');
end
local ChapterURL = A['ChapterURL'];
local ChapterUrlAccess = is_valid_parameter_value (A['ChapterUrlAccess'], A:ORIGIN('ChapterUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (ChapterURL) and utilities.is_set (ChapterUrlAccess) then
ChapterUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {A:ORIGIN('ChapterUrlAccess'):gsub ('%-access', '')});
end
local MapUrlAccess = is_valid_parameter_value (A['MapUrlAccess'], A:ORIGIN('MapUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (A['MapURL']) and utilities.is_set (MapUrlAccess) then
MapUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {'map-url'});
end
local this_page = mw.title.getCurrentTitle(); -- also used for COinS and for language
local no_tracking_cats = is_valid_parameter_value (A['NoTracking'], A:ORIGIN('NoTracking'), cfg.keywords_lists['yes_true_y'], nil);
-- check this page to see if it is in one of the namespaces that cs1 is not supposed to add to the error categories
if not utilities.is_set (no_tracking_cats) then -- ignore if we are already not going to categorize this page
if cfg.uncategorized_namespaces[this_page.namespace] then -- is this page's namespace id one of the uncategorized namespace ids?
no_tracking_cats = "true"; -- set no_tracking_cats
end
for _, v in ipairs (cfg.uncategorized_subpages) do -- cycle through page name patterns
if this_page.text:match (v) then -- test page name against each pattern
no_tracking_cats = "true"; -- set no_tracking_cats
break; -- bail out if one is found
end
end
end
-- check for extra |page=, |pages= or |at= parameters. (also sheet and sheets while we're at it)
utilities.select_one (args, {'page', 'p', 'pp', 'pages', 'at', 'sheet', 'sheets'}, 'err_redundant_parameters'); -- this is a dummy call simply to get the error message and category
local coins_pages;
Page, Pages, At, coins_pages = insource_loc_get (Page, A:ORIGIN('Page'), Pages, A:ORIGIN('Pages'), At);
local NoPP = is_valid_parameter_value (A['NoPP'], A:ORIGIN('NoPP'), cfg.keywords_lists['yes_true_y'], nil);
if utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- both |publication-place= and |place= (|location=) allowed if different
utilities.add_prop_cat ('location-test'); -- add property cat to evaluate how often PublicationPlace and Place are used together
if PublicationPlace == Place then
Place = ''; -- unset; don't need both if they are the same
end
elseif not utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- when only |place= (|location=) is set ...
PublicationPlace = Place; -- promote |place= (|location=) to |publication-place
end
if PublicationPlace == Place then Place = ''; end -- don't need both if they are the same
local URL_origin = A:ORIGIN('URL'); -- get name of parameter that holds URL
local ChapterURL_origin = A:ORIGIN('ChapterURL'); -- get name of parameter that holds ChapterURL
local ScriptChapter = A['ScriptChapter'];
local ScriptChapter_origin = A:ORIGIN ('ScriptChapter');
local Format = A['Format'];
local ChapterFormat = A['ChapterFormat'];
local TransChapter = A['TransChapter'];
local TransChapter_origin = A:ORIGIN ('TransChapter');
local TransTitle = A['TransTitle'];
local ScriptTitle = A['ScriptTitle'];
--[[
Parameter remapping for cite encyclopedia:
When the citation has these parameters:
|encyclopedia= and |title= then map |title= to |article= and |encyclopedia= to |title=
|encyclopedia= and |article= then map |encyclopedia= to |title=
|trans-title= maps to |trans-chapter= when |title= is re-mapped
|url= maps to |chapter-url= when |title= is remapped
All other combinations of |encyclopedia=, |title=, and |article= are not modified
]]
local Encyclopedia = A['Encyclopedia']; -- used as a flag by this module and by ~/COinS
if utilities.is_set (Encyclopedia) then -- emit error message when Encyclopedia set but template is other than {{cite encyclopedia}} or {{citation}}
if 'encyclopaedia' ~= config.CitationClass and 'citation' ~= config.CitationClass then
utilities.set_message ('err_parameter_ignored', {A:ORIGIN ('Encyclopedia')});
Encyclopedia = nil; -- unset because not supported by this template
end
end
if ('encyclopaedia' == config.CitationClass) or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Periodical) and utilities.is_set (Encyclopedia) then -- when both set emit an error TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', A:ORIGIN ('Encyclopedia')) .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', Periodical_origin)});
end
if utilities.is_set (Encyclopedia) then
Periodical = Encyclopedia; -- error or no, set Periodical to Encyclopedia; allow periodical without encyclopedia
Periodical_origin = A:ORIGIN ('Encyclopedia');
end
if utilities.is_set (Periodical) then -- Periodical is set when |encyclopedia= is set
if utilities.is_set (Title) or utilities.is_set (ScriptTitle) then
if not utilities.is_set (Chapter) then
Chapter = Title; -- |encyclopedia= and |title= are set so map |title= to |article= and |encyclopedia= to |title=
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle')
TransChapter = TransTitle;
ChapterURL = URL;
ChapterURL_origin = URL_origin;
ChapterUrlAccess = UrlAccess;
if not utilities.is_set (ChapterURL) and utilities.is_set (TitleLink) then
Chapter = utilities.make_wikilink (TitleLink, Chapter);
end
Title = Periodical;
ChapterFormat = Format;
Periodical = ''; -- redundant so unset
TransTitle = '';
URL = '';
Format = '';
TitleLink = '';
ScriptTitle = '';
end
elseif utilities.is_set (Chapter) or utilities.is_set (ScriptChapter) then -- |title= not set
Title = Periodical; -- |encyclopedia= set and |article= set so map |encyclopedia= to |title=
Periodical = ''; -- redundant so unset
end
end
end
-- special case for cite techreport.
local ID = A['ID'];
if (config.CitationClass == "techreport") then -- special case for cite techreport
if utilities.is_set (A['Number']) then -- cite techreport uses 'number', which other citations alias to 'issue'
if not utilities.is_set (ID) then -- can we use ID for the "number"?
ID = A['Number']; -- yes, use it
else -- ID has a value so emit error message
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'id') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'number')});
end
end
end
-- Account for the oddity that is {{cite conference}}, before generation of COinS data.
local ChapterLink -- = A['ChapterLink']; -- deprecated as a parameter but still used internally by cite episode
local Conference = A['Conference'];
local BookTitle = A['BookTitle'];
local TransTitle_origin = A:ORIGIN ('TransTitle');
if 'conference' == config.CitationClass then
if utilities.is_set (BookTitle) then
Chapter = Title;
Chapter_origin = 'title';
-- ChapterLink = TitleLink; -- |chapter-link= is deprecated
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
URL_origin = '';
ChapterFormat = Format;
TransChapter = TransTitle;
TransChapter_origin = TransTitle_origin;
Title = BookTitle;
Format = '';
-- TitleLink = '';
TransTitle = '';
URL = '';
end
elseif 'speech' ~= config.CitationClass then
Conference = ''; -- not cite conference or cite speech so make sure this is empty string
end
-- CS1/2 mode
local Mode = is_valid_parameter_value (A['Mode'], A:ORIGIN('Mode'), cfg.keywords_lists['mode'], '');
-- separator character and postscript
local sepc, PostScript = set_style (Mode:lower(), A['PostScript'], config.CitationClass);
-- controls capitalization of certain static text
local use_lowercase = ( sepc == ',' );
-- cite map oddities
local Cartography = "";
local Scale = "";
local Sheet = A['Sheet'] or '';
local Sheets = A['Sheets'] or '';
if config.CitationClass == "map" then
if utilities.is_set (Chapter) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'map') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', Chapter_origin)}); -- add error message
end
Chapter = A['Map'];
Chapter_origin = A:ORIGIN('Map');
ChapterURL = A['MapURL'];
ChapterURL_origin = A:ORIGIN('MapURL');
TransChapter = A['TransMap'];
ScriptChapter = A['ScriptMap']
ScriptChapter_origin = A:ORIGIN('ScriptMap')
ChapterUrlAccess = MapUrlAccess;
ChapterFormat = A['MapFormat'];
Cartography = A['Cartography'];
if utilities.is_set ( Cartography ) then
Cartography = sepc .. " " .. wrap_msg ('cartography', Cartography, use_lowercase);
end
Scale = A['Scale'];
if utilities.is_set ( Scale ) then
Scale = sepc .. " " .. Scale;
end
end
-- Account for the oddities that are {{cite episode}} and {{cite serial}}, before generation of COinS data.
local Series = A['Series'];
if 'episode' == config.CitationClass or 'serial' == config.CitationClass then
local SeriesLink = A['SeriesLink'];
SeriesLink = link_title_ok (SeriesLink, A:ORIGIN ('SeriesLink'), Series, 'series'); -- check for wiki-markup in |series-link= or wiki-markup in |series= when |series-link= is set
local Network = A['Network'];
local Station = A['Station'];
local s, n = {}, {};
-- do common parameters first
if utilities.is_set (Network) then table.insert(n, Network); end
if utilities.is_set (Station) then table.insert(n, Station); end
ID = table.concat(n, sepc .. ' ');
if 'episode' == config.CitationClass then -- handle the oddities that are strictly {{cite episode}}
local Season = A['Season'];
local SeriesNumber = A['SeriesNumber'];
if utilities.is_set (Season) and utilities.is_set (SeriesNumber) then -- these are mutually exclusive so if both are set TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'season') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'seriesno')}); -- add error message
SeriesNumber = ''; -- unset; prefer |season= over |seriesno=
end
-- assemble a table of parts concatenated later into Series
if utilities.is_set (Season) then table.insert(s, wrap_msg ('season', Season, use_lowercase)); end
if utilities.is_set (SeriesNumber) then table.insert(s, wrap_msg ('seriesnum', SeriesNumber, use_lowercase)); end
if utilities.is_set (Issue) then table.insert(s, wrap_msg ('episode', Issue, use_lowercase)); end
Issue = ''; -- unset because this is not a unique parameter
Chapter = Title; -- promote title parameters to chapter
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle');
ChapterLink = TitleLink; -- alias |episode-link=
TransChapter = TransTitle;
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
ChapterFormat = Format;
Title = Series; -- promote series to title
TitleLink = SeriesLink;
Series = table.concat(s, sepc .. ' '); -- this is concatenation of season, seriesno, episode number
if utilities.is_set (ChapterLink) and not utilities.is_set (ChapterURL) then -- link but not URL
Chapter = utilities.make_wikilink (ChapterLink, Chapter);
elseif utilities.is_set (ChapterLink) and utilities.is_set (ChapterURL) then -- if both are set, URL links episode;
Series = utilities.make_wikilink (ChapterLink, Series);
end
URL = ''; -- unset
TransTitle = '';
ScriptTitle = '';
Format = '';
else -- now oddities that are cite serial
Issue = ''; -- unset because this parameter no longer supported by the citation/core version of cite serial
Chapter = A['Episode']; -- TODO: make |episode= available to cite episode someday?
if utilities.is_set (Series) and utilities.is_set (SeriesLink) then
Series = utilities.make_wikilink (SeriesLink, Series);
end
Series = utilities.wrap_style ('italic-title', Series); -- series is italicized
end
end
-- end of {{cite episode}} stuff
-- handle type parameter for those CS1 citations that have default values
local TitleType = A['TitleType'];
local Degree = A['Degree'];
if utilities.in_array (config.CitationClass, {'AV-media-notes', 'interview', 'mailinglist', 'map', 'podcast', 'pressrelease', 'report', 'speech', 'techreport', 'thesis'}) then
TitleType = set_titletype (config.CitationClass, TitleType);
if utilities.is_set (Degree) and "Thesis" == TitleType then -- special case for cite thesis
TitleType = Degree .. ' ' .. cfg.title_types ['thesis']:lower();
end
end
if utilities.is_set (TitleType) then -- if type parameter is specified
TitleType = utilities.substitute ( cfg.messages['type'], TitleType); -- display it in parentheses
-- TODO: Hack on TitleType to fix bunched parentheses problem
end
-- legacy: promote PublicationDate to Date if neither Date nor Year are set.
local Date = A['Date'];
local Date_origin; -- to hold the name of parameter promoted to Date; required for date error messaging
local PublicationDate = A['PublicationDate'];
local Year = A['Year'];
if not utilities.is_set (Date) then
Date = Year; -- promote Year to Date
Year = nil; -- make nil so Year as empty string isn't used for CITEREF
if not utilities.is_set (Date) and utilities.is_set (PublicationDate) then -- use PublicationDate when |date= and |year= are not set
Date = PublicationDate; -- promote PublicationDate to Date
PublicationDate = ''; -- unset, no longer needed
Date_origin = A:ORIGIN('PublicationDate'); -- save the name of the promoted parameter
else
Date_origin = A:ORIGIN('Year'); -- save the name of the promoted parameter
end
else
Date_origin = A:ORIGIN('Date'); -- not a promotion; name required for error messaging
end
if PublicationDate == Date then PublicationDate = ''; end -- if PublicationDate is same as Date, don't display in rendered citation
--[[
Go test all of the date-holding parameters for valid MOS:DATE format and make sure that dates are real dates. This must be done before we do COinS because here is where
we get the date used in the metadata.
Date validation supporting code is in Module:Citation/CS1/Date_validation
]]
local DF = is_valid_parameter_value (A['DF'], A:ORIGIN('DF'), cfg.keywords_lists['df'], '');
if not utilities.is_set (DF) then
DF = cfg.global_df; -- local |df= if present overrides global df set by {{use xxx date}} template
end
local ArchiveURL;
local ArchiveDate;
local ArchiveFormat = A['ArchiveFormat'];
ArchiveURL, ArchiveDate = archive_url_check (A['ArchiveURL'], A['ArchiveDate'])
ArchiveFormat = style_format (ArchiveFormat, ArchiveURL, 'archive-format', 'archive-url');
ArchiveURL, ArchiveDate = is_unique_archive_url (ArchiveURL, URL, ChapterURL, A:ORIGIN('ArchiveURL'), ArchiveDate); -- add error message when URL or ChapterURL == ArchiveURL
local AccessDate = A['AccessDate'];
local LayDate = A['LayDate'];
local COinS_date = {}; -- holds date info extracted from |date= for the COinS metadata by Module:Date verification
local DoiBroken = A['DoiBroken'];
local Embargo = A['Embargo'];
local anchor_year; -- used in the CITEREF identifier
do -- create defined block to contain local variables error_message, date_parameters_list, mismatch
local error_message = '';
-- AirDate has been promoted to Date so not necessary to check it
local date_parameters_list = {
['access-date'] = {val = AccessDate, name = A:ORIGIN ('AccessDate')},
['archive-date'] = {val = ArchiveDate, name = A:ORIGIN ('ArchiveDate')},
['date'] = {val = Date, name = Date_origin},
['doi-broken-date'] = {val = DoiBroken, name = A:ORIGIN ('DoiBroken')},
['pmc-embargo-date'] = {val = Embargo, name = A:ORIGIN ('Embargo')},
['lay-date'] = {val = LayDate, name = A:ORIGIN ('LayDate')},
['publication-date'] = {val = PublicationDate, name = A:ORIGIN ('PublicationDate')},
['year'] = {val = Year, name = A:ORIGIN ('Year')},
};
local error_list = {};
anchor_year, Embargo = validation.dates(date_parameters_list, COinS_date, error_list);
-- start temporary Julian / Gregorian calendar uncertainty categorization
if COinS_date.inter_cal_cat then
utilities.add_prop_cat ('jul-greg-uncertainty');
end
-- end temporary Julian / Gregorian calendar uncertainty categorization
if utilities.is_set (Year) and utilities.is_set (Date) then -- both |date= and |year= not normally needed;
validation.year_date_check (Year, A:ORIGIN ('Year'), Date, A:ORIGIN ('Date'), error_list);
end
if 0 == #error_list then -- error free dates only; 0 when error_list is empty
local modified = false; -- flag
if utilities.is_set (DF) then -- if we need to reformat dates
modified = validation.reformat_dates (date_parameters_list, DF); -- reformat to DF format, use long month names if appropriate
end
if true == validation.date_hyphen_to_dash (date_parameters_list) then -- convert hyphens to dashes where appropriate
modified = true;
utilities.set_message ('maint_date_format'); -- hyphens were converted so add maint category
end
-- for those wikis that can and want to have English date names translated to the local language; not supported at en.wiki
if cfg.date_name_auto_xlate_enable and validation.date_name_xlate (date_parameters_list, cfg.date_digit_auto_xlate_enable ) then
utilities.set_message ('maint_date_auto_xlated'); -- add maint cat
modified = true;
end
if modified then -- if the date_parameters_list values were modified
AccessDate = date_parameters_list['access-date'].val; -- overwrite date holding parameters with modified values
ArchiveDate = date_parameters_list['archive-date'].val;
Date = date_parameters_list['date'].val;
DoiBroken = date_parameters_list['doi-broken-date'].val;
LayDate = date_parameters_list['lay-date'].val;
PublicationDate = date_parameters_list['publication-date'].val;
end
else
utilities.set_message ('err_bad_date', {utilities.make_sep_list (#error_list, error_list)}); -- add this error message
end
end -- end of do
local ID_list = {}; -- sequence table of rendered identifiers
local ID_list_coins = {}; -- table of identifiers and their values from args; key is same as cfg.id_handlers's key
local Class = A['Class']; -- arxiv class identifier
local ID_support = {
{A['ASINTLD'], 'ASIN', 'err_asintld_missing_asin', A:ORIGIN ('ASINTLD')},
{DoiBroken, 'DOI', 'err_doibroken_missing_doi', A:ORIGIN ('DoiBroken')},
{Embargo, 'PMC', 'err_embargo_missing_pmc', A:ORIGIN ('Embargo')},
}
ID_list, ID_list_coins = identifiers.identifier_lists_get (args, {DoiBroken = DoiBroken, ASINTLD = A['ASINTLD'], Embargo = Embargo, Class = Class}, ID_support);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite ssrn}}, before generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list) then -- |arxiv= or |eprint= required for cite arxiv; |biorxiv=, |citeseerx=, |ssrn= required for their templates
if not (args[cfg.id_handlers[config.CitationClass:upper()].parameters[1]] or -- can't use ID_list_coins k/v table here because invalid parameters omitted
args[cfg.id_handlers[config.CitationClass:upper()].parameters[2]]) then -- which causes unexpected parameter missing error message
utilities.set_message ('err_' .. config.CitationClass .. '_missing'); -- add error message
end
Periodical = ({['arxiv'] = 'arXiv', ['biorxiv'] = 'bioRxiv', ['citeseerx'] = 'CiteSeerX', ['ssrn'] = 'Social Science Research Network'})[config.CitationClass];
end
-- Link the title of the work if no |url= was provided, but we have a |pmc= or a |doi= with |doi-access=free
if config.CitationClass == "journal" and not utilities.is_set (URL) and not utilities.is_set (TitleLink) and not utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) then -- TODO: remove 'none' once existing citations have been switched to 'off', so 'none' can be used as token for "no title" instead
if 'none' ~= cfg.keywords_xlate[auto_select] then -- if auto-linking not disabled
if identifiers.auto_link_urls[auto_select] then -- manual selection
URL = identifiers.auto_link_urls[auto_select]; -- set URL to be the same as identifier's external link
URL_origin = cfg.id_handlers[auto_select:upper()].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['pmc'] then -- auto-select PMC
URL = identifiers.auto_link_urls['pmc']; -- set URL to be the same as the PMC external link if not embargoed
URL_origin = cfg.id_handlers['PMC'].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['doi'] then -- auto-select DOI
URL = identifiers.auto_link_urls['doi'];
URL_origin = cfg.id_handlers['DOI'].parameters[1];
end
end
if utilities.is_set (URL) then -- set when using an identifier-created URL
if utilities.is_set (AccessDate) then -- |access-date= requires |url=; identifier-created URL is not |url=
utilities.set_message ('err_accessdate_missing_url'); -- add an error message
AccessDate = ''; -- unset
end
if utilities.is_set (ArchiveURL) then -- |archive-url= requires |url=; identifier-created URL is not |url=
utilities.set_message ('err_archive_missing_url'); -- add an error message
ArchiveURL = ''; -- unset
end
end
end
-- At this point fields may be nil if they weren't specified in the template use. We can use that fact.
-- Test if citation has no title
if not utilities.is_set (Title) and not utilities.is_set (TransTitle) and not utilities.is_set (ScriptTitle) then -- has special case for cite episode
utilities.set_message ('err_citation_missing_title', {'episode' == config.CitationClass and 'series' or 'title'});
end
if utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) and
utilities.in_array (config.CitationClass, {'journal', 'citation'}) and
(utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and
('journal' == Periodical_origin or 'script-journal' == ScriptPeriodical_origin) then -- special case for journal cites
Title = ''; -- set title to empty string
utilities.set_message ('maint_untitled'); -- add maint cat
end
-- COinS metadata (see <http://ocoins.info/>) for automated parsing of citation information.
-- handle the oddity that is cite encyclopedia and {{citation |encyclopedia=something}}. Here we presume that
-- when Periodical, Title, and Chapter are all set, then Periodical is the book (encyclopedia) title, Title
-- is the article title, and Chapter is a section within the article. So, we remap
local coins_chapter = Chapter; -- default assuming that remapping not required
local coins_title = Title; -- et tu
if 'encyclopaedia' == config.CitationClass or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Chapter) and utilities.is_set (Title) and utilities.is_set (Periodical) then -- if all are used then
coins_chapter = Title; -- remap
coins_title = Periodical;
end
end
local coins_author = a; -- default for coins rft.au
if 0 < #c then -- but if contributor list
coins_author = c; -- use that instead
end
-- this is the function call to COinS()
local OCinSoutput = metadata.COinS({
['Periodical'] = utilities.strip_apostrophe_markup (Periodical), -- no markup in the metadata
['Encyclopedia'] = Encyclopedia, -- just a flag; content ignored by ~/COinS
['Chapter'] = metadata.make_coins_title (coins_chapter, ScriptChapter), -- Chapter and ScriptChapter stripped of bold / italic / accept-as-written markup
['Degree'] = Degree; -- cite thesis only
['Title'] = metadata.make_coins_title (coins_title, ScriptTitle), -- Title and ScriptTitle stripped of bold / italic / accept-as-written markup
['PublicationPlace'] = PublicationPlace,
['Date'] = COinS_date.rftdate, -- COinS_date has correctly formatted date if Date is valid;
['Season'] = COinS_date.rftssn,
['Quarter'] = COinS_date.rftquarter,
['Chron'] = COinS_date.rftchron or (not COinS_date.rftdate and Date) or '', -- chron but if not set and invalid date format use Date; keep this last bit?
['Series'] = Series,
['Volume'] = Volume,
['Issue'] = Issue,
['ArticleNumber'] = ArticleNumber,
['Pages'] = coins_pages or metadata.get_coins_pages (first_set ({Sheet, Sheets, Page, Pages, At, QuotePage, QuotePages}, 7)), -- pages stripped of external links
['Edition'] = Edition,
['PublisherName'] = PublisherName or Newsgroup, -- any apostrophe markup already removed from PublisherName
['URL'] = first_set ({ChapterURL, URL}, 2),
['Authors'] = coins_author,
['ID_list'] = ID_list_coins,
['RawPage'] = this_page.prefixedText,
}, config.CitationClass);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, and {{cite ssrn}} AFTER generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list) then -- we have set rft.jtitle in COinS to arXiv, bioRxiv, CiteSeerX, or ssrn now unset so it isn't displayed
Periodical = ''; -- periodical not allowed in these templates; if article has been published, use cite journal
end
-- special case for cite newsgroup. Do this after COinS because we are modifying Publishername to include some static text
if 'newsgroup' == config.CitationClass and utilities.is_set (Newsgroup) then
PublisherName = utilities.substitute (cfg.messages['newsgroup'], external_link( 'news:' .. Newsgroup, Newsgroup, Newsgroup_origin, nil ));
end
local Editors;
local EditorCount; -- used only for choosing {ed.) or (eds.) annotation at end of editor name-list
local Contributors; -- assembled contributors name list
local contributor_etal;
local Translators; -- assembled translators name list
local translator_etal;
local t = {}; -- translators list from |translator-lastn= / translator-firstn= pairs
t = extract_names (args, 'TranslatorList'); -- fetch translator list from |translatorn= / |translator-lastn=, -firstn=, -linkn=, -maskn=
local Interviewers;
local interviewers_list = {};
interviewers_list = extract_names (args, 'InterviewerList'); -- process preferred interviewers parameters
local interviewer_etal;
-- Now perform various field substitutions.
-- We also add leading spaces and surrounding markup and punctuation to the
-- various parts of the citation, but only when they are non-nil.
do
local last_first_list;
local control = {
format = NameListStyle, -- empty string or 'vanc'
maximum = nil, -- as if display-authors or display-editors not set
mode = Mode
};
do -- do editor name list first because the now unsupported coauthors used to modify control table
control.maximum , editor_etal = get_display_names (A['DisplayEditors'], #e, 'editors', editor_etal, A:ORIGIN ('DisplayEditors'));
Editors, EditorCount = list_people (control, e, editor_etal);
if 1 == EditorCount and (true == editor_etal or 1 < #e) then -- only one editor displayed but includes etal then
EditorCount = 2; -- spoof to display (eds.) annotation
end
end
do -- now do interviewers
control.maximum, interviewer_etal = get_display_names (A['DisplayInterviewers'], #interviewers_list, 'interviewers', interviewer_etal, A:ORIGIN ('DisplayInterviewers'));
Interviewers = list_people (control, interviewers_list, interviewer_etal);
end
do -- now do translators
control.maximum, translator_etal = get_display_names (A['DisplayTranslators'], #t, 'translators', translator_etal, A:ORIGIN ('DisplayTranslators'));
Translators = list_people (control, t, translator_etal);
end
do -- now do contributors
control.maximum, contributor_etal = get_display_names (A['DisplayContributors'], #c, 'contributors', contributor_etal, A:ORIGIN ('DisplayContributors'));
Contributors = list_people (control, c, contributor_etal);
end
do -- now do authors
control.maximum, author_etal = get_display_names (A['DisplayAuthors'], #a, 'authors', author_etal, A:ORIGIN ('DisplayAuthors'));
last_first_list = list_people (control, a, author_etal);
if utilities.is_set (Authors) then
Authors, author_etal = name_has_etal (Authors, author_etal, false, 'authors'); -- find and remove variations on et al.
if author_etal then
Authors = Authors .. ' ' .. cfg.messages['et al']; -- add et al. to authors parameter
end
else
Authors = last_first_list; -- either an author name list or an empty string
end
end -- end of do
if utilities.is_set (Authors) and utilities.is_set (Collaboration) then
Authors = Authors .. ' (' .. Collaboration .. ')'; -- add collaboration after et al.
end
end
local ConferenceFormat = A['ConferenceFormat'];
local ConferenceURL = A['ConferenceURL'];
ConferenceFormat = style_format (ConferenceFormat, ConferenceURL, 'conference-format', 'conference-url');
Format = style_format (Format, URL, 'format', 'url');
-- special case for chapter format so no error message or cat when chapter not supported
if not (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia))) then
ChapterFormat = style_format (ChapterFormat, ChapterURL, 'chapter-format', 'chapter-url');
end
if not utilities.is_set (URL) then
if utilities.in_array (config.CitationClass, {"web", "podcast", "mailinglist"}) or -- |url= required for cite web, cite podcast, and cite mailinglist
('citation' == config.CitationClass and ('website' == Periodical_origin or 'script-website' == ScriptPeriodical_origin)) then -- and required for {{citation}} with |website= or |script-website=
utilities.set_message ('err_cite_web_url');
end
-- do we have |accessdate= without either |url= or |chapter-url=?
if utilities.is_set (AccessDate) and not utilities.is_set (ChapterURL) then -- ChapterURL may be set when URL is not set;
utilities.set_message ('err_accessdate_missing_url');
AccessDate = '';
end
end
local UrlStatus = is_valid_parameter_value (A['UrlStatus'], A:ORIGIN('UrlStatus'), cfg.keywords_lists['url-status'], '');
local OriginalURL
local OriginalURL_origin
local OriginalFormat
local OriginalAccess;
UrlStatus = UrlStatus:lower(); -- used later when assembling archived text
if utilities.is_set ( ArchiveURL ) then
if utilities.is_set (ChapterURL) then -- if chapter-url= is set apply archive url to it
OriginalURL = ChapterURL; -- save copy of source chapter's url for archive text
OriginalURL_origin = ChapterURL_origin; -- name of |chapter-url= parameter for error messages
OriginalFormat = ChapterFormat; -- and original |chapter-format=
if 'live' ~= UrlStatus then
ChapterURL = ArchiveURL -- swap-in the archive's URL
ChapterURL_origin = A:ORIGIN('ArchiveURL') -- name of |archive-url= parameter for error messages
ChapterFormat = ArchiveFormat or ''; -- swap in archive's format
ChapterUrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
elseif utilities.is_set (URL) then
OriginalURL = URL; -- save copy of original source URL
OriginalURL_origin = URL_origin; -- name of URL parameter for error messages
OriginalFormat = Format; -- and original |format=
OriginalAccess = UrlAccess;
if 'live' ~= UrlStatus then -- if URL set then |archive-url= applies to it
URL = ArchiveURL -- swap-in the archive's URL
URL_origin = A:ORIGIN('ArchiveURL') -- name of archive URL parameter for error messages
Format = ArchiveFormat or ''; -- swap in archive's format
UrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
end
elseif utilities.is_set (UrlStatus) then -- if |url-status= is set when |archive-url= is not set
utilities.set_message ('maint_url_status'); -- add maint cat
end
if utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) or -- if any of the 'periodical' cites except encyclopedia
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) then
local chap_param;
if utilities.is_set (Chapter) then -- get a parameter name from one of these chapter related meta-parameters
chap_param = A:ORIGIN ('Chapter')
elseif utilities.is_set (TransChapter) then
chap_param = A:ORIGIN ('TransChapter')
elseif utilities.is_set (ChapterURL) then
chap_param = A:ORIGIN ('ChapterURL')
elseif utilities.is_set (ScriptChapter) then
chap_param = ScriptChapter_origin;
else utilities.is_set (ChapterFormat)
chap_param = A:ORIGIN ('ChapterFormat')
end
if utilities.is_set (chap_param) then -- if we found one
utilities.set_message ('err_chapter_ignored', {chap_param}); -- add error message
Chapter = ''; -- and set them to empty string to be safe with concatenation
TransChapter = '';
ChapterURL = '';
ScriptChapter = '';
ChapterFormat = '';
end
else -- otherwise, format chapter / article title
local no_quotes = false; -- default assume that we will be quoting the chapter parameter value
if utilities.is_set (Contribution) and 0 < #c then -- if this is a contribution with contributor(s)
if utilities.in_array (Contribution:lower(), cfg.keywords_lists.contribution) then -- and a generic contribution title
no_quotes = true; -- then render it unquoted
end
end
Chapter = format_chapter_title (ScriptChapter, ScriptChapter_origin, Chapter, Chapter_origin, TransChapter, TransChapter_origin, ChapterURL, ChapterURL_origin, no_quotes, ChapterUrlAccess); -- Contribution is also in Chapter
if utilities.is_set (Chapter) then
Chapter = Chapter .. ChapterFormat ;
if 'map' == config.CitationClass and utilities.is_set (TitleType) then
Chapter = Chapter .. ' ' .. TitleType; -- map annotation here; not after title
end
Chapter = Chapter .. sepc .. ' ';
elseif utilities.is_set (ChapterFormat) then -- |chapter= not set but |chapter-format= is so ...
Chapter = ChapterFormat .. sepc .. ' '; -- ... ChapterFormat has error message, we want to see it
end
end
-- Format main title
local plain_title = false;
local accept_title;
Title, accept_title = utilities.has_accept_as_written (Title, true); -- remove accept-this-as-written markup when it wraps all of <Title>
if accept_title and ('' == Title) then -- only support forced empty for now "(())"
Title = cfg.messages['notitle']; -- replace by predefined "No title" message
-- TODO: utilities.set_message ( 'err_redundant_parameters', ...); -- issue proper error message instead of muting
ScriptTitle = ''; -- just mute for now
TransTitle = ''; -- just mute for now
plain_title = true; -- suppress text decoration for descriptive title
utilities.set_message ('maint_untitled'); -- add maint cat
end
if not accept_title then -- <Title> not wrapped in accept-as-written markup
if '...' == Title:sub (-3) then -- if ellipsis is the last three characters of |title=
Title = Title:gsub ('(%.%.%.)%.+$', '%1'); -- limit the number of dots to three
elseif not mw.ustring.find (Title, '%.%s*%a%.$') and -- end of title is not a 'dot-(optional space-)letter-dot' initialism ...
not mw.ustring.find (Title, '%s+%a%.$') then -- ...and not a 'space-letter-dot' initial (''Allium canadense'' L.)
Title = mw.ustring.gsub(Title, '%' .. sepc .. '$', ''); -- remove any trailing separator character; sepc and ms.ustring() here for languages that use multibyte separator characters
end
if utilities.is_set (ArchiveURL) and is_archived_copy (Title) then
utilities.set_message ('maint_archived_copy'); -- add maintenance category before we modify the content of Title
end
if is_generic ('generic_titles', Title) then
utilities.set_message ('err_generic_title'); -- set an error message
end
end
if (not plain_title) and (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'mailinglist', 'interview', 'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) or
('map' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)))) then -- special case for cite map when the map is in a periodical treat as an article
Title = kern_quotes (Title); -- if necessary, separate title's leading and trailing quote marks from module provided quote marks
Title = utilities.wrap_style ('quoted-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle );
elseif plain_title or ('report' == config.CitationClass) then -- no styling for cite report and descriptive titles (otherwise same as above)
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle ); -- for cite report, use this form for trans-title
else
Title = utilities.wrap_style ('italic-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-italic-title', TransTitle);
end
if utilities.is_set (TransTitle) then
if utilities.is_set (Title) then
TransTitle = " " .. TransTitle;
else
utilities.set_message ('err_trans_missing_title', {'title'});
end
end
if utilities.is_set (Title) then -- TODO: is this the right place to be making Wikisource URLs?
if utilities.is_set (TitleLink) and utilities.is_set (URL) then
utilities.set_message ('err_wikilink_in_url'); -- set an error message because we can't have both
TitleLink = ''; -- unset
end
if not utilities.is_set (TitleLink) and utilities.is_set (URL) then
Title = external_link (URL, Title, URL_origin, UrlAccess) .. TransTitle .. Format;
URL = ''; -- unset these because no longer needed
Format = "";
elseif utilities.is_set (TitleLink) and not utilities.is_set (URL) then
local ws_url;
ws_url = wikisource_url_make (TitleLink); -- ignore ws_label return; not used here
if ws_url then
Title = external_link (ws_url, Title .. ' ', 'ws link in title-link'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], TitleLink, Title});
Title = Title .. TransTitle;
else
Title = utilities.make_wikilink (TitleLink, Title) .. TransTitle;
end
else
local ws_url, ws_label, L; -- Title has italic or quote markup by the time we get here which causes is_wikilink() to return 0 (not a wikilink)
ws_url, ws_label, L = wikisource_url_make (Title:gsub('^[\'"]*(.-)[\'"]*$', '%1')); -- make ws URL from |title= interwiki link (strip italic or quote markup); link portion L becomes tooltip label
if ws_url then
Title = Title:gsub ('%b[]', ws_label); -- replace interwiki link with ws_label to retain markup
Title = external_link (ws_url, Title .. ' ', 'ws link in title'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, Title});
Title = Title .. TransTitle;
else
Title = Title .. TransTitle;
end
end
else
Title = TransTitle;
end
if utilities.is_set (Place) then
Place = " " .. wrap_msg ('written', Place, use_lowercase) .. sepc .. " ";
end
local ConferenceURL_origin = A:ORIGIN('ConferenceURL'); -- get name of parameter that holds ConferenceURL
if utilities.is_set (Conference) then
if utilities.is_set (ConferenceURL) then
Conference = external_link( ConferenceURL, Conference, ConferenceURL_origin, nil );
end
Conference = sepc .. " " .. Conference .. ConferenceFormat;
elseif utilities.is_set (ConferenceURL) then
Conference = sepc .. " " .. external_link( ConferenceURL, nil, ConferenceURL_origin, nil );
end
local Position = '';
if not utilities.is_set (Position) then
local Minutes = A['Minutes'];
local Time = A['Time'];
if utilities.is_set (Minutes) then
if utilities.is_set (Time) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'minutes') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'time')});
end
Position = " " .. Minutes .. " " .. cfg.messages['minutes'];
else
if utilities.is_set (Time) then
local TimeCaption = A['TimeCaption']
if not utilities.is_set (TimeCaption) then
TimeCaption = cfg.messages['event'];
if sepc ~= '.' then
TimeCaption = TimeCaption:lower();
end
end
Position = " " .. TimeCaption .. " " .. Time;
end
end
else
Position = " " .. Position;
At = '';
end
Page, Pages, Sheet, Sheets = format_pages_sheets (Page, Pages, Sheet, Sheets, config.CitationClass, Periodical_origin, sepc, NoPP, use_lowercase);
At = utilities.is_set (At) and (sepc .. " " .. At) or "";
Position = utilities.is_set (Position) and (sepc .. " " .. Position) or "";
if config.CitationClass == 'map' then
local Sections = A['Sections']; -- Section (singular) is an alias of Chapter so set earlier
local Inset = A['Inset'];
if utilities.is_set ( Inset ) then
Inset = sepc .. " " .. wrap_msg ('inset', Inset, use_lowercase);
end
if utilities.is_set ( Sections ) then
Section = sepc .. " " .. wrap_msg ('sections', Sections, use_lowercase);
elseif utilities.is_set ( Section ) then
Section = sepc .. " " .. wrap_msg ('section', Section, use_lowercase);
end
At = At .. Inset .. Section;
end
local Others = A['Others'];
if utilities.is_set (Others) and 0 == #a and 0 == #e then -- add maint cat when |others= has value and used without |author=, |editor=
if config.CitationClass == "AV-media-notes"
or config.CitationClass == "audio-visual" then -- special maint for AV/M which has a lot of 'false' positives right now
utilities.set_message ('maint_others_avm')
else
utilities.set_message ('maint_others');
end
end
Others = utilities.is_set (Others) and (sepc .. " " .. Others) or "";
if utilities.is_set (Translators) then
Others = safe_join ({sepc .. ' ', wrap_msg ('translated', Translators, use_lowercase), Others}, sepc);
end
if utilities.is_set (Interviewers) then
Others = safe_join ({sepc .. ' ', wrap_msg ('interview', Interviewers, use_lowercase), Others}, sepc);
end
local TitleNote = A['TitleNote'];
TitleNote = utilities.is_set (TitleNote) and (sepc .. " " .. TitleNote) or "";
if utilities.is_set (Edition) then
if Edition:match ('%f[%a][Ee]d%n?%.?$') or Edition:match ('%f[%a][Ee]dition$') then -- Ed, ed, Ed., ed., Edn, edn, Edn., edn.
utilities.set_message ('err_extra_text_edition'); -- add error message
end
Edition = " " .. wrap_msg ('edition', Edition);
else
Edition = '';
end
Series = utilities.is_set (Series) and wrap_msg ('series', {sepc, Series}) or ""; -- not the same as SeriesNum
local Agency = A['Agency'];
Agency = utilities.is_set (Agency) and wrap_msg ('agency', {sepc, Agency}) or "";
Volume = format_volume_issue (Volume, Issue, ArticleNumber, config.CitationClass, Periodical_origin, sepc, use_lowercase);
if utilities.is_set (AccessDate) then
local retrv_text = " " .. cfg.messages['retrieved']
AccessDate = nowrap_date (AccessDate); -- wrap in nowrap span if date in appropriate format
if (sepc ~= ".") then retrv_text = retrv_text:lower() end -- if mode is cs2, lower case
AccessDate = utilities.substitute (retrv_text, AccessDate); -- add retrieved text
AccessDate = utilities.substitute (cfg.presentation['accessdate'], {sepc, AccessDate}); -- allow editors to hide accessdates
end
if utilities.is_set (ID) then ID = sepc .. " " .. ID; end
local Docket = A['Docket'];
if "thesis" == config.CitationClass and utilities.is_set (Docket) then
ID = sepc .. " Docket " .. Docket .. ID;
end
if "report" == config.CitationClass and utilities.is_set (Docket) then -- for cite report when |docket= is set
ID = sepc .. ' ' .. Docket; -- overwrite ID even if |id= is set
end
if utilities.is_set (URL) then
URL = " " .. external_link( URL, nil, URL_origin, UrlAccess );
end
local Quote = A['Quote'];
local TransQuote = A['TransQuote'];
local ScriptQuote = A['ScriptQuote'];
if utilities.is_set (Quote) or utilities.is_set (TransQuote) or utilities.is_set (ScriptQuote) then
if utilities.is_set (Quote) then
if Quote:sub(1, 1) == '"' and Quote:sub(-1, -1) == '"' then -- if first and last characters of quote are quote marks
Quote = Quote:sub(2, -2); -- strip them off
end
end
Quote = kern_quotes (Quote); -- kern if needed
Quote = utilities.wrap_style ('quoted-text', Quote ); -- wrap in <q>...</q> tags
if utilities.is_set (ScriptQuote) then
Quote = script_concatenate (Quote, ScriptQuote, 'script-quote'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after quote is wrapped
end
if utilities.is_set (TransQuote) then
if TransQuote:sub(1, 1) == '"' and TransQuote:sub(-1, -1) == '"' then -- if first and last characters of |trans-quote are quote marks
TransQuote = TransQuote:sub(2, -2); -- strip them off
end
Quote = Quote .. " " .. utilities.wrap_style ('trans-quoted-title', TransQuote );
end
if utilities.is_set (QuotePage) or utilities.is_set (QuotePages) then -- add page prefix
local quote_prefix = '';
if utilities.is_set (QuotePage) then
extra_text_in_page_check (QuotePage, 'quote-page'); -- add to maint cat if |quote-page= value begins with what looks like p., pp., etc.
if not NoPP then
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, QuotePage}), '', '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, QuotePage}), '', '', '';
end
elseif utilities.is_set (QuotePages) then
extra_text_in_page_check (QuotePages, 'quote-pages'); -- add to maint cat if |quote-pages= value begins with what looks like p., pp., etc.
if tonumber(QuotePages) ~= nil and not NoPP then -- if only digits, assume single page
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, QuotePages}), '', '';
elseif not NoPP then
quote_prefix = utilities.substitute (cfg.messages['pp-prefix'], {sepc, QuotePages}), '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, QuotePages}), '', '';
end
end
Quote = quote_prefix .. ": " .. Quote;
else
Quote = sepc .. " " .. Quote;
end
PostScript = ""; -- cs1|2 does not supply terminal punctuation when |quote= is set
end
-- We check length of PostScript here because it will have been nuked by
-- the quote parameters. We'd otherwise emit a message even if there wasn't
-- a displayed postscript.
-- TODO: Should the max size (1) be configurable?
-- TODO: Should we check a specific pattern?
if utilities.is_set(PostScript) and mw.ustring.len(PostScript) > 1 then
utilities.set_message ('maint_postscript')
end
local Archived;
if utilities.is_set (ArchiveURL) then
local arch_text;
if not utilities.is_set (ArchiveDate) then
utilities.set_message ('err_archive_missing_date');
ArchiveDate = ''; -- empty string for concatenation
end
if "live" == UrlStatus then
arch_text = cfg.messages['archived'];
if sepc ~= "." then arch_text = arch_text:lower() end
if utilities.is_set (ArchiveDate) then
Archived = sepc .. ' ' .. utilities.substitute ( cfg.messages['archived-live'],
{external_link( ArchiveURL, arch_text, A:ORIGIN('ArchiveURL'), nil) .. ArchiveFormat, ArchiveDate } );
else
Archived = '';
end
if not utilities.is_set (OriginalURL) then
utilities.set_message ('err_archive_missing_url');
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (OriginalURL) then -- UrlStatus is empty, 'dead', 'unfit', 'usurped', 'bot: unknown'
if utilities.in_array (UrlStatus, {'unfit', 'usurped', 'bot: unknown'}) then
arch_text = cfg.messages['archived-unfit'];
if sepc ~= "." then arch_text = arch_text:lower() end
Archived = sepc .. ' ' .. arch_text .. ArchiveDate; -- format already styled
if 'bot: unknown' == UrlStatus then
utilities.set_message ('maint_bot_unknown'); -- and add a category if not already added
else
utilities.set_message ('maint_unfit'); -- and add a category if not already added
end
else -- UrlStatus is empty, 'dead'
arch_text = cfg.messages['archived-dead'];
if sepc ~= "." then arch_text = arch_text:lower() end
if utilities.is_set (ArchiveDate) then
Archived = sepc .. " " .. utilities.substitute ( arch_text,
{ external_link( OriginalURL, cfg.messages['original'], OriginalURL_origin, OriginalAccess ) .. OriginalFormat, ArchiveDate } ); -- format already styled
else
Archived = ''; -- unset for concatenation
end
end
else -- OriginalUrl not set
arch_text = cfg.messages['archived-missing'];
if sepc ~= "." then arch_text = arch_text:lower() end
utilities.set_message ('err_archive_missing_url');
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (ArchiveFormat) then
Archived = ArchiveFormat; -- if set and ArchiveURL not set ArchiveFormat has error message
else
Archived = '';
end
local Lay = '';
local LaySource = A['LaySource'];
local LayURL = A['LayURL'];
local LayFormat = A['LayFormat'];
LayFormat = style_format (LayFormat, LayURL, 'lay-format', 'lay-url');
if utilities.is_set (LayURL) then
if utilities.is_set (LayDate) then LayDate = " (" .. LayDate .. ")" end
if utilities.is_set (LaySource) then
LaySource = " – ''" .. utilities.safe_for_italics (LaySource) .. "''";
else
LaySource = "";
end
if sepc == '.' then
Lay = sepc .. " " .. external_link( LayURL, cfg.messages['lay summary'], A:ORIGIN('LayURL'), nil ) .. LayFormat .. LaySource .. LayDate
else
Lay = sepc .. " " .. external_link( LayURL, cfg.messages['lay summary']:lower(), A:ORIGIN('LayURL'), nil ) .. LayFormat .. LaySource .. LayDate
end
elseif utilities.is_set (LayFormat) then -- Test if |lay-format= is given without giving a |lay-url=
Lay = sepc .. LayFormat; -- if set and LayURL not set, then LayFormat has error message
end
local TranscriptURL = A['TranscriptURL']
local TranscriptFormat = A['TranscriptFormat'];
TranscriptFormat = style_format (TranscriptFormat, TranscriptURL, 'transcript-format', 'transcripturl');
local Transcript = A['Transcript'];
local TranscriptURL_origin = A:ORIGIN('TranscriptURL'); -- get name of parameter that holds TranscriptURL
if utilities.is_set (Transcript) then
if utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, Transcript, TranscriptURL_origin, nil );
end
Transcript = sepc .. ' ' .. Transcript .. TranscriptFormat;
elseif utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, nil, TranscriptURL_origin, nil );
end
local Publisher;
if utilities.is_set (PublicationDate) then
PublicationDate = wrap_msg ('published', PublicationDate);
end
if utilities.is_set (PublisherName) then
if utilities.is_set (PublicationPlace) then
Publisher = sepc .. " " .. PublicationPlace .. ": " .. PublisherName .. PublicationDate;
else
Publisher = sepc .. " " .. PublisherName .. PublicationDate;
end
elseif utilities.is_set (PublicationPlace) then
Publisher= sepc .. " " .. PublicationPlace .. PublicationDate;
else
Publisher = PublicationDate;
end
local TransPeriodical = A['TransPeriodical'];
local TransPeriodical_origin = A:ORIGIN ('TransPeriodical');
-- Several of the above rely upon detecting this as nil, so do it last.
if (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical) or utilities.is_set (TransPeriodical)) then
if utilities.is_set (Title) or utilities.is_set (TitleNote) then
Periodical = sepc .. " " .. format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
else
Periodical = format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
end
end
local Language = A['Language'];
if utilities.is_set (Language) then
Language = language_parameter (Language); -- format, categories, name from ISO639-1, etc.
else
Language=''; -- language not specified so make sure this is an empty string;
--[[ TODO: need to extract the wrap_msg from language_parameter
so that we can solve parentheses bunching problem with Format/Language/TitleType
]]
end
--[[
Handle the oddity that is cite speech. This code overrides whatever may be the value assigned to TitleNote (through |department=) and forces it to be " (Speech)" so that
the annotation directly follows the |title= parameter value in the citation rather than the |event= parameter value (if provided).
]]
if "speech" == config.CitationClass then -- cite speech only
TitleNote = TitleType; -- move TitleType to TitleNote so that it renders ahead of |event=
TitleType = ''; -- and unset
if utilities.is_set (Periodical) then -- if Periodical, perhaps because of an included |website= or |journal= parameter
if utilities.is_set (Conference) then -- and if |event= is set
Conference = Conference .. sepc .. " "; -- then add appropriate punctuation to the end of the Conference variable before rendering
end
end
end
-- Piece all bits together at last. Here, all should be non-nil.
-- We build things this way because it is more efficient in LUA
-- not to keep reassigning to the same string variable over and over.
local tcommon;
local tcommon2; -- used for book cite when |contributor= is set
if utilities.in_array (config.CitationClass, {"journal", "citation"}) and utilities.is_set (Periodical) then
if not (utilities.is_set (Authors) or utilities.is_set (Editors)) then
Others = Others:gsub ('^' .. sepc .. ' ', ''); -- when no authors and no editors, strip leading sepc and space
end
if utilities.is_set (Others) then Others = safe_join ({Others, sepc .. " "}, sepc) end -- add terminal punctuation & space; check for dup sepc; TODO why do we need to do this here?
tcommon = safe_join( {Others, Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language, Edition, Publisher, Agency, Volume}, sepc );
elseif utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (Periodical) then -- special cases for book cites
if utilities.is_set (Contributors) then -- when we are citing foreword, preface, introduction, etc.
tcommon = safe_join( {Title, TitleNote}, sepc ); -- author and other stuff will come after this and before tcommon2
tcommon2 = safe_join( {Conference, Periodical, Format, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc );
else
tcommon = safe_join( {Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc );
end
elseif 'map' == config.CitationClass then -- special cases for cite map
if utilities.is_set (Chapter) then -- map in a book; TitleType is part of Chapter
tcommon = safe_join( {Title, Format, Edition, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc );
elseif utilities.is_set (Periodical) then -- map in a periodical
tcommon = safe_join( {Title, TitleType, Format, Periodical, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc );
else -- a sheet or stand-alone map
tcommon = safe_join( {Title, TitleType, Format, Edition, Scale, Series, Language, Cartography, Others, Publisher}, sepc );
end
elseif 'episode' == config.CitationClass then -- special case for cite episode
tcommon = safe_join( {Title, TitleNote, TitleType, Series, Language, Edition, Publisher}, sepc );
else -- all other CS1 templates
tcommon = safe_join( {Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language,
Volume, Others, Edition, Publisher, Agency}, sepc );
end
if #ID_list > 0 then
ID_list = safe_join( { sepc .. " ", table.concat( ID_list, sepc .. " " ), ID }, sepc );
else
ID_list = ID;
end
local Via = A['Via'];
Via = utilities.is_set (Via) and wrap_msg ('via', Via) or '';
local idcommon;
if 'audio-visual' == config.CitationClass or 'episode' == config.CitationClass then -- special case for cite AV media & cite episode position transcript
idcommon = safe_join( { ID_list, URL, Archived, Transcript, AccessDate, Via, Lay, Quote }, sepc );
else
idcommon = safe_join( { ID_list, URL, Archived, AccessDate, Via, Lay, Quote }, sepc );
end
local text;
local pgtext = Position .. Sheet .. Sheets .. Page .. Pages .. At;
local OrigDate = A['OrigDate'];
OrigDate = utilities.is_set (OrigDate) and wrap_msg ('origdate', OrigDate) or '';
if utilities.is_set (Date) then
if utilities.is_set (Authors) or utilities.is_set (Editors) then -- date follows authors or editors when authors not set
Date = " (" .. Date .. ")" .. OrigDate .. sepc .. " "; -- in parentheses
else -- neither of authors and editors set
if (string.sub(tcommon, -1, -1) == sepc) then -- if the last character of tcommon is sepc
Date = " " .. Date .. OrigDate; -- Date does not begin with sepc
else
Date = sepc .. " " .. Date .. OrigDate; -- Date begins with sepc
end
end
end
if utilities.is_set (Authors) then
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Authors termination
Authors = terminate_name_list (Authors, sepc); -- when no date, terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Editors) then
local in_text = " ";
local post_text = "";
if utilities.is_set (Chapter) and 0 == #c then
in_text = in_text .. cfg.messages['in'] .. " "
if (sepc ~= '.') then
in_text = in_text:lower() -- lowercase for cs2
end
end
if EditorCount <= 1 then
post_text = " (" .. cfg.messages['editor'] .. ")"; -- be consistent with no-author, no-date case
else
post_text = " (" .. cfg.messages['editors'] .. ")";
end
Editors = terminate_name_list (in_text .. Editors .. post_text, sepc); -- terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Contributors) then -- book cite and we're citing the intro, preface, etc.
local by_text = sepc .. ' ' .. cfg.messages['by'] .. ' ';
if (sepc ~= '.') then by_text = by_text:lower() end -- lowercase for cs2
Authors = by_text .. Authors; -- author follows title so tweak it here
if utilities.is_set (Editors) and utilities.is_set (Date) then -- when Editors make sure that Authors gets terminated
Authors = terminate_name_list (Authors, sepc); -- terminate with 0 or 1 sepc and a space
end
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Contributors termination
Contributors = terminate_name_list (Contributors, sepc); -- terminate with 0 or 1 sepc and a space
end
text = safe_join( {Contributors, Date, Chapter, tcommon, Authors, Place, Editors, tcommon2, pgtext, idcommon }, sepc );
else
text = safe_join( {Authors, Date, Chapter, Place, Editors, tcommon, pgtext, idcommon }, sepc );
end
elseif utilities.is_set (Editors) then
if utilities.is_set (Date) then
if EditorCount <= 1 then
Editors = Editors .. cfg.presentation['sep_name'] .. cfg.messages['editor'];
else
Editors = Editors .. cfg.presentation['sep_name'] .. cfg.messages['editors'];
end
else
if EditorCount <= 1 then
Editors = Editors .. " (" .. cfg.messages['editor'] .. ")" .. sepc .. " "
else
Editors = Editors .. " (" .. cfg.messages['editors'] .. ")" .. sepc .. " "
end
end
text = safe_join( {Editors, Date, Chapter, Place, tcommon, pgtext, idcommon}, sepc );
else
if utilities.in_array (config.CitationClass, {"journal", "citation"}) and utilities.is_set (Periodical) then
text = safe_join( {Chapter, Place, tcommon, pgtext, Date, idcommon}, sepc );
else
text = safe_join( {Chapter, Place, tcommon, Date, pgtext, idcommon}, sepc );
end
end
if utilities.is_set (PostScript) and PostScript ~= sepc then
text = safe_join( {text, sepc}, sepc ); -- Deals with italics, spaces, etc.
text = text:sub(1, -sepc:len() - 1);
end
text = safe_join( {text, PostScript}, sepc );
-- Now enclose the whole thing in a <cite> element
local options_t = {};
options_t.class = cite_class_attribute_make (config.CitationClass, Mode);
local Ref = is_valid_parameter_value (A['Ref'], A:ORIGIN('Ref'), cfg.keywords_lists['ref'], nil, true); -- nil when |ref=harv; A['Ref'] else
if 'none' ~= cfg.keywords_xlate[(Ref and Ref:lower()) or ''] then
local namelist_t = {}; -- holds selected contributor, author, editor name list
local year = first_set ({Year, anchor_year}, 2); -- Year first for legacy citations and for YMD dates that require disambiguation
if #c > 0 then -- if there is a contributor list
namelist_t = c; -- select it
elseif #a > 0 then -- or an author list
namelist_t = a;
elseif #e > 0 then -- or an editor list
namelist_t = e;
end
local citeref_id;
if #namelist_t > 0 then -- if there are names in namelist_t
citeref_id = make_citeref_id (namelist_t, year); -- go make the CITEREF anchor
if mw.uri.anchorEncode (citeref_id) == ((Ref and mw.uri.anchorEncode (Ref)) or '') then -- Ref may already be encoded (by {{sfnref}}) so citeref_id must be encoded before comparison
utilities.set_message ('maint_ref_duplicates_default');
end
else
citeref_id = ''; -- unset
end
options_t.id = Ref or citeref_id;
end
if string.len (text:gsub('%b<>', '')) <= 2 then -- remove html and html-like tags; then get length of what remains;
z.error_cats_t = {}; -- blank the categories list
z.error_msgs_t = {}; -- blank the error messages list
OCinSoutput = nil; -- blank the metadata string
text = ''; -- blank the the citation
utilities.set_message ('err_empty_citation'); -- set empty citation message and category
end
local render_t = {}; -- here we collect the final bits for concatenation into the rendered citation
if utilities.is_set (options_t.id) then -- here we wrap the rendered citation in <cite ...>...</cite> tags
table.insert (render_t, utilities.substitute (cfg.presentation['cite-id'], {mw.uri.anchorEncode(options_t.id), mw.text.nowiki(options_t.class), text})); -- when |ref= is set or when there is a namelist
else
table.insert (render_t, utilities.substitute (cfg.presentation['cite'], {mw.text.nowiki(options_t.class), text})); -- when |ref=none or when namelist_t empty and |ref= is missing or is empty
end
if OCinSoutput then -- blanked when citation is 'empty' so don't bother to add boilerplate metadata span
table.insert (render_t, utilities.substitute (cfg.presentation['ocins'], OCinSoutput)); -- format and append metadata to the citation
end
local template_name = ('citation' == config.CitationClass) and 'citation' or 'cite ' .. (cfg.citation_class_map_t[config.CitationClass] or config.CitationClass);
local template_link = '[[Template:' .. template_name .. '|' .. template_name .. ']]';
local msg_prefix = '<code class="cs1-code">{{' .. template_link .. '}}</code>: ';
if 0 ~= #z.error_msgs_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_e, template_link));
table.insert (render_t, ' '); -- insert a space between citation and its error messages
table.sort (z.error_msgs_t); -- sort the error messages list; sorting includes wrapping <span> and <code> tags; hidden-error sorts ahead of visible-error
local hidden = true; -- presume that the only error messages emited by this template are hidden
for _, v in ipairs (z.error_msgs_t) do -- spin through the list of error messages
if v:find ('cs1-visible-error', 1, true) then -- look for the visible error class name
hidden = false; -- found one; so don't hide the error message prefix
break; -- and done because no need to look further
end
end
z.error_msgs_t[1] = table.concat ({utilities.error_comment (msg_prefix, hidden), z.error_msgs_t[1]}); -- add error message prefix to first error message to prevent extraneous punctuation
table.insert (render_t, table.concat (z.error_msgs_t, '; ')); -- make a big string of error messages and add it to the rendering
end
if 0 ~= #z.maint_cats_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_m, template_link));
table.sort (z.maint_cats_t); -- sort the maintenance messages list
local maint_msgs_t = {}; -- here we collect all of the maint messages
if 0 == #z.error_msgs_t then -- if no error messages
table.insert (maint_msgs_t, msg_prefix); -- insert message prefix in maint message livery
end
for _, v in ipairs( z.maint_cats_t ) do -- append maintenance categories
table.insert (maint_msgs_t, -- assemble new maint message and add it to the maint_msgs_t table
table.concat ({v, ' (', utilities.substitute (cfg.messages[':cat wikilink'], v), ')'})
);
end
table.insert (render_t, utilities.substitute (cfg.presentation['hidden-maint'], table.concat (maint_msgs_t, ' '))); -- wrap the group of maint messages with proper presentation and save
end
if not no_tracking_cats then
for _, v in ipairs (z.error_cats_t) do -- append error categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v));
end
for _, v in ipairs (z.maint_cats_t) do -- append maintenance categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v));
end
for _, v in ipairs (z.prop_cats_t) do -- append properties categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v));
end
end
return table.concat (render_t); -- make a big string and done
end
--[[--------------------------< V A L I D A T E >--------------------------------------------------------------
Looks for a parameter's name in one of several whitelists.
Parameters in the whitelist can have three values:
true - active, supported parameters
false - deprecated, supported parameters
nil - unsupported parameters
]]
local function validate (name, cite_class, empty)
local name = tostring (name);
local enum_name; -- for enumerated parameters, is name with enumerator replaced with '#'
local state;
local function state_test (state, name) -- local function to do testing of state values
if true == state then return true; end -- valid actively supported parameter
if false == state then
if empty then return nil; end -- empty deprecated parameters are treated as unknowns
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
if 'tracked' == state then
local base_name = name:gsub ('%d', ''); -- strip enumerators from parameter names that have them to get the base name
utilities.add_prop_cat ('tracked-param', {base_name}, base_name); -- add a properties category; <base_name> modifies <key>
return true;
end
return nil;
end
if name:find ('#') then -- # is a cs1|2 reserved character so parameters with # not permitted
return nil;
end
if utilities.in_array (cite_class, whitelist.preprint_template_list ) then -- limited parameter sets allowed for these templates
state = whitelist.limited_basic_arguments[name];
if true == state_test (state, name) then return true; end
state = whitelist.preprint_arguments[cite_class][name]; -- look in the parameter-list for the template identified by cite_class
if true == state_test (state, name) then return true; end
-- limited enumerated parameters list
enum_name = name:gsub("%d+", "#" ); -- replace digit(s) with # (last25 becomes last#) (mw.ustring because non-Western 'local' digits)
state = whitelist.limited_numbered_arguments[enum_name];
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end -- end limited parameter-set templates
if utilities.in_array (cite_class, whitelist.unique_param_template_list) then -- experiment for template-specific parameters for templates that accept parameters from the basic argument list
state = whitelist.unique_arguments[cite_class][name]; -- look in the template-specific parameter-lists for the template identified by cite_class
if true == state_test (state, name) then return true; end
end -- if here, fall into general validation
state = whitelist.basic_arguments[name]; -- all other templates; all normal parameters allowed
if true == state_test (state, name) then return true; end
-- all enumerated parameters allowed
enum_name = name:gsub("%d+", "#" ); -- replace digit(s) with # (last25 becomes last#) (mw.ustring because non-Western 'local' digits)
state = whitelist.numbered_arguments[enum_name];
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end
--[=[-------------------------< I N T E R _ W I K I _ C H E C K >----------------------------------------------
check <value> for inter-language interwiki-link markup. <prefix> must be a MediaWiki-recognized language
code. when these values have the form (without leading colon):
[[<prefix>:link|label]] return label as plain-text
[[<prefix>:link]] return <prefix>:link as plain-text
return value as is else
]=]
local function inter_wiki_check (parameter, value)
local prefix = value:match ('%[%[(%a+):'); -- get an interwiki prefix if one exists
local _;
if prefix and cfg.inter_wiki_map[prefix:lower()] then -- if prefix is in the map, needs preceding colon so
utilities.set_message ('err_bad_paramlink', parameter); -- emit an error message
_, value, _ = utilities.is_wikilink (value); -- extract label portion from wikilink
end
return value;
end
--[[--------------------------< M I S S I N G _ P I P E _ C H E C K >------------------------------------------
Look at the contents of a parameter. If the content has a string of characters and digits followed by an equal
sign, compare the alphanumeric string to the list of cs1|2 parameters. If found, then the string is possibly a
parameter that is missing its pipe. There are two tests made:
{{cite ... |title=Title access-date=2016-03-17}} -- the first parameter has a value and whitespace separates that value from the missing pipe parameter name
{{cite ... |title=access-date=2016-03-17}} -- the first parameter has no value (whitespace after the first = is trimmed by MediaWiki)
cs1|2 shares some parameter names with XML/HTML attributes: class=, title=, etc. To prevent false positives XML/HTML
tags are removed before the search.
If a missing pipe is detected, this function adds the missing pipe maintenance category.
]]
local function missing_pipe_check (parameter, value)
local capture;
value = value:gsub ('%b<>', ''); -- remove XML/HTML tags because attributes: class=, title=, etc.
capture = value:match ('%s+(%a[%w%-]+)%s*=') or value:match ('^(%a[%w%-]+)%s*='); -- find and categorize parameters with possible missing pipes
if capture and validate (capture) then -- if the capture is a valid parameter name
utilities.set_message ('err_missing_pipe', parameter);
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ P U N C T >--------------------------------------
look for extraneous terminal punctuation in most parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_punc (param, value)
if 'number' == type (param) then
return;
end
param = param:gsub ('%d+', '#'); -- enumerated name-list mask params allow terminal punct; normalize
if cfg.punct_skip[param] then
return; -- parameter name found in the skip table so done
end
if value:match ('[,;:]$') then
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
if value:match ('^=') then -- sometimes an extraneous '=' character appears ...
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ U R L >------------------------------------------
look for extraneous url parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_url (url_param_t)
local url_error_t = {};
check_for_url (url_param_t, url_error_t); -- extraneous url check
if 0 ~= #url_error_t then -- non-zero when there are errors
table.sort (url_error_t);
utilities.set_message ('err_param_has_ext_link', {utilities.make_sep_list (#url_error_t, url_error_t)}); -- add this error message
end
end
--[[--------------------------< C I T A T I O N >--------------------------------------------------------------
This is used by templates such as {{cite book}} to create the actual citation text.
]]
local function citation(frame)
Frame = frame; -- save a copy in case we need to display an error message in preview mode
local config = {}; -- table to store parameters from the module {{#invoke:}}
for k, v in pairs( frame.args ) do -- get parameters from the {{#invoke}} frame
config[k] = v;
-- args[k] = v; -- crude debug support that allows us to render a citation from module {{#invoke:}}; skips parameter validation; TODO: keep?
end
-- i18n: set the name that your wiki uses to identify sandbox subpages from sandbox template invoke (or can be set here)
local sandbox = ((config.SandboxPath and '' ~= config.SandboxPath) and config.SandboxPath) or '/sandbox'; -- sandbox path from {{#invoke:Citation/CS1/sandbox|citation|SandboxPath=/...}}
is_sandbox = nil ~= string.find (frame:getTitle(), sandbox, 1, true); -- is this invoke the sandbox module?
sandbox = is_sandbox and sandbox or ''; -- use i18n sandbox to load sandbox modules when this module is the sandox; live modules else
local pframe = frame:getParent()
local styles;
cfg = mw.loadData ('Module:Citation/CS1/Configuration' .. sandbox); -- load sandbox versions of support modules when {{#invoke:Citation/CS1/sandbox|...}}; live modules else
whitelist = mw.loadData ('Module:Citation/CS1/Whitelist' .. sandbox);
utilities = require ('Module:Citation/CS1/Utilities' .. sandbox);
validation = require ('Module:Citation/CS1/Date_validation' .. sandbox);
identifiers = require ('Module:Citation/CS1/Identifiers' .. sandbox);
metadata = require ('Module:Citation/CS1/COinS' .. sandbox);
styles = 'Module:Citation/CS1' .. sandbox .. '/styles.css';
utilities.set_selected_modules (cfg); -- so that functions in Utilities can see the selected cfg tables
identifiers.set_selected_modules (cfg, utilities); -- so that functions in Identifiers can see the selected cfg tables and selected Utilities module
validation.set_selected_modules (cfg, utilities); -- so that functions in Date validataion can see selected cfg tables and the selected Utilities module
metadata.set_selected_modules (cfg, utilities); -- so that functions in COinS can see the selected cfg tables and selected Utilities module
z = utilities.z; -- table of error and category tables in Module:Citation/CS1/Utilities
is_preview_mode = not utilities.is_set (frame:preprocess ('{{REVISIONID}}'));
local args = {}; -- table where we store all of the template's arguments
local suggestions = {}; -- table where we store suggestions if we need to loadData them
local error_text; -- used as a flag
local capture; -- the single supported capture when matching unknown parameters using patterns
local empty_unknowns = {}; -- sequence table to hold empty unknown params for error message listing
for k, v in pairs( pframe.args ) do -- get parameters from the parent (template) frame
v = mw.ustring.gsub (v, '^%s*(.-)%s*$', '%1'); -- trim leading/trailing whitespace; when v is only whitespace, becomes empty string
if v ~= '' then
if ('string' == type (k)) then
k = mw.ustring.gsub (k, '%d', cfg.date_names.local_digits); -- for enumerated parameters, translate 'local' digits to Western 0-9
end
if not validate( k, config.CitationClass ) then
if type (k) ~= 'string' then -- exclude empty numbered parameters
if v:match("%S+") ~= nil then
error_text = utilities.set_message ('err_text_ignored', {v});
end
elseif validate (k:lower(), config.CitationClass) then
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, k:lower()}); -- suggest the lowercase version of the parameter
else
if nil == suggestions.suggestions then -- if this table is nil then we need to load it
suggestions = mw.loadData ('Module:Citation/CS1/Suggestions' .. sandbox); --load sandbox version of suggestion module when {{#invoke:Citation/CS1/sandbox|...}}; live module else
end
for pattern, param in pairs (suggestions.patterns) do -- loop through the patterns to see if we can suggest a proper parameter
capture = k:match (pattern); -- the whole match if no capture in pattern else the capture if a match
if capture then -- if the pattern matches
param = utilities.substitute (param, capture); -- add the capture to the suggested parameter (typically the enumerator)
if validate (param, config.CitationClass) then -- validate the suggestion to make sure that the suggestion is supported by this template (necessary for limited parameter lists)
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, param}); -- set the suggestion error message
else
error_text = utilities.set_message ('err_parameter_ignored', {k}); -- suggested param not supported by this template
v = ''; -- unset
end
end
end
if not utilities.is_set (error_text) then -- couldn't match with a pattern, is there an explicit suggestion?
if (suggestions.suggestions[ k:lower() ] ~= nil) and validate (suggestions.suggestions[ k:lower() ], config.CitationClass) then
utilities.set_message ('err_parameter_ignored_suggest', {k, suggestions.suggestions[ k:lower() ]});
else
utilities.set_message ('err_parameter_ignored', {k});
v = ''; -- unset value assigned to unrecognized parameters (this for the limited parameter lists)
end
end
end
end
args[k] = v; -- save this parameter and its value
elseif not utilities.is_set (v) then -- for empty parameters
if not validate (k, config.CitationClass, true) then -- is this empty parameter a valid parameter
k = ('' == k) and '(empty string)' or k; -- when k is empty string (or was space(s) trimmed to empty string), replace with descriptive text
table.insert (empty_unknowns, utilities.wrap_style ('parameter', k)); -- format for error message and add to the list
end
-- crude debug support that allows us to render a citation from module {{#invoke:}} TODO: keep?
-- elseif args[k] ~= nil or (k == 'postscript') then -- when args[k] has a value from {{#invoke}} frame (we don't normally do that)
-- args[k] = v; -- overwrite args[k] with empty string from pframe.args[k] (template frame); v is empty string here
end -- not sure about the postscript bit; that gets handled in parameter validation; historical artifact?
end
if 0 ~= #empty_unknowns then -- create empty unknown error message
utilities.set_message ('err_param_unknown_empty', {
1 == #empty_unknowns and '' or 's',
utilities.make_sep_list (#empty_unknowns, empty_unknowns)
});
end
local url_param_t = {};
for k, v in pairs( args ) do
if 'string' == type (k) then -- don't evaluate positional parameters
has_invisible_chars (k, v); -- look for invisible characters
end
has_extraneous_punc (k, v); -- look for extraneous terminal punctuation in parameter values
missing_pipe_check (k, v); -- do we think that there is a parameter that is missing a pipe?
args[k] = inter_wiki_check (k, v); -- when language interwiki-linked parameter missing leading colon replace with wiki-link label
if 'string' == type (k) and not cfg.url_skip[k] then -- when parameter k is not positional and not in url skip table
url_param_t[k] = v; -- make a parameter/value list for extraneous url check
end
end
has_extraneous_url (url_param_t); -- look for url in parameter values where a url does not belong
return table.concat ({
frame:extensionTag ('templatestyles', '', {src=styles}),
citation0( config, args)
});
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {citation = citation};
9bfe095ac3f64719c64a17280b76d0add203ad61
Module:Citation/CS1/Configuration
828
112
233
232
2023-08-10T15:23:10Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Citation/CS1/Configuration]]
Scribunto
text/plain
local lang_obj = mw.language.getContentLanguage(); -- make a language object for the local language; used here for languages and dates
--[[--------------------------< U N C A T E G O R I Z E D _ N A M E S P A C E S >------------------------------
List of namespaces identifiers for namespaces that will not be included in citation error categories.
Same as setting notracking = true by default.
For wikis that have a current version of Module:cs1 documentation support, this #invoke will return an unordered
list of namespace names and their associated identifiers:
{{#invoke:cs1 documentation support|uncategorized_namespace_lister|all=<anything>}}
]]
uncategorized_namespaces_t = {[2]=true}; -- init with user namespace id
for k, _ in pairs (mw.site.talkNamespaces) do -- add all talk namespace ids
uncategorized_namespaces_t[k] = true;
end
local uncategorized_subpages = {'/[Ss]andbox', '/[Tt]estcases', '/[^/]*[Ll]og', '/[Aa]rchive'}; -- list of Lua patterns found in page names of pages we should not categorize
--[[--------------------------< M E S S A G E S >--------------------------------------------------------------
Translation table
The following contains fixed text that may be output as part of a citation.
This is separated from the main body to aid in future translations of this
module.
]]
local messages = {
['agency'] = '$1 $2', -- $1 is sepc, $2 is agency
['archived-dead'] = 'Archived from $1 on $2',
['archived-live'] = '$1 from the original on $2',
['archived-missing'] = 'Archived from the original $1 on $2',
['archived-unfit'] = 'Archived from the original on ',
['archived'] = 'Archived',
['by'] = 'By', -- contributions to authored works: introduction, foreword, afterword
['cartography'] = 'Cartography by $1',
['editor'] = 'ed.',
['editors'] = 'eds.',
['edition'] = '($1 ed.)',
['episode'] = 'Episode $1',
['et al'] = 'et al.',
['in'] = 'In', -- edited works
['inactive'] = 'inactive',
['inset'] = '$1 inset',
['interview'] = 'Interviewed by $1',
['lay summary'] = 'Lay summary',
['mismatch'] = '<code class="cs1-code">|$1=</code> / <code class="cs1-code">|$2=</code> mismatch', -- $1 is year param name; $2 is date param name
['newsgroup'] = '[[Usenet newsgroup|Newsgroup]]: $1',
['notitle'] = 'No title', -- for |title=(()) and (in the future) |title=none
['original'] = 'the original',
['origdate'] = ' [$1]',
['published'] = ' (published $1)',
['retrieved'] = 'Retrieved $1',
['season'] = 'Season $1',
['section'] = '§ $1',
['sections'] = '§§ $1',
['series'] = '$1 $2', -- $1 is sepc, $2 is series
['seriesnum'] = 'Series $1',
['translated'] = 'Translated by $1',
['type'] = ' ($1)', -- for titletype
['written'] = 'Written at $1',
['vol'] = '$1 Vol. $2', -- $1 is sepc; bold journal style volume is in presentation{}
['vol-no'] = '$1 Vol. $2, no. $3', -- sepc, volume, issue (alternatively insert $1 after $2, but then we'd also have to change capitalization)
['issue'] = '$1 No. $2', -- $1 is sepc
['art'] = '$1 Art. $2', -- $1 is sepc; for {{cite conference}} only
['vol-art'] = '$1 Vol. $2, art. $3', -- sepc, volume, article-number; for {{cite conference}} only
['j-vol'] = '$1 $2', -- sepc, volume; bold journal volume is in presentation{}
['j-issue'] = ' ($1)',
['j-article-num'] = ' $1', -- TODO: any punctuation here? static text?
['nopp'] = '$1 $2'; -- page(s) without prefix; $1 is sepc
['p-prefix'] = "$1 p. $2", -- $1 is sepc
['pp-prefix'] = "$1 pp. $2", -- $1 is sepc
['j-page(s)'] = ': $1', -- same for page and pages
['sheet'] = '$1 Sheet $2', -- $1 is sepc
['sheets'] = '$1 Sheets $2', -- $1 is sepc
['j-sheet'] = ': Sheet $1',
['j-sheets'] = ': Sheets $1',
['language'] = '(in $1)',
['via'] = " – via $1",
['event'] = 'Event occurs at',
['minutes'] = 'minutes in',
-- Determines the location of the help page
['help page link'] = 'Help:CS1 errors',
['help page label'] = 'help',
-- categories
['cat wikilink'] = '[[Category:$1]]', -- $1 is the category name
[':cat wikilink'] = '[[:Category:$1|link]]', -- category name as maintenance message wikilink; $1 is the category name
-- Internal errors (should only occur if configuration is bad)
['undefined_error'] = 'Called with an undefined error condition',
['unknown_ID_key'] = 'Unrecognized ID key: ', -- an ID key in id_handlers not found in ~/Identifiers func_map{}
['unknown_ID_access'] = 'Unrecognized ID access keyword: ', -- an ID access keyword in id_handlers not found in keywords_lists['id-access']{}
['unknown_argument_map'] = 'Argument map not defined for this variable',
['bare_url_no_origin'] = 'Bare URL found but origin indicator is nil or empty',
['warning_msg_e'] = '<span style="color:#d33">One or more <code style="color: inherit; background: inherit; border: none; padding: inherit;">{{$1}}</code> templates have errors</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link
['warning_msg_m'] = '<span style="color:#3a3">One or more <code style="color: inherit; background: inherit; border: none; padding: inherit;">{{$1}}</code> templates have maintenance messages</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link
}
--[[--------------------------< C I T A T I O N _ C L A S S _ M A P >------------------------------------------
this table maps the value assigned to |CitationClass= in the cs1|2 templates to the canonical template name when
the value assigned to |CitationClass= is different from the canonical template name. |CitationClass= values are
used as class attributes in the <cite> tag that encloses the citation so these names may not contain spaces while
the canonical template name may. These names are used in warning_msg_e and warning_msg_m to create links to the
template's documentation when an article is displayed in preview mode.
Most cs1|2 template |CitationClass= values at en.wiki match their canonical template names so are not listed here.
]]
local citation_class_map_t = { -- TODO: if kept, these and all other config.CitationClass 'names' require some sort of i18n
['audio-visual'] = 'AV media',
['AV-media-notes'] = 'AV media notes',
['encyclopaedia'] = 'encyclopedia',
['mailinglist'] = 'mailing list',
['pressrelease'] = 'press release'
}
--[=[-------------------------< E T _ A L _ P A T T E R N S >--------------------------------------------------
This table provides Lua patterns for the phrase "et al" and variants in name text
(author, editor, etc.). The main module uses these to identify and emit the 'etal' message.
]=]
local et_al_patterns = {
"[;,]? *[\"']*%f[%a][Ee][Tt]%.? *[Aa][Ll][%.;,\"']*$", -- variations on the 'et al' theme
"[;,]? *[\"']*%f[%a][Ee][Tt]%.? *[Aa][Ll][Ii][AaIi][Ee]?[%.;,\"']*$", -- variations on the 'et alia', 'et alii' and 'et aliae' themes (false positive 'et aliie' unlikely to match)
"[;,]? *%f[%a]and [Oo]thers", -- an alternative to et al.
"%[%[ *[Ee][Tt]%.? *[Aa][Ll]%.? *%]%]", -- a wikilinked form
"%(%( *[Ee][Tt]%.? *[Aa][Ll]%.? *%)%)", -- a double-bracketed form (to counter partial removal of ((...)) syntax)
"[%(%[] *[Ee][Tt]%.? *[Aa][Ll]%.? *[%)%]]", -- a bracketed form
}
--[[--------------------------< P R E S E N T A T I O N >------------------------
Fixed presentation markup. Originally part of citation_config.messages it has
been moved into its own, more semantically correct place.
]]
local presentation =
{
-- .citation-comment class is specified at Help:CS1_errors#Controlling_error_message_display
['hidden-error'] = '<span class="cs1-hidden-error citation-comment">$1</span>',
['visible-error'] = '<span class="cs1-visible-error citation-comment">$1</span>',
['hidden-maint'] = '<span class="cs1-maint citation-comment">$1</span>',
['accessdate'] = '<span class="reference-accessdate">$1$2</span>', -- to allow editors to hide accessdate using personal CSS
['bdi'] = '<bdi$1>$2</bdi>', -- bidirectional isolation used with |script-title= and the like
['cite'] = '<cite class="$1">$2</cite>'; -- for use when citation does not have a namelist and |ref= not set so no id="..." attribute
['cite-id'] = '<cite id="$1" class="$2">$3</cite>'; -- for use when when |ref= is set or when citation has a namelist
['format'] = ' <span class="cs1-format">($1)</span>', -- for |format=, |chapter-format=, etc.
['interwiki'] = ' <span class="cs1-format">[in $1]</span>', -- for interwiki-language-linked author, editor, etc
['interproj'] = ' <span class="cs1-format">[at $1]</span>', -- for interwiki-project-linked author, editor, etc (:d: and :s: supported; :w: ignored)
-- various access levels, for |access=, |doi-access=, |arxiv=, ...
-- narrow no-break space   may work better than nowrap CSS. Or not? Browser support?
['ext-link-access-signal'] = '<span class="$1" title="$2">$3</span>', -- external link with appropriate lock icon
['free'] = {class='cs1-lock-free', title='Freely accessible'}, -- classes defined in Module:Citation/CS1/styles.css
['registration'] = {class='cs1-lock-registration', title='Free registration required'},
['limited'] = {class='cs1-lock-limited', title='Free access subject to limited trial, subscription normally required'},
['subscription'] = {class='cs1-lock-subscription', title='Paid subscription required'},
['interwiki-icon'] = '<span class="$1" title="$2">$3</span>',
['class-wikisource'] = 'cs1-ws-icon',
['italic-title'] = "''$1''",
['kern-left'] = '<span class="cs1-kern-left"></span>$1', -- spacing to use when title contains leading single or double quote mark
['kern-right'] = '$1<span class="cs1-kern-right"></span>', -- spacing to use when title contains trailing single or double quote mark
['nowrap1'] = '<span class="nowrap">$1</span>', -- for nowrapping an item: <span ...>yyyy-mm-dd</span>
['nowrap2'] = '<span class="nowrap">$1</span> $2', -- for nowrapping portions of an item: <span ...>dd mmmm</span> yyyy (note white space)
['ocins'] = '<span title="$1" class="Z3988"></span>',
['parameter'] = '<code class="cs1-code">|$1=</code>',
['ps_cs1'] = '.'; -- CS1 style postscript (terminal) character
['ps_cs2'] = ''; -- CS2 style postscript (terminal) character (empty string)
['quoted-text'] = '<q>$1</q>', -- for wrapping |quote= content
['quoted-title'] = '"$1"',
['sep_cs1'] = '.', -- CS1 element separator
['sep_cs2'] = ',', -- CS2 separator
['sep_nl'] = ';', -- CS1|2 style name-list separator between names is a semicolon
['sep_nl_and'] = ' and ', -- used as last nl sep when |name-list-style=and and list has 2 items
['sep_nl_end'] = '; and ', -- used as last nl sep when |name-list-style=and and list has 3+ names
['sep_name'] = ', ', -- CS1|2 style last/first separator is <comma><space>
['sep_nl_vanc'] = ',', -- Vancouver style name-list separator between authors is a comma
['sep_name_vanc'] = ' ', -- Vancouver style last/first separator is a space
['sep_list'] = ', ', -- used for |language= when list has 3+ items except for last sep which uses sep_list_end
['sep_list_pair'] = ' and ', -- used for |language= when list has 2 items
['sep_list_end'] = ', and ', -- used as last list sep for |language= when list has 3+ items
['trans-italic-title'] = "[''$1'']",
['trans-quoted-title'] = "[$1]", -- for |trans-title= and |trans-quote=
['vol-bold'] = '$1 <b>$2</b>', -- sepc, volume; for bold journal cites; for other cites ['vol'] in messages{}
}
--[[--------------------------< A L I A S E S >---------------------------------
Aliases table for commonly passed parameters.
Parameter names on the right side in the assignments in this table must have been
defined in the Whitelist before they will be recognized as valid parameter names
]]
local aliases = {
['AccessDate'] = {'access-date', 'accessdate'}, -- Used by InternetArchiveBot
['Agency'] = 'agency',
['ArchiveDate'] = {'archive-date', 'archivedate'}, -- Used by InternetArchiveBot
['ArchiveFormat'] = 'archive-format',
['ArchiveURL'] = {'archive-url', 'archiveurl'}, -- Used by InternetArchiveBot
['ArticleNumber'] = 'article-number',
['ASINTLD'] = 'asin-tld',
['At'] = 'at', -- Used by InternetArchiveBot
['Authors'] = {'authors', 'people', 'credits'},
['BookTitle'] = {'book-title', 'booktitle'},
['Cartography'] = 'cartography',
['Chapter'] = {'chapter', 'contribution', 'entry', 'article', 'section'},
['ChapterFormat'] = {'chapter-format', 'contribution-format', 'entry-format',
'article-format', 'section-format'};
['ChapterURL'] = {'chapter-url', 'contribution-url', 'entry-url', 'article-url', 'section-url', 'chapterurl'}, -- Used by InternetArchiveBot
['ChapterUrlAccess'] = {'chapter-url-access', 'contribution-url-access',
'entry-url-access', 'article-url-access', 'section-url-access'}, -- Used by InternetArchiveBot
['Class'] = 'class', -- cite arxiv and arxiv identifier
['Collaboration'] = 'collaboration',
['Conference'] = {'conference', 'event'},
['ConferenceFormat'] = 'conference-format',
['ConferenceURL'] = 'conference-url', -- Used by InternetArchiveBot
['Date'] = {'date', 'air-date', 'airdate'}, -- air-date and airdate for cite episode and cite serial only
['Degree'] = 'degree',
['DF'] = 'df',
['DisplayAuthors'] = {'display-authors', 'display-subjects'},
['DisplayContributors'] = 'display-contributors',
['DisplayEditors'] = 'display-editors',
['DisplayInterviewers'] = 'display-interviewers',
['DisplayTranslators'] = 'display-translators',
['Docket'] = 'docket',
['DoiBroken'] = 'doi-broken-date',
['Edition'] = 'edition',
['Embargo'] = 'pmc-embargo-date',
['Encyclopedia'] = {'encyclopedia', 'encyclopaedia', 'dictionary'}, -- cite encyclopedia only
['Episode'] = 'episode', -- cite serial only TODO: make available to cite episode?
['Format'] = 'format',
['ID'] = {'id', 'ID'},
['Inset'] = 'inset',
['Issue'] = {'issue', 'number'},
['Language'] = {'language', 'lang'},
['LayDate'] = 'lay-date',
['LayFormat'] = 'lay-format',
['LaySource'] = 'lay-source',
['LayURL'] = 'lay-url',
['MailingList'] = {'mailing-list', 'mailinglist'}, -- cite mailing list only
['Map'] = 'map', -- cite map only
['MapFormat'] = 'map-format', -- cite map only
['MapURL'] = {'map-url', 'mapurl'}, -- cite map only -- Used by InternetArchiveBot
['MapUrlAccess'] = 'map-url-access', -- cite map only -- Used by InternetArchiveBot
['Minutes'] = 'minutes',
['Mode'] = 'mode',
['NameListStyle'] = 'name-list-style',
['Network'] = 'network',
['Newsgroup'] = 'newsgroup', -- cite newsgroup only
['NoPP'] = {'no-pp', 'nopp'},
['NoTracking'] = {'no-tracking', 'template-doc-demo'},
['Number'] = 'number', -- this case only for cite techreport
['OrigDate'] = {'orig-date', 'orig-year', 'origyear'},
['Others'] = 'others',
['Page'] = {'page', 'p'}, -- Used by InternetArchiveBot
['Pages'] = {'pages', 'pp'}, -- Used by InternetArchiveBot
['Periodical'] = {'journal', 'magazine', 'newspaper', 'periodical', 'website', 'work'},
['Place'] = {'place', 'location'},
['PostScript'] = 'postscript',
['PublicationDate'] = {'publication-date', 'publicationdate'},
['PublicationPlace'] = {'publication-place', 'publicationplace'},
['PublisherName'] = {'publisher', 'institution'},
['Quote'] = {'quote', 'quotation'},
['QuotePage'] = 'quote-page',
['QuotePages'] = 'quote-pages',
['Ref'] = 'ref',
['Scale'] = 'scale',
['ScriptChapter'] = {'script-chapter', 'script-contribution', 'script-entry',
'script-article', 'script-section'},
['ScriptMap'] = 'script-map',
['ScriptPeriodical'] = {'script-journal', 'script-magazine', 'script-newspaper',
'script-periodical', 'script-website', 'script-work'},
['ScriptQuote'] = 'script-quote',
['ScriptTitle'] = 'script-title', -- Used by InternetArchiveBot
['Season'] = 'season',
['Sections'] = 'sections', -- cite map only
['Series'] = {'series', 'version'},
['SeriesLink'] = {'series-link', 'serieslink'},
['SeriesNumber'] = {'series-number', 'series-no'},
['Sheet'] = 'sheet', -- cite map only
['Sheets'] = 'sheets', -- cite map only
['Station'] = 'station',
['Time'] = 'time',
['TimeCaption'] = 'time-caption',
['Title'] = 'title', -- Used by InternetArchiveBot
['TitleLink'] = {'title-link', 'episode-link', 'episodelink'}, -- Used by InternetArchiveBot
['TitleNote'] = 'department',
['TitleType'] = {'type', 'medium'},
['TransChapter'] = {'trans-article', 'trans-chapter', 'trans-contribution',
'trans-entry', 'trans-section'},
['Transcript'] = 'transcript',
['TranscriptFormat'] = 'transcript-format',
['TranscriptURL'] = {'transcript-url', 'transcripturl'}, -- Used by InternetArchiveBot
['TransMap'] = 'trans-map', -- cite map only
['TransPeriodical'] = {'trans-journal', 'trans-magazine', 'trans-newspaper',
'trans-periodical', 'trans-website', 'trans-work'},
['TransQuote'] = 'trans-quote',
['TransTitle'] = 'trans-title', -- Used by InternetArchiveBot
['URL'] = {'url', 'URL'}, -- Used by InternetArchiveBot
['UrlAccess'] = 'url-access', -- Used by InternetArchiveBot
['UrlStatus'] = 'url-status', -- Used by InternetArchiveBot
['Vauthors'] = 'vauthors',
['Veditors'] = 'veditors',
['Via'] = 'via',
['Volume'] = 'volume',
['Year'] = 'year',
['AuthorList-First'] = {"first#", "author-first#", "author#-first", "given#",
"author-given#", "author#-given"},
['AuthorList-Last'] = {"last#", "author-last#", "author#-last", "surname#",
"author-surname#", "author#-surname", "author#", "subject#", 'host#'},
['AuthorList-Link'] = {"author-link#", "author#-link", "subject-link#",
"subject#-link", "authorlink#", "author#link"},
['AuthorList-Mask'] = {"author-mask#", "author#-mask", "subject-mask#", "subject#-mask"},
['ContributorList-First'] = {'contributor-first#', 'contributor#-first',
'contributor-given#', 'contributor#-given'},
['ContributorList-Last'] = {'contributor-last#', 'contributor#-last',
'contributor-surname#', 'contributor#-surname', 'contributor#'},
['ContributorList-Link'] = {'contributor-link#', 'contributor#-link'},
['ContributorList-Mask'] = {'contributor-mask#', 'contributor#-mask'},
['EditorList-First'] = {"editor-first#", "editor#-first", "editor-given#", "editor#-given"},
['EditorList-Last'] = {"editor-last#", "editor#-last", "editor-surname#",
"editor#-surname", "editor#"},
['EditorList-Link'] = {"editor-link#", "editor#-link"},
['EditorList-Mask'] = {"editor-mask#", "editor#-mask"},
['InterviewerList-First'] = {'interviewer-first#', 'interviewer#-first',
'interviewer-given#', 'interviewer#-given'},
['InterviewerList-Last'] = {'interviewer-last#', 'interviewer#-last',
'interviewer-surname#', 'interviewer#-surname', 'interviewer#'},
['InterviewerList-Link'] = {'interviewer-link#', 'interviewer#-link'},
['InterviewerList-Mask'] = {'interviewer-mask#', 'interviewer#-mask'},
['TranslatorList-First'] = {'translator-first#', 'translator#-first',
'translator-given#', 'translator#-given'},
['TranslatorList-Last'] = {'translator-last#', 'translator#-last',
'translator-surname#', 'translator#-surname', 'translator#'},
['TranslatorList-Link'] = {'translator-link#', 'translator#-link'},
['TranslatorList-Mask'] = {'translator-mask#', 'translator#-mask'},
}
--[[--------------------------< P U N C T _ S K I P >---------------------------
builds a table of parameter names that the extraneous terminal punctuation check should not check.
]]
local punct_meta_params = { -- table of aliases[] keys (meta parameters); each key has a table of parameter names for a value
'BookTitle', 'Chapter', 'ScriptChapter', 'ScriptTitle', 'Title', 'TransChapter', 'Transcript', 'TransMap', 'TransTitle', -- title-holding parameters
'AuthorList-Mask', 'ContributorList-Mask', 'EditorList-Mask', 'InterviewerList-Mask', 'TranslatorList-Mask', -- name-list mask may have name separators
'PostScript', 'Quote', 'ScriptQuote', 'TransQuote', 'Ref', -- miscellaneous
'ArchiveURL', 'ChapterURL', 'ConferenceURL', 'LayURL', 'MapURL', 'TranscriptURL', 'URL', -- URL-holding parameters
}
local url_meta_params = { -- table of aliases[] keys (meta parameters); each key has a table of parameter names for a value
'ArchiveURL', 'ChapterURL', 'ConferenceURL', 'ID', 'LayURL', 'MapURL', 'TranscriptURL', 'URL', -- parameters allowed to hold urls
'Page', 'Pages', 'At', 'QuotePage', 'QuotePages', -- insource locators allowed to hold urls
}
local function build_skip_table (skip_t, meta_params)
for _, meta_param in ipairs (meta_params) do -- for each meta parameter key
local params = aliases[meta_param]; -- get the parameter or the table of parameters associated with the meta parameter name
if 'string' == type (params) then
skip_t[params] = 1; -- just a single parameter
else
for _, param in ipairs (params) do -- get the parameter name
skip_t[param] = 1; -- add the parameter name to the skip table
local count;
param, count = param:gsub ('#', ''); -- remove enumerator marker from enumerated parameters
if 0 ~= count then -- if removed
skip_t[param] = 1; -- add param name without enumerator marker
end
end
end
end
return skip_t;
end
local punct_skip = {};
local url_skip = {};
--[[--------------------------< S I N G L E - L E T T E R S E C O N D - L E V E L D O M A I N S >----------
this is a list of tlds that are known to have single-letter second-level domain names. This list does not include
ccTLDs which are accepted in is_domain_name().
]]
local single_letter_2nd_lvl_domains_t = {'cash', 'company', 'foundation', 'org', 'today'};
--[[-----------< S P E C I A L C A S E T R A N S L A T I O N S >------------
This table is primarily here to support internationalization. Translations in
this table are used, for example, when an error message, category name, etc.,
is extracted from the English alias key. There may be other cases where
this translation table may be useful.
]]
local is_Latn = 'A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143';
local special_case_translation = {
['AuthorList'] = 'authors list', -- used to assemble maintenance category names
['ContributorList'] = 'contributors list', -- translation of these names plus translation of the base maintenance category names in maint_cats{} table below
['EditorList'] = 'editors list', -- must match the names of the actual categories
['InterviewerList'] = 'interviewers list', -- this group or translations used by name_has_ed_markup() and name_has_mult_names()
['TranslatorList'] = 'translators list',
-- Lua patterns to match pseudo-titles used by InternetArchiveBot and others as placeholder for unknown |title= value
['archived_copy'] = { -- used with CS1 maint: Archive[d] copy as title
['en'] = '^archived?%s+copy$', -- for English; translators: keep this because templates imported from en.wiki
['local'] = nil, -- translators: replace ['local'] = nil with lowercase translation only when bots or tools create generic titles in your language
},
-- Lua patterns to match generic titles; usually created by bots or reference filling tools
-- translators: replace ['local'] = nil with lowercase translation only when bots or tools create generic titles in your language
-- generic titles and patterns in this table should be lowercase only
-- leave ['local'] nil except when there is a matching generic title in your language
-- boolean 'true' for plain-text searches; 'false' for pattern searches
['generic_titles'] = {
['accept'] = {
},
['reject'] = {
{['en'] = {'^wayback%s+machine$', false}, ['local'] = nil},
{['en'] = {'are you a robot', true}, ['local'] = nil},
{['en'] = {'hugedomains.com', true}, ['local'] = nil},
{['en'] = {'^[%(%[{<]?no +title[>}%]%)]?$', false}, ['local'] = nil},
{['en'] = {'page not found', true}, ['local'] = nil},
{['en'] = {'subscribe to read', true}, ['local'] = nil},
{['en'] = {'^[%(%[{<]?unknown[>}%]%)]?$', false}, ['local'] = nil},
{['en'] = {'website is for sale', true}, ['local'] = nil},
{['en'] = {'^404', false}, ['local'] = nil},
{['en'] = {'internet archive wayback machine', true}, ['local'] = nil},
{['en'] = {'log into facebook', true}, ['local'] = nil},
{['en'] = {'login • instagram', true}, ['local'] = nil},
{['en'] = {'redirecting...', true}, ['local'] = nil},
{['en'] = {'usurped title', true}, ['local'] = nil}, -- added by a GreenC bot
{['en'] = {'webcite query result', true}, ['local'] = nil},
{['en'] = {'wikiwix\'s cache', true}, ['local'] = nil},
}
},
-- boolean 'true' for plain-text searches, search string must be lowercase only
-- boolean 'false' for pattern searches
-- leave ['local'] nil except when there is a matching generic name in your language
['generic_names'] = {
['accept'] = {
{['en'] = {'%[%[[^|]*%(author%) *|[^%]]*%]%]', false}, ['local'] = nil},
},
['reject'] = {
{['en'] = {'about us', true}, ['local'] = nil},
{['en'] = {'%f[%a][Aa]dvisor%f[%A]', false}, ['local'] = nil},
{['en'] = {'allmusic', true}, ['local'] = nil},
{['en'] = {'%f[%a][Aa]uthor%f[%A]', false}, ['local'] = nil},
{['en'] = {'business', true}, ['local'] = nil},
{['en'] = {'cnn', true}, ['local'] = nil},
{['en'] = {'collaborator', true}, ['local'] = nil},
{['en'] = {'contributor', true}, ['local'] = nil},
{['en'] = {'contact us', true}, ['local'] = nil},
{['en'] = {'directory', true}, ['local'] = nil},
{['en'] = {'%f[%(%[][%(%[]%s*eds?%.?%s*[%)%]]?$', false}, ['local'] = nil},
{['en'] = {'[,%.%s]%f[e]eds?%.?$', false}, ['local'] = nil},
{['en'] = {'^eds?[%.,;]', false}, ['local'] = nil},
{['en'] = {'^[%(%[]%s*[Ee][Dd][Ss]?%.?%s*[%)%]]', false}, ['local'] = nil},
{['en'] = {'%f[%a][Ee]dited%f[%A]', false}, ['local'] = nil},
{['en'] = {'%f[%a][Ee]ditors?%f[%A]', false}, ['local'] = nil},
{['en'] = {'%f[%a]]Ee]mail%f[%A]', false}, ['local'] = nil},
{['en'] = {'facebook', true}, ['local'] = nil},
{['en'] = {'google', true}, ['local'] = nil},
{['en'] = {'home page', true}, ['local'] = nil},
{['en'] = {'^[Ii]nc%.?$', false}, ['local'] = nil},
{['en'] = {'instagram', true}, ['local'] = nil},
{['en'] = {'interviewer', true}, ['local'] = nil},
{['en'] = {'linkedIn', true}, ['local'] = nil},
{['en'] = {'^[Nn]ews$', false}, ['local'] = nil},
{['en'] = {'pinterest', true}, ['local'] = nil},
{['en'] = {'policy', true}, ['local'] = nil},
{['en'] = {'privacy', true}, ['local'] = nil},
{['en'] = {'reuters', true}, ['local'] = nil},
{['en'] = {'translator', true}, ['local'] = nil},
{['en'] = {'tumblr', true}, ['local'] = nil},
{['en'] = {'twitter', true}, ['local'] = nil},
{['en'] = {'site name', true}, ['local'] = nil},
{['en'] = {'statement', true}, ['local'] = nil},
{['en'] = {'submitted', true}, ['local'] = nil},
{['en'] = {'super.?user', false}, ['local'] = nil},
{['en'] = {'%f['..is_Latn..'][Uu]ser%f[^'..is_Latn..']', false}, ['local'] = nil},
{['en'] = {'verfasser', true}, ['local'] = nil},
}
}
}
--[[--------------------------< D A T E _ N A M E S >----------------------------------------------------------
This table of tables lists local language date names and fallback English date names.
The code in Date_validation will look first in the local table for valid date names.
If date names are not found in the local table, the code will look in the English table.
Because citations can be copied to the local wiki from en.wiki, the English is
required when the date-name translation function date_name_xlate() is used.
In these tables, season numbering is defined by
Extended Date/Time Format (EDTF) Specification (https://www.loc.gov/standards/datetime/)
which became part of ISO 8601 in 2019. See '§Sub-year groupings'. The standard
defines various divisions using numbers 21-41. CS1|2 only supports generic seasons.
EDTF does support the distinction between north and south hemisphere seasons
but CS1|2 has no way to make that distinction.
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
The standard does not address 'named' dates so, for the purposes of CS1|2,
Easter and Christmas are defined here as 98 and 99, which should be out of the
ISO 8601 (EDTF) range of uses for a while.
local_date_names_from_mediawiki is a boolean. When set to:
true – module will fetch local month names from MediaWiki for both date_names['local']['long'] and date_names['local']['short']
false – module will *not* fetch local month names from MediaWiki
Caveat lector: There is no guarantee that MediaWiki will provide short month names. At your wiki you can test
the results of the MediaWiki fetch in the debug console with this command (the result is alpha sorted):
=mw.dumpObject (p.date_names['local'])
While the module can fetch month names from MediaWiki, it cannot fetch the quarter, season, and named date names
from MediaWiki. Those must be translated manually.
]]
local local_date_names_from_mediawiki = true; -- when false, manual translation required for date_names['local']['long'] and date_names['local']['short']
-- when true, module fetches long and short month names from MediaWiki
local date_names = {
['en'] = { -- English
['long'] = {['January'] = 1, ['February'] = 2, ['March'] = 3, ['April'] = 4, ['May'] = 5, ['June'] = 6, ['July'] = 7, ['August'] = 8, ['September'] = 9, ['October'] = 10, ['November'] = 11, ['December'] = 12},
['short'] = {['Jan'] = 1, ['Feb'] = 2, ['Mar'] = 3, ['Apr'] = 4, ['May'] = 5, ['Jun'] = 6, ['Jul'] = 7, ['Aug'] = 8, ['Sep'] = 9, ['Oct'] = 10, ['Nov'] = 11, ['Dec'] = 12},
['quarter'] = {['First Quarter'] = 33, ['Second Quarter'] = 34, ['Third Quarter'] = 35, ['Fourth Quarter'] = 36},
['season'] = {['Winter'] = 24, ['Spring'] = 21, ['Summer'] = 22, ['Fall'] = 23, ['Autumn'] = 23},
['named'] = {['Easter'] = 98, ['Christmas'] = 99},
},
-- when local_date_names_from_mediawiki = false
['local'] = { -- replace these English date names with the local language equivalents
['long'] = {['January'] = 1, ['February'] = 2, ['March'] = 3, ['April'] = 4, ['May'] = 5, ['June'] = 6, ['July'] = 7, ['August'] = 8, ['September'] = 9, ['October'] = 10, ['November'] = 11, ['December'] = 12},
['short'] = {['Jan'] = 1, ['Feb'] = 2, ['Mar'] = 3, ['Apr'] = 4, ['May'] = 5, ['Jun'] = 6, ['Jul'] = 7, ['Aug'] = 8, ['Sep'] = 9, ['Oct'] = 10, ['Nov'] = 11, ['Dec'] = 12},
['quarter'] = {['First Quarter'] = 33, ['Second Quarter'] = 34, ['Third Quarter'] = 35, ['Fourth Quarter'] = 36},
['season'] = {['Winter'] = 24, ['Spring'] = 21, ['Summer'] = 22, ['Fall'] = 23, ['Autumn'] = 23},
['named'] = {['Easter'] = 98, ['Christmas'] = 99},
},
['inv_local_long'] = {}, -- used in date reformatting & translation; copy of date_names['local'].long where k/v are inverted: [1]='<local name>' etc.
['inv_local_short'] = {}, -- used in date reformatting & translation; copy of date_names['local'].short where k/v are inverted: [1]='<local name>' etc.
['inv_local_quarter'] = {}, -- used in date translation; copy of date_names['local'].quarter where k/v are inverted: [1]='<local name>' etc.
['inv_local_season'] = {}, -- used in date translation; copy of date_names['local'].season where k/v are inverted: [1]='<local name>' etc.
['inv_local_named'] = {}, -- used in date translation; copy of date_names['local'].named where k/v are inverted: [1]='<local name>' etc.
['local_digits'] = {['0'] = '0', ['1'] = '1', ['2'] = '2', ['3'] = '3', ['4'] = '4', ['5'] = '5', ['6'] = '6', ['7'] = '7', ['8'] = '8', ['9'] = '9'}, -- used to convert local language digits to Western 0-9
['xlate_digits'] = {},
}
if local_date_names_from_mediawiki then -- if fetching local month names from MediaWiki is enabled
local long_t = {};
local short_t = {};
for i=1, 12 do -- loop 12x and
local name = lang_obj:formatDate('F', '2022-' .. i .. '-1'); -- get long month name for each i
long_t[name] = i; -- save it
name = lang_obj:formatDate('M', '2022-' .. i .. '-1'); -- get short month name for each i
short_t[name] = i; -- save it
end
date_names['local']['long'] = long_t; -- write the long table – overwrites manual translation
date_names['local']['short'] = short_t; -- write the short table – overwrites manual translation
end
-- create inverted date-name tables for reformatting and/or translation
for _, invert_t in pairs {{'long', 'inv_local_long'}, {'short', 'inv_local_short'}, {'quarter', 'inv_local_quarter'}, {'season', 'inv_local_season'}, {'named', 'inv_local_named'}} do
for name, i in pairs (date_names['local'][invert_t[1]]) do -- this table is ['name'] = i
date_names[invert_t[2]][i] = name; -- invert to get [i] = 'name' for conversions from ymd
end
end
for ld, ed in pairs (date_names.local_digits) do -- make a digit translation table for simple date translation from en to local language using local_digits table
date_names.xlate_digits [ed] = ld; -- en digit becomes index with local digit as the value
end
local df_template_patterns = { -- table of redirects to {{Use dmy dates}} and {{Use mdy dates}}
'{{ *[Uu]se +(dmy) +dates *[|}]', -- 1159k -- sorted by approximate transclusion count
'{{ *[Uu]se +(mdy) +dates *[|}]', -- 212k
'{{ *[Uu]se +(MDY) +dates *[|}]', -- 788
'{{ *[Uu]se +(DMY) +dates *[|}]', -- 343
'{{ *([Mm]dy) *[|}]', -- 176
'{{ *[Uu]se *(dmy) *[|}]', -- 156 + 18
'{{ *[Uu]se *(mdy) *[|}]', -- 149 + 11
'{{ *([Dd]my) *[|}]', -- 56
'{{ *[Uu]se +(MDY) *[|}]', -- 5
'{{ *([Dd]MY) *[|}]', -- 3
'{{ *[Uu]se(mdy)dates *[|}]', -- 1
'{{ *[Uu]se +(DMY) *[|}]', -- 0
'{{ *([Mm]DY) *[|}]', -- 0
}
local function get_date_format ()
local title_object = mw.title.getCurrentTitle();
if title_object.namespace == 10 then -- not in template space so that unused templates appear in unused-template-reports;
return nil; -- auto-formatting does not work in Template space so don't set global_df
end
local content = title_object:getContent() or ''; -- get the content of the article or ''; new pages edited w/ve do not have 'content' until saved; ve does not preview; phab:T221625
for _, pattern in ipairs (df_template_patterns) do -- loop through the patterns looking for {{Use dmy dates}} or {{Use mdy dates}} or any of their redirects
local start, _, match = content:find(pattern); -- match is the three letters indicating desired date format
if match then
content = content:match ('%b{}', start); -- get the whole template
if content:match ('| *cs1%-dates *= *[lsy][sy]?') then -- look for |cs1-dates=publication date length access-/archive-date length
return match:lower() .. '-' .. content:match ('| *cs1%-dates *= *([lsy][sy]?)');
else
return match:lower() .. '-all'; -- no |cs1-dates= k/v pair; return value appropriate for use in |df=
end
end
end
end
local global_df;
--[[-----------------< V O L U M E , I S S U E , P A G E S >------------------
These tables hold cite class values (from the template invocation) and identify those templates that support
|volume=, |issue=, and |page(s)= parameters. Cite conference and cite map require further qualification which
is handled in the main module.
]]
local templates_using_volume = {'citation', 'audio-visual', 'book', 'conference', 'encyclopaedia', 'interview', 'journal', 'magazine', 'map', 'news', 'report', 'techreport', 'thesis'}
local templates_using_issue = {'citation', 'conference', 'episode', 'interview', 'journal', 'magazine', 'map', 'news', 'podcast'}
local templates_not_using_page = {'audio-visual', 'episode', 'mailinglist', 'newsgroup', 'podcast', 'serial', 'sign', 'speech'}
--[[
These tables control when it is appropriate for {{citation}} to render |volume= and/or |issue=. The parameter
names in the tables constrain {{citation}} so that its renderings match the renderings of the equivalent cs1
templates. For example, {{cite web}} does not support |volume= so the equivalent {{citation |website=...}} must
not support |volume=.
]]
local citation_no_volume_t = { -- {{citation}} does not render |volume= when these parameters are used
'website', 'mailinglist', 'script-website',
}
local citation_issue_t = { -- {{citation}} may render |issue= when these parameters are used
'journal', 'magazine', 'newspaper', 'periodical', 'work',
'script-journal', 'script-magazine', 'script-newspaper', 'script-periodical', 'script-work',
}
--[[
Patterns for finding extra text in |volume=, |issue=, |page=, |pages=
]]
local vol_iss_pg_patterns = {
good_ppattern = '^P[^%.PpGg]', -- OK to begin with uppercase P: P7 (page 7 of section P), but not p123 (page 123); TODO: this allows 'Pages' which it should not
bad_ppatterns = { -- patterns for |page= and |pages=
'^[Pp][PpGg]?%.?[ %d]',
'^[Pp][Pp]?%. ', -- from {{p.}} and {{pp.}} templates
'^[Pp]ages?',
'^[Pp]gs.?',
},
vpatterns = { -- patterns for |volume=
'^volumes?',
'^vols?[%.:=]?'
},
ipatterns = { -- patterns for |issue=
'^issues?',
'^iss[%.:=]?',
'^numbers?',
'^nos?%A', -- don't match 'november' or 'nostradamus'
'^nr[%.:=]?',
'^n[%.:= ]' -- might be a valid issue without separator (space char is sep char here)
}
}
--[[--------------------------< K E Y W O R D S >-------------------------------
These tables hold keywords for those parameters that have defined sets of acceptable keywords.
]]
--[[-------------------< K E Y W O R D S T A B L E >--------------------------
this is a list of keywords; each key in the list is associated with a table of
synonymous keywords possibly from different languages.
for I18N: add local-language keywords to value table; do not change the key.
For example, adding the German keyword 'ja':
['affirmative'] = {'yes', 'true', 'y', 'ja'},
Because CS1|2 templates from en.wiki articles are often copied to other local wikis,
it is recommended that the English keywords remain in these tables.
]]
local keywords = {
['amp'] = {'&', 'amp', 'ampersand'}, -- |name-list-style=
['and'] = {'and', 'serial'}, -- |name-list-style=
['affirmative'] = {'yes', 'true', 'y'}, -- |no-tracking=, |no-pp= -- Used by InternetArchiveBot
['afterword'] = {'afterword'}, -- |contribution=
['bot: unknown'] = {'bot: unknown'}, -- |url-status= -- Used by InternetArchiveBot
['cs1'] = {'cs1'}, -- |mode=
['cs2'] = {'cs2'}, -- |mode=
['dead'] = {'dead', 'deviated'}, -- |url-status= -- Used by InternetArchiveBot
['dmy'] = {'dmy'}, -- |df=
['dmy-all'] = {'dmy-all'}, -- |df=
['foreword'] = {'foreword'}, -- |contribution=
['free'] = {'free'}, -- |<id>-access= -- Used by InternetArchiveBot
['harv'] = {'harv'}, -- |ref=; this no longer supported; is_valid_parameter_value() called with <invert> = true
['introduction'] = {'introduction'}, -- |contribution=
['limited'] = {'limited'}, -- |url-access= -- Used by InternetArchiveBot
['live'] = {'live'}, -- |url-status= -- Used by InternetArchiveBot
['mdy'] = {'mdy'}, -- |df=
['mdy-all'] = {'mdy-all'}, -- |df=
['none'] = {'none'}, -- |postscript=, |ref=, |title=, |type= -- Used by InternetArchiveBot
['off'] = {'off'}, -- |title= (potentially also: |title-link=, |postscript=, |ref=, |type=)
['preface'] = {'preface'}, -- |contribution=
['registration'] = {'registration'}, -- |url-access= -- Used by InternetArchiveBot
['subscription'] = {'subscription'}, -- |url-access= -- Used by InternetArchiveBot
['unfit'] = {'unfit'}, -- |url-status= -- Used by InternetArchiveBot
['usurped'] = {'usurped'}, -- |url-status= -- Used by InternetArchiveBot
['vanc'] = {'vanc'}, -- |name-list-style=
['ymd'] = {'ymd'}, -- |df=
['ymd-all'] = {'ymd-all'}, -- |df=
-- ['yMd'] = {'yMd'}, -- |df=; not supported at en.wiki
-- ['yMd-all'] = {'yMd-all'}, -- |df=; not supported at en.wiki
}
--[[------------------------< X L A T E _ K E Y W O R D S >---------------------
this function builds a list, keywords_xlate{}, of the keywords found in keywords{} where the values from keywords{}
become the keys in keywords_xlate{} and the keys from keywords{} become the values in keywords_xlate{}:
['affirmative'] = {'yes', 'true', 'y'}, -- in keywords{}
becomes
['yes'] = 'affirmative', -- in keywords_xlate{}
['true'] = 'affirmative',
['y'] = 'affirmative',
the purpose of this function is to act as a translator between a non-English keyword and its English equivalent
that may be used in other modules of this suite
]]
local function xlate_keywords ()
local out_table = {}; -- output goes here
for k, keywords_t in pairs (keywords) do -- spin through the keywords table
for _, keyword in ipairs (keywords_t) do -- for each keyword
out_table[keyword] = k; -- create an entry in the output table where keyword is the key
end
end
return out_table;
end
local keywords_xlate = xlate_keywords (); -- the list of translated keywords
--[[----------------< M A K E _ K E Y W O R D S _ L I S T >---------------------
this function assembles, for parameter-value validation, the list of keywords appropriate to that parameter.
keywords_lists{}, is a table of tables from keywords{}
]]
local function make_keywords_list (keywords_lists)
local out_table = {}; -- output goes here
for _, keyword_list in ipairs (keywords_lists) do -- spin through keywords_lists{} and get a table of keywords
for _, keyword in ipairs (keyword_list) do -- spin through keyword_list{} and add each keyword, ...
table.insert (out_table, keyword); -- ... as plain text, to the output list
end
end
return out_table;
end
--[[----------------< K E Y W O R D S _ L I S T S >-----------------------------
this is a list of lists of valid keywords for the various parameters in [key].
Generally the keys in this table are the canonical en.wiki parameter names though
some are contrived because of use in multiple differently named parameters:
['yes_true_y'], ['id-access'].
The function make_keywords_list() extracts the individual keywords from the
appropriate list in keywords{}.
The lists in this table are used to validate the keyword assignment for the
parameters named in this table's keys.
]]
local keywords_lists = {
['yes_true_y'] = make_keywords_list ({keywords.affirmative}),
['contribution'] = make_keywords_list ({keywords.afterword, keywords.foreword, keywords.introduction, keywords.preface}),
['df'] = make_keywords_list ({keywords.dmy, keywords['dmy-all'], keywords.mdy, keywords['mdy-all'], keywords.ymd, keywords['ymd-all']}),
-- ['df'] = make_keywords_list ({keywords.dmy, keywords['dmy-all'], keywords.mdy, keywords['mdy-all'], keywords.ymd, keywords['ymd-all'], keywords.yMd, keywords['yMd-all']}), -- not supported at en.wiki
['mode'] = make_keywords_list ({keywords.cs1, keywords.cs2}),
['name-list-style'] = make_keywords_list ({keywords.amp, keywords['and'], keywords.vanc}),
['ref'] = make_keywords_list ({keywords.harv}), -- inverted check; |ref=harv no longer supported
['url-access'] = make_keywords_list ({keywords.subscription, keywords.limited, keywords.registration}),
['url-status'] = make_keywords_list ({keywords.dead, keywords.live, keywords.unfit, keywords.usurped, keywords['bot: unknown']}),
['id-access'] = make_keywords_list ({keywords.free}),
}
--[[---------------------< S T R I P M A R K E R S >----------------------------
Common pattern definition location for stripmarkers so that we don't have to go
hunting for them if (when) MediaWiki changes their form.
]]
local stripmarkers = {
['any'] = '\127[^\127]*UNIQ%-%-(%a+)%-[%a%d]+%-QINU[^\127]*\127', -- capture returns name of stripmarker
['math'] = '\127[^\127]*UNIQ%-%-math%-[%a%d]+%-QINU[^\127]*\127' -- math stripmarkers used in coins_cleanup() and coins_replace_math_stripmarker()
}
--[[------------< I N V I S I B L E _ C H A R A C T E R S >---------------------
This table holds non-printing or invisible characters indexed either by name or
by Unicode group. Values are decimal representations of UTF-8 codes. The table
is organized as a table of tables because the Lua pairs keyword returns table
data in an arbitrary order. Here, we want to process the table from top to bottom
because the entries at the top of the table are also found in the ranges specified
by the entries at the bottom of the table.
Also here is a pattern that recognizes stripmarkers that begin and end with the
delete characters. The nowiki stripmarker is not an error but some others are
because the parameter values that include them become part of the template's
metadata before stripmarker replacement.
]]
local invisible_defs = {
del = '\127', -- used to distinguish between stripmarker and del char
zwj = '\226\128\141', -- used with capture because zwj may be allowed
}
local invisible_chars = {
{'replacement', '\239\191\189'}, -- U+FFFD, EF BF BD
{'zero width joiner', '('.. invisible_defs.zwj .. ')'}, -- U+200D, E2 80 8D; capture because zwj may be allowed
{'zero width space', '\226\128\139'}, -- U+200B, E2 80 8B
{'hair space', '\226\128\138'}, -- U+200A, E2 80 8A
{'soft hyphen', '\194\173'}, -- U+00AD, C2 AD
{'horizontal tab', '\009'}, -- U+0009 (HT), 09
{'line feed', '\010'}, -- U+000A (LF), 0A
{'no-break space', '\194\160'}, -- U+00A0 (NBSP), C2 A0
{'carriage return', '\013'}, -- U+000D (CR), 0D
{'stripmarker', stripmarkers.any}, -- stripmarker; may or may not be an error; capture returns the stripmaker type
{'delete', '('.. invisible_defs.del .. ')'}, -- U+007F (DEL), 7F; must be done after stripmarker test; capture to distinguish isolated del chars not part of stripmarker
{'C0 control', '[\000-\008\011\012\014-\031]'}, -- U+0000–U+001F (NULL–US), 00–1F (except HT, LF, CR (09, 0A, 0D))
{'C1 control', '[\194\128-\194\159]'}, -- U+0080–U+009F (XXX–APC), C2 80 – C2 9F
-- {'Specials', '[\239\191\185-\239\191\191]'}, -- U+FFF9-U+FFFF, EF BF B9 – EF BF BF
-- {'Private use area', '[\238\128\128-\239\163\191]'}, -- U+E000–U+F8FF, EE 80 80 – EF A3 BF
-- {'Supplementary Private Use Area-A', '[\243\176\128\128-\243\191\191\189]'}, -- U+F0000–U+FFFFD, F3 B0 80 80 – F3 BF BF BD
-- {'Supplementary Private Use Area-B', '[\244\128\128\128-\244\143\191\189]'}, -- U+100000–U+10FFFD, F4 80 80 80 – F4 8F BF BD
}
--[[
Indic script makes use of zero width joiner as a character modifier so zwj
characters must be left in. This pattern covers all of the unicode characters
for these languages:
Devanagari 0900–097F – https://unicode.org/charts/PDF/U0900.pdf
Devanagari extended A8E0–A8FF – https://unicode.org/charts/PDF/UA8E0.pdf
Bengali 0980–09FF – https://unicode.org/charts/PDF/U0980.pdf
Gurmukhi 0A00–0A7F – https://unicode.org/charts/PDF/U0A00.pdf
Gujarati 0A80–0AFF – https://unicode.org/charts/PDF/U0A80.pdf
Oriya 0B00–0B7F – https://unicode.org/charts/PDF/U0B00.pdf
Tamil 0B80–0BFF – https://unicode.org/charts/PDF/U0B80.pdf
Telugu 0C00–0C7F – https://unicode.org/charts/PDF/U0C00.pdf
Kannada 0C80–0CFF – https://unicode.org/charts/PDF/U0C80.pdf
Malayalam 0D00–0D7F – https://unicode.org/charts/PDF/U0D00.pdf
plus the not-necessarily Indic scripts for Sinhala and Burmese:
Sinhala 0D80-0DFF - https://unicode.org/charts/PDF/U0D80.pdf
Myanmar 1000-109F - https://unicode.org/charts/PDF/U1000.pdf
Myanmar extended A AA60-AA7F - https://unicode.org/charts/PDF/UAA60.pdf
Myanmar extended B A9E0-A9FF - https://unicode.org/charts/PDF/UA9E0.pdf
the pattern is used by has_invisible_chars() and coins_cleanup()
]]
local indic_script = '[\224\164\128-\224\181\191\224\163\160-\224\183\191\225\128\128-\225\130\159\234\167\160-\234\167\191\234\169\160-\234\169\191]';
-- list of emoji that use a zwj character (U+200D) to combine with another emoji
-- from: https://unicode.org/Public/emoji/15.0/emoji-zwj-sequences.txt; version: 15.0; 2022-05-06
-- table created by: [[:en:Module:Make emoji zwj table]]
local emoji_t = { -- indexes are decimal forms of the hex values in U+xxxx
[9760] = true, -- U+2620 ☠ skull and crossbones
[9792] = true, -- U+2640 ♀ female sign
[9794] = true, -- U+2642 ♂ male sign
[9877] = true, -- U+2695 ⚕ staff of aesculapius
[9878] = true, -- U+2696 ⚖ scales
[9895] = true, -- U+26A7 ⚧ male with stroke and male and female sign
[9992] = true, -- U+2708 ✈ airplane
[10052] = true, -- U+2744 ❄ snowflake
[10084] = true, -- U+2764 ❤ heavy black heart
[11035] = true, -- U+2B1B ⬛ black large square
[127752] = true, -- U+1F308 🌈 rainbow
[127787] = true, -- U+1F32B 🌫 fog
[127806] = true, -- U+1F33E 🌾 ear of rice
[127859] = true, -- U+1F373 🍳 cooking
[127868] = true, -- U+1F37C 🍼 baby bottle
[127876] = true, -- U+1F384 🎄 christmas tree
[127891] = true, -- U+1F393 🎓 graduation cap
[127908] = true, -- U+1F3A4 🎤 microphone
[127912] = true, -- U+1F3A8 🎨 artist palette
[127979] = true, -- U+1F3EB 🏫 school
[127981] = true, -- U+1F3ED 🏭 factory
[128102] = true, -- U+1F466 👦 boy
[128103] = true, -- U+1F467 👧 girl
[128104] = true, -- U+1F468 👨 man
[128105] = true, -- U+1F469 👩 woman
[128139] = true, -- U+1F48B 💋 kiss mark
[128168] = true, -- U+1F4A8 💨 dash symbol
[128171] = true, -- U+1F4AB 💫 dizzy symbol
[128187] = true, -- U+1F4BB 💻 personal computer
[128188] = true, -- U+1F4BC 💼 brief case
[128293] = true, -- U+1F525 🔥 fire
[128295] = true, -- U+1F527 🔧 wrench
[128300] = true, -- U+1F52C 🔬 microscope
[128488] = true, -- U+1F5E8 🗨 left speech bubble
[128640] = true, -- U+1F680 🚀 rocket
[128658] = true, -- U+1F692 🚒 fire engine
[129309] = true, -- U+1F91D 🤝 handshake
[129455] = true, -- U+1F9AF 🦯 probing cane
[129456] = true, -- U+1F9B0 🦰 emoji component red hair
[129457] = true, -- U+1F9B1 🦱 emoji component curly hair
[129458] = true, -- U+1F9B2 🦲 emoji component bald
[129459] = true, -- U+1F9B3 🦳 emoji component white hair
[129466] = true, -- U+1F9BA 🦺 safety vest
[129468] = true, -- U+1F9BC 🦼 motorized wheelchair
[129469] = true, -- U+1F9BD 🦽 manual wheelchair
[129489] = true, -- U+1F9D1 🧑 adult
[129657] = true, -- U+1FA79 🩹 adhesive bandage
[129778] = true, -- U+1FAF2 🫲 leftwards hand
}
--[[----------------------< L A N G U A G E S U P P O R T >-------------------
These tables and constants support various language-specific functionality.
]]
--local this_wiki_code = mw.getContentLanguage():getCode(); -- get this wiki's language code
local this_wiki_code = lang_obj:getCode(); -- get this wiki's language code
if string.match (mw.site.server, 'wikidata') then
this_wiki_code = mw.getCurrentFrame():preprocess('{{int:lang}}'); -- on Wikidata so use interface language setting instead
end
local mw_languages_by_tag_t = mw.language.fetchLanguageNames (this_wiki_code, 'all'); -- get a table of language tag/name pairs known to Wikimedia; used for interwiki tests
local mw_languages_by_name_t = {};
for k, v in pairs (mw_languages_by_tag_t) do -- build a 'reversed' table name/tag language pairs know to MediaWiki; used for |language=
v = mw.ustring.lower (v); -- lowercase for tag fetch; get name's proper case from mw_languages_by_tag_t[<tag>]
if mw_languages_by_name_t[v] then -- when name already in the table
if 2 == #k or 3 == #k then -- if tag does not have subtags
mw_languages_by_name_t[v] = k; -- prefer the shortest tag for this name
end
else -- here when name not in the table
mw_languages_by_name_t[v] = k; -- so add name and matching tag
end
end
local inter_wiki_map = {}; -- map of interwiki prefixes that are language-code prefixes
for k, v in pairs (mw.site.interwikiMap ('local')) do -- spin through the base interwiki map (limited to local)
if mw_languages_by_tag_t[v["prefix"]] then -- if the prefix matches a known language tag
inter_wiki_map[v["prefix"]] = true; -- add it to our local map
end
end
--[[--------------------< S C R I P T _ L A N G _ C O D E S >-------------------
This table is used to hold ISO 639-1 two-character and ISO 639-3 three-character
language codes that apply only to |script-title= and |script-chapter=
]]
local script_lang_codes = {
'ab', 'am', 'ar', 'be', 'bg', 'bn', 'bo', 'bs', 'dv', 'dz', 'el', 'fa', 'gu',
'he', 'hi', 'hy', 'ja', 'ka', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'lo', 'mk',
'ml', 'mn', 'mr', 'my', 'ne', 'or', 'ota', 'pa', 'ps', 'ru', 'sd', 'si', 'sr',
'syc', 'ta', 'te', 'tg', 'th', 'ti', 'tt', 'ug', 'uk', 'ur', 'uz', 'yi', 'yue', 'zh'
};
--[[---------------< L A N G U A G E R E M A P P I N G >----------------------
These tables hold language information that is different (correct) from MediaWiki's definitions
For each ['code'] = 'language name' in lang_code_remap{} there must be a matching ['language name'] = {'language name', 'code'} in lang_name_remap{}
lang_code_remap{}:
key is always lowercase ISO 639-1, -2, -3 language code or a valid lowercase IETF language tag
value is properly spelled and capitalized language name associated with key
only one language name per key;
key/value pair must have matching entry in lang_name_remap{}
lang_name_remap{}:
key is always lowercase language name
value is a table the holds correctly spelled and capitalized language name [1] and associated code [2] (code must match a code key in lang_code_remap{})
may have multiple keys referring to a common preferred name and code; For example:
['kolsch'] and ['kölsch'] both refer to 'Kölsch' and 'ksh'
]]
local lang_code_remap = { -- used for |language= and |script-title= / |script-chapter=
['als'] = 'Tosk Albanian', -- MediaWiki returns Alemannisch
['bh'] = 'Bihari', -- MediaWiki uses 'bh' as a subdomain name for Bhojpuri Wikipedia: bh.wikipedia.org
['bla'] = 'Blackfoot', -- MediaWiki/IANA/ISO 639: Siksika; use en.wiki preferred name
['bn'] = 'Bengali', -- MediaWiki returns Bangla
['ca-valencia'] = 'Valencian', -- IETF variant of Catalan
['ilo'] = 'Ilocano', -- MediaWiki/IANA/ISO 639: Iloko; use en.wiki preferred name
['ksh'] = 'Kölsch', -- MediaWiki: Colognian; use IANA/ISO 639 preferred name
['ksh-x-colog'] = 'Colognian', -- override MediaWiki ksh; no IANA/ISO 639 code for Colognian; IETF private code created at Module:Lang/data
['mis-x-ripuar'] = 'Ripuarian', -- override MediaWiki ksh; no IANA/ISO 639 code for Ripuarian; IETF private code created at Module:Lang/data
['nan-tw'] = 'Taiwanese Hokkien', -- make room for MediaWiki/IANA/ISO 639 nan: Min Nan Chinese and support en.wiki preferred name
}
local lang_name_remap = { -- used for |language=; names require proper capitalization; tags must be lowercase
['alemannisch'] = {'Swiss German', 'gsw'}, -- not an ISO or IANA language name; MediaWiki uses 'als' as a subdomain name for Alemannic Wikipedia: als.wikipedia.org
['bangla'] = {'Bengali', 'bn'}, -- MediaWiki returns Bangla (the endonym) but we want Bengali (the exonym); here we remap
['bengali'] = {'Bengali', 'bn'}, -- MediaWiki doesn't use exonym so here we provide correct language name and 639-1 code
['bhojpuri'] = {'Bhojpuri', 'bho'}, -- MediaWiki uses 'bh' as a subdomain name for Bhojpuri Wikipedia: bh.wikipedia.org
['bihari'] = {'Bihari', 'bh'}, -- MediaWiki replaces 'Bihari' with 'Bhojpuri' so 'Bihari' cannot be found
['blackfoot'] = {'Blackfoot', 'bla'}, -- MediaWiki/IANA/ISO 639: Siksika; use en.wiki preferred name
['colognian'] = {'Colognian', 'ksh-x-colog'}, -- MediaWiki preferred name for ksh
['ilocano'] = {'Ilocano', 'ilo'}, -- MediaWiki/IANA/ISO 639: Iloko; use en.wiki preferred name
['kolsch'] = {'Kölsch', 'ksh'}, -- use IANA/ISO 639 preferred name (use non-diacritical o instead of umlaut ö)
['kölsch'] = {'Kölsch', 'ksh'}, -- use IANA/ISO 639 preferred name
['ripuarian'] = {'Ripuarian', 'mis-x-ripuar'}, -- group of dialects; no code in MediaWiki or in IANA/ISO 639
['taiwanese hokkien'] = {'Taiwanese Hokkien', 'nan-tw'}, -- make room for MediaWiki/IANA/ISO 639 nan: Min Nan Chinese
['tosk albanian'] = {'Tosk Albanian', 'als'}, -- MediaWiki replaces 'Tosk Albanian' with 'Alemannisch' so 'Tosk Albanian' cannot be found
['valencian'] = {'Valencian', 'ca-valencia'}, -- variant of Catalan; categorizes as Valencian
}
--[[---------------< P R O P E R T I E S _ C A T E G O R I E S >----------------
Properties categories. These are used for investigating qualities of citations.
]]
local prop_cats = {
['foreign-lang-source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is foreign-language name, $2 is ISO639-1 code
['foreign-lang-source-2'] = 'CS1 foreign language sources (ISO 639-2)|$1', -- |language= category; a cat for ISO639-2 languages; $1 is the ISO 639-2 code used as a sort key
['jul-greg-uncertainty'] = 'CS1: Julian–Gregorian uncertainty', -- probably temporary cat to identify scope of template with dates 1 October 1582 – 1 January 1926
['local-lang-source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is local-language name, $2 is ISO639-1 code; not emitted when local_lang_cat_enable is false
['location-test'] = 'CS1 location test',
['long-vol'] = 'CS1: long volume value', -- probably temporary cat to identify scope of |volume= values longer than 4 characters
['script'] = 'CS1 uses $1-language script ($2)', -- |script-title=xx: has matching category; $1 is language name, $2 is ISO639-1 code
['tracked-param'] = 'CS1 tracked parameter: $1', -- $1 is base (enumerators removed) parameter name
['year-range-abbreviated'] = 'CS1: abbreviated year range', -- probably temporary cat to identify scope of |date=, |year= values using YYYY–YY form
}
--[[-------------------< T I T L E _ T Y P E S >--------------------------------
Here we map a template's CitationClass to TitleType (default values for |type= parameter)
]]
local title_types = {
['AV-media-notes'] = 'Media notes',
['interview'] = 'Interview',
['mailinglist'] = 'Mailing list',
['map'] = 'Map',
['podcast'] = 'Podcast',
['pressrelease'] = 'Press release',
['report'] = 'Report',
['speech'] = 'Speech',
['techreport'] = 'Technical report',
['thesis'] = 'Thesis',
}
--[[===================<< E R R O R M E S S A G I N G >>======================
]]
--[[----------< E R R O R M E S S A G E S U P P L I M E N T S >-------------
I18N for those messages that are supplemented with additional specific text that
describes the reason for the error
TODO: merge this with special_case_translations{}?
]]
local err_msg_supl = {
['char'] = 'invalid character', -- |isbn=, |sbn=
['check'] = 'checksum', -- |isbn=, |sbn=
['flag'] = 'flag', -- |archive-url=
['form'] = 'invalid form', -- |isbn=, |sbn=
['group'] = 'invalid group id', -- |isbn=
['initials'] = 'initials', -- Vancouver
['invalid language code'] = 'invalid language code', -- |script-<param>=
['journal'] = 'journal', -- |bibcode=
['length'] = 'length', -- |isbn=, |bibcode=, |sbn=
['liveweb'] = 'liveweb', -- |archive-url=
['missing comma'] = 'missing comma', -- Vancouver
['missing prefix'] = 'missing prefix', -- |script-<param>=
['missing title part'] = 'missing title part', -- |script-<param>=
['name'] = 'name', -- Vancouver
['non-Latin char'] = 'non-Latin character', -- Vancouver
['path'] = 'path', -- |archive-url=
['prefix'] = 'invalid prefix', -- |isbn=
['punctuation'] = 'punctuation', -- Vancouver
['save'] = 'save command', -- |archive-url=
['suffix'] = 'suffix', -- Vancouver
['timestamp'] = 'timestamp', -- |archive-url=
['unknown language code'] = 'unknown language code', -- |script-<param>=
['value'] = 'value', -- |bibcode=
['year'] = 'year', -- |bibcode=
}
--[[--------------< E R R O R _ C O N D I T I O N S >---------------------------
Error condition table. This table has two sections: errors at the top, maintenance
at the bottom. Maint 'messaging' does not have a 'message' (message=nil)
The following contains a list of IDs for various error conditions defined in the
code. For each ID, we specify a text message to display, an error category to
include, and whether the error message should be wrapped as a hidden comment.
Anchor changes require identical changes to matching anchor in Help:CS1 errors
TODO: rename error_conditions{} to something more generic; create separate error
and maint tables inside that?
]]
local error_conditions = {
err_accessdate_missing_url = {
message = '<code class="cs1-code">|access-date=</code> requires <code class="cs1-code">|url=</code>',
anchor = 'accessdate_missing_url',
category = 'CS1 errors: access-date without URL',
hidden = false
},
err_apostrophe_markup = {
message = 'Italic or bold markup not allowed in: <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'apostrophe_markup',
category = 'CS1 errors: markup',
hidden = false
},
err_archive_missing_date = {
message = '<code class="cs1-code">|archive-url=</code> requires <code class="cs1-code">|archive-date=</code>',
anchor = 'archive_missing_date',
category = 'CS1 errors: archive-url',
hidden = false
},
err_archive_missing_url = {
message = '<code class="cs1-code">|archive-url=</code> requires <code class="cs1-code">|url=</code>',
anchor = 'archive_missing_url',
category = 'CS1 errors: archive-url',
hidden = false
},
err_archive_url = {
message = '<code class="cs1-code">|archive-url=</code> is malformed: $1', -- $1 is error message detail
anchor = 'archive_url',
category = 'CS1 errors: archive-url',
hidden = false
},
err_arxiv_missing = {
message = '<code class="cs1-code">|arxiv=</code> required',
anchor = 'arxiv_missing',
category = 'CS1 errors: arXiv', -- same as bad arxiv
hidden = false
},
err_asintld_missing_asin = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|asin=</code>', -- $1 is parameter name
anchor = 'asintld_missing_asin',
category = 'CS1 errors: ASIN TLD',
hidden = false
},
err_bad_arxiv = {
message = 'Check <code class="cs1-code">|arxiv=</code> value',
anchor = 'bad_arxiv',
category = 'CS1 errors: arXiv',
hidden = false
},
err_bad_asin = {
message = 'Check <code class="cs1-code">|asin=</code> value',
anchor = 'bad_asin',
category ='CS1 errors: ASIN',
hidden = false
},
err_bad_asin_tld = {
message = 'Check <code class="cs1-code">|asin-tld=</code> value',
anchor = 'bad_asin_tld',
category ='CS1 errors: ASIN TLD',
hidden = false
},
err_bad_bibcode = {
message = 'Check <code class="cs1-code">|bibcode=</code> $1', -- $1 is error message detail
anchor = 'bad_bibcode',
category = 'CS1 errors: bibcode',
hidden = false
},
err_bad_biorxiv = {
message = 'Check <code class="cs1-code">|biorxiv=</code> value',
anchor = 'bad_biorxiv',
category = 'CS1 errors: bioRxiv',
hidden = false
},
err_bad_citeseerx = {
message = 'Check <code class="cs1-code">|citeseerx=</code> value',
anchor = 'bad_citeseerx',
category = 'CS1 errors: citeseerx',
hidden = false
},
err_bad_date = {
message = 'Check date values in: $1', -- $1 is a parameter name list
anchor = 'bad_date',
category = 'CS1 errors: dates',
hidden = false
},
err_bad_doi = {
message = 'Check <code class="cs1-code">|doi=</code> value',
anchor = 'bad_doi',
category = 'CS1 errors: DOI',
hidden = false
},
err_bad_hdl = {
message = 'Check <code class="cs1-code">|hdl=</code> value',
anchor = 'bad_hdl',
category = 'CS1 errors: HDL',
hidden = false
},
err_bad_isbn = {
message = 'Check <code class="cs1-code">|isbn=</code> value: $1', -- $1 is error message detail
anchor = 'bad_isbn',
category = 'CS1 errors: ISBN',
hidden = false
},
err_bad_ismn = {
message = 'Check <code class="cs1-code">|ismn=</code> value',
anchor = 'bad_ismn',
category = 'CS1 errors: ISMN',
hidden = false
},
err_bad_issn = {
message = 'Check <code class="cs1-code">|$1issn=</code> value', -- $1 is 'e' or '' for eissn or issn
anchor = 'bad_issn',
category = 'CS1 errors: ISSN',
hidden = false
},
err_bad_jfm = {
message = 'Check <code class="cs1-code">|jfm=</code> value',
anchor = 'bad_jfm',
category = 'CS1 errors: JFM',
hidden = false
},
err_bad_jstor = {
message = 'Check <code class="cs1-code">|jstor=</code> value',
anchor = 'bad_jstor',
category = 'CS1 errors: JSTOR',
hidden = false
},
err_bad_lccn = {
message = 'Check <code class="cs1-code">|lccn=</code> value',
anchor = 'bad_lccn',
category = 'CS1 errors: LCCN',
hidden = false
},
err_bad_mr = {
message = 'Check <code class="cs1-code">|mr=</code> value',
anchor = 'bad_mr',
category = 'CS1 errors: MR',
hidden = false
},
err_bad_oclc = {
message = 'Check <code class="cs1-code">|oclc=</code> value',
anchor = 'bad_oclc',
category = 'CS1 errors: OCLC',
hidden = false
},
err_bad_ol = {
message = 'Check <code class="cs1-code">|ol=</code> value',
anchor = 'bad_ol',
category = 'CS1 errors: OL',
hidden = false
},
err_bad_osti = {
message = 'Check <code class="cs1-code">|osti=</code> value',
anchor = 'bad_osti',
category = 'CS1 errors: OSTI',
hidden = false
},
err_bad_paramlink = { -- for |title-link=, |author/editor/translator-link=, |series-link=, |episode-link=
message = 'Check <code class="cs1-code">|$1=</code> value', -- $1 is parameter name
anchor = 'bad_paramlink',
category = 'CS1 errors: parameter link',
hidden = false
},
err_bad_pmc = {
message = 'Check <code class="cs1-code">|pmc=</code> value',
anchor = 'bad_pmc',
category = 'CS1 errors: PMC',
hidden = false
},
err_bad_pmid = {
message = 'Check <code class="cs1-code">|pmid=</code> value',
anchor = 'bad_pmid',
category = 'CS1 errors: PMID',
hidden = false
},
err_bad_rfc = {
message = 'Check <code class="cs1-code">|rfc=</code> value',
anchor = 'bad_rfc',
category = 'CS1 errors: RFC',
hidden = false
},
err_bad_s2cid = {
message = 'Check <code class="cs1-code">|s2cid=</code> value',
anchor = 'bad_s2cid',
category = 'CS1 errors: S2CID',
hidden = false
},
err_bad_sbn = {
message = 'Check <code class="cs1-code">|sbn=</code> value: $1', -- $1 is error message detail
anchor = 'bad_sbn',
category = 'CS1 errors: SBN',
hidden = false
},
err_bad_ssrn = {
message = 'Check <code class="cs1-code">|ssrn=</code> value',
anchor = 'bad_ssrn',
category = 'CS1 errors: SSRN',
hidden = false
},
err_bad_url = {
message = 'Check $1 value', -- $1 is parameter name
anchor = 'bad_url',
category = 'CS1 errors: URL',
hidden = false
},
err_bad_usenet_id = {
message = 'Check <code class="cs1-code">|message-id=</code> value',
anchor = 'bad_message_id',
category = 'CS1 errors: message-id',
hidden = false
},
err_bad_zbl = {
message = 'Check <code class="cs1-code">|zbl=</code> value',
anchor = 'bad_zbl',
category = 'CS1 errors: Zbl',
hidden = false
},
err_bare_url_missing_title = {
message = '$1 missing title', -- $1 is parameter name
anchor = 'bare_url_missing_title',
category = 'CS1 errors: bare URL',
hidden = false
},
err_biorxiv_missing = {
message = '<code class="cs1-code">|biorxiv=</code> required',
anchor = 'biorxiv_missing',
category = 'CS1 errors: bioRxiv', -- same as bad bioRxiv
hidden = false
},
err_chapter_ignored = {
message = '<code class="cs1-code">|$1=</code> ignored', -- $1 is parameter name
anchor = 'chapter_ignored',
category = 'CS1 errors: chapter ignored',
hidden = false
},
err_citation_missing_title = {
message = 'Missing or empty <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'citation_missing_title',
category = 'CS1 errors: missing title',
hidden = false
},
err_citeseerx_missing = {
message = '<code class="cs1-code">|citeseerx=</code> required',
anchor = 'citeseerx_missing',
category = 'CS1 errors: citeseerx', -- same as bad citeseerx
hidden = false
},
err_cite_web_url = { -- this error applies to cite web and to cite podcast
message = 'Missing or empty <code class="cs1-code">|url=</code>',
anchor = 'cite_web_url',
category = 'CS1 errors: requires URL',
hidden = false
},
err_class_ignored = {
message = '<code class="cs1-code">|class=</code> ignored',
anchor = 'class_ignored',
category = 'CS1 errors: class',
hidden = false
},
err_contributor_ignored = {
message = '<code class="cs1-code">|contributor=</code> ignored',
anchor = 'contributor_ignored',
category = 'CS1 errors: contributor',
hidden = false
},
err_contributor_missing_required_param = {
message = '<code class="cs1-code">|contributor=</code> requires <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'contributor_missing_required_param',
category = 'CS1 errors: contributor',
hidden = false
},
err_deprecated_params = {
message = 'Cite uses deprecated parameter <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'deprecated_params',
category = 'CS1 errors: deprecated parameters',
hidden = false
},
err_disp_name = {
message = 'Invalid <code class="cs1-code">|$1=$2</code>', -- $1 is parameter name; $2 is the assigned value
anchor = 'disp_name',
category = 'CS1 errors: display-names',
hidden = false,
},
err_doibroken_missing_doi = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|doi=</code>', -- $1 is parameter name
anchor = 'doibroken_missing_doi',
category = 'CS1 errors: DOI',
hidden = false
},
err_embargo_missing_pmc = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|pmc=</code>', -- $1 is parameter name
anchor = 'embargo_missing_pmc',
category = 'CS1 errors: PMC embargo',
hidden = false
},
err_empty_citation = {
message = 'Empty citation',
anchor = 'empty_citation',
category = 'CS1 errors: empty citation',
hidden = false
},
err_etal = {
message = 'Explicit use of et al. in: <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'explicit_et_al',
category = 'CS1 errors: explicit use of et al.',
hidden = false
},
err_extra_text_edition = {
message = '<code class="cs1-code">|edition=</code> has extra text',
anchor = 'extra_text_edition',
category = 'CS1 errors: extra text: edition',
hidden = false,
},
err_extra_text_issue = {
message = '<code class="cs1-code">|$1=</code> has extra text', -- $1 is parameter name
anchor = 'extra_text_issue',
category = 'CS1 errors: extra text: issue',
hidden = false,
},
err_extra_text_pages = {
message = '<code class="cs1-code">|$1=</code> has extra text', -- $1 is parameter name
anchor = 'extra_text_pages',
category = 'CS1 errors: extra text: pages',
hidden = false,
},
err_extra_text_volume = {
message = '<code class="cs1-code">|$1=</code> has extra text', -- $1 is parameter name
anchor = 'extra_text_volume',
category = 'CS1 errors: extra text: volume',
hidden = true,
},
err_first_missing_last = {
message = '<code class="cs1-code">|$1=</code> missing <code class="cs1-code">|$2=</code>', -- $1 is first alias, $2 is matching last alias
anchor = 'first_missing_last',
category = 'CS1 errors: missing name', -- author, contributor, editor, interviewer, translator
hidden = false
},
err_format_missing_url = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|$2=</code>', -- $1 is format parameter $2 is url parameter
anchor = 'format_missing_url',
category = 'CS1 errors: format without URL',
hidden = false
},
err_generic_name = {
message = '<code class="cs1-code">|$1=</code> has generic name', -- $1 is parameter name
anchor = 'generic_name',
category = 'CS1 errors: generic name',
hidden = false,
},
err_generic_title = {
message = 'Cite uses generic title',
anchor = 'generic_title',
category = 'CS1 errors: generic title',
hidden = false,
},
err_invalid_param_val = {
message = 'Invalid <code class="cs1-code">|$1=$2</code>', -- $1 is parameter name $2 is parameter value
anchor = 'invalid_param_val',
category = 'CS1 errors: invalid parameter value',
hidden = false
},
err_invisible_char = {
message = '$1 in $2 at position $3', -- $1 is invisible char $2 is parameter name $3 is position number
anchor = 'invisible_char',
category = 'CS1 errors: invisible characters',
hidden = false
},
err_missing_name = {
message = 'Missing <code class="cs1-code">|$1$2=</code>', -- $1 is modified NameList; $2 is enumerator
anchor = 'missing_name',
category = 'CS1 errors: missing name', -- author, contributor, editor, interviewer, translator
hidden = false
},
err_missing_periodical = {
message = 'Cite $1 requires <code class="cs1-code">|$2=</code>', -- $1 is cs1 template name; $2 is canonical periodical parameter name for cite $1
anchor = 'missing_periodical',
category = 'CS1 errors: missing periodical',
hidden = true
},
err_missing_pipe = {
message = 'Missing pipe in: <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'missing_pipe',
category = 'CS1 errors: missing pipe',
hidden = false
},
err_param_access_requires_param = {
message = '<code class="cs1-code">|$1-access=</code> requires <code class="cs1-code">|$1=</code>', -- $1 is parameter name
anchor = 'param_access_requires_param',
category = 'CS1 errors: param-access',
hidden = false
},
err_param_has_ext_link = {
message = 'External link in <code class="cs1-code">$1</code>', -- $1 is parameter name
anchor = 'param_has_ext_link',
category = 'CS1 errors: external links',
hidden = false
},
err_parameter_ignored = {
message = 'Unknown parameter <code class="cs1-code">|$1=</code> ignored', -- $1 is parameter name
anchor = 'parameter_ignored',
category = 'CS1 errors: unsupported parameter',
hidden = false
},
err_parameter_ignored_suggest = {
message = 'Unknown parameter <code class="cs1-code">|$1=</code> ignored (<code class="cs1-code">|$2=</code> suggested)', -- $1 is unknown parameter $2 is suggested parameter name
anchor = 'parameter_ignored_suggest',
category = 'CS1 errors: unsupported parameter',
hidden = false
},
err_redundant_parameters = {
message = 'More than one of $1 specified', -- $1 is error message detail
anchor = 'redundant_parameters',
category = 'CS1 errors: redundant parameter',
hidden = false
},
err_script_parameter = {
message = 'Invalid <code class="cs1-code">|$1=</code>: $2', -- $1 is parameter name $2 is script language code or error detail
anchor = 'script_parameter',
category = 'CS1 errors: script parameters',
hidden = false
},
err_ssrn_missing = {
message = '<code class="cs1-code">|ssrn=</code> required',
anchor = 'ssrn_missing',
category = 'CS1 errors: SSRN', -- same as bad arxiv
hidden = false
},
err_text_ignored = {
message = 'Text "$1" ignored', -- $1 is ignored text
anchor = 'text_ignored',
category = 'CS1 errors: unrecognized parameter',
hidden = false
},
err_trans_missing_title = {
message = '<code class="cs1-code">|trans-$1=</code> requires <code class="cs1-code">|$1=</code> or <code class="cs1-code">|script-$1=</code>', -- $1 is base parameter name
anchor = 'trans_missing_title',
category = 'CS1 errors: translated title',
hidden = false
},
err_param_unknown_empty = {
message = 'Cite has empty unknown parameter$1: $2', -- $1 is 's' or empty space; $2 is empty unknown param list
anchor = 'param_unknown_empty',
category = 'CS1 errors: empty unknown parameters',
hidden = false
},
err_vancouver = {
message = 'Vancouver style error: $1 in name $2', -- $1 is error detail, $2 is the nth name
anchor = 'vancouver',
category = 'CS1 errors: Vancouver style',
hidden = false
},
err_wikilink_in_url = {
message = 'URL–wikilink conflict', -- uses ndash
anchor = 'wikilink_in_url',
category = 'CS1 errors: URL–wikilink conflict', -- uses ndash
hidden = false
},
--[[--------------------------< M A I N T >-------------------------------------
maint messages do not have a message (message = nil); otherwise the structure
is the same as error messages
]]
maint_archived_copy = {
message = nil,
anchor = 'archived_copy',
category = 'CS1 maint: archived copy as title',
hidden = true,
},
maint_authors = {
message = nil,
anchor = 'authors',
category = 'CS1 maint: uses authors parameter',
hidden = true,
},
maint_bot_unknown = {
message = nil,
anchor = 'bot:_unknown',
category = 'CS1 maint: bot: original URL status unknown',
hidden = true,
},
maint_date_auto_xlated = { -- date auto-translation not supported by en.wiki
message = nil,
anchor = 'date_auto_xlated',
category = 'CS1 maint: date auto-translated',
hidden = true,
},
maint_date_format = {
message = nil,
anchor = 'date_format',
category = 'CS1 maint: date format',
hidden = true,
},
maint_date_year = {
message = nil,
anchor = 'date_year',
category = 'CS1 maint: date and year',
hidden = true,
},
maint_doi_ignore = {
message = nil,
anchor = 'doi_ignore',
category = 'CS1 maint: ignored DOI errors',
hidden = true,
},
maint_doi_inactive = {
message = nil,
anchor = 'doi_inactive',
category = 'CS1 maint: DOI inactive',
hidden = true,
},
maint_doi_inactive_dated = {
message = nil,
anchor = 'doi_inactive_dated',
category = 'CS1 maint: DOI inactive as of $2$3$1', -- $1 is year, $2 is month-name or empty string, $3 is space or empty string
hidden = true,
},
maint_extra_punct = {
message = nil,
anchor = 'extra_punct',
category = 'CS1 maint: extra punctuation',
hidden = true,
},
maint_isbn_ignore = {
message = nil,
anchor = 'ignore_isbn_err',
category = 'CS1 maint: ignored ISBN errors',
hidden = true,
},
maint_issn_ignore = {
message = nil,
anchor = 'ignore_issn',
category = 'CS1 maint: ignored ISSN errors',
hidden = true,
},
maint_jfm_format = {
message = nil,
anchor = 'jfm_format',
category = 'CS1 maint: JFM format',
hidden = true,
},
maint_location = {
message = nil,
anchor = 'location',
category = 'CS1 maint: location',
hidden = true,
},
maint_mr_format = {
message = nil,
anchor = 'mr_format',
category = 'CS1 maint: MR format',
hidden = true,
},
maint_mult_names = {
message = nil,
anchor = 'mult_names',
category = 'CS1 maint: multiple names: $1', -- $1 is '<name>s list'; gets value from special_case_translation table
hidden = true,
},
maint_numeric_names = {
message = nil,
anchor = 'numeric_names',
category = 'CS1 maint: numeric names: $1', -- $1 is '<name>s list'; gets value from special_case_translation table
hidden = true,
},
maint_others = {
message = nil,
anchor = 'others',
category = 'CS1 maint: others',
hidden = true,
},
maint_others_avm = {
message = nil,
anchor = 'others_avm',
category = 'CS1 maint: others in cite AV media (notes)',
hidden = true,
},
maint_pmc_embargo = {
message = nil,
anchor = 'embargo',
category = 'CS1 maint: PMC embargo expired',
hidden = true,
},
maint_pmc_format = {
message = nil,
anchor = 'pmc_format',
category = 'CS1 maint: PMC format',
hidden = true,
},
maint_postscript = {
message = nil,
anchor = 'postscript',
category = 'CS1 maint: postscript',
hidden = true,
},
maint_ref_duplicates_default = {
message = nil,
anchor = 'ref_default',
category = 'CS1 maint: ref duplicates default',
hidden = true,
},
maint_unfit = {
message = nil,
anchor = 'unfit',
category = 'CS1 maint: unfit URL',
hidden = true,
},
maint_unknown_lang = {
message = nil,
anchor = 'unknown_lang',
category = 'CS1 maint: unrecognized language',
hidden = true,
},
maint_untitled = {
message = nil,
anchor = 'untitled',
category = 'CS1 maint: untitled periodical',
hidden = true,
},
maint_url_status = {
message = nil,
anchor = 'url_status',
category = 'CS1 maint: url-status',
hidden = true,
},
maint_zbl = {
message = nil,
anchor = 'zbl',
category = 'CS1 maint: Zbl',
hidden = true,
},
}
--[[--------------------------< I D _ H A N D L E R S >--------------------------------------------------------
The following contains a list of values for various defined identifiers. For each
identifier we specify a variety of information necessary to properly render the
identifier in the citation.
parameters: a list of parameter aliases for this identifier; first in the list is the canonical form
link: Wikipedia article name
redirect: a local redirect to a local Wikipedia article name; at en.wiki, 'ISBN (identifier)' is a redirect to 'International Standard Book Number'
q: Wikidata q number for the identifier
label: the label preceding the identifier; label is linked to a Wikipedia article (in this order):
redirect from id_handlers['<id>'].redirect when use_identifier_redirects is true
Wikidata-supplied article name for the local wiki from id_handlers['<id>'].q
local article name from id_handlers['<id>'].link
prefix: the first part of a URL that will be concatenated with a second part which usually contains the identifier
suffix: optional third part to be added after the identifier
encode: true if URI should be percent-encoded; otherwise false
COinS: identifier link or keyword for use in COinS:
for identifiers registered at info-uri.info use: info:.... where '...' is the appropriate identifier label
for identifiers that have COinS keywords, use the keyword: rft.isbn, rft.issn, rft.eissn
for |asin= and |ol=, which require assembly, use the keyword: url
for others make a URL using the value in prefix/suffix and #label, use the keyword: pre (not checked; any text other than 'info', 'rft', or 'url' works here)
set to nil to leave the identifier out of the COinS
separator: character or text between label and the identifier in the rendered citation
id_limit: for those identifiers with established limits, this property holds the upper limit
access: use this parameter to set the access level for all instances of this identifier.
the value must be a valid access level for an identifier (see ['id-access'] in this file).
custom_access: to enable custom access level for an identifier, set this parameter
to the parameter that should control it (normally 'id-access')
]]
local id_handlers = {
['ARXIV'] = {
parameters = {'arxiv', 'eprint'},
link = 'arXiv',
redirect = 'arXiv (identifier)',
q = 'Q118398',
label = 'arXiv',
prefix = 'https://arxiv.org/abs/', -- protocol-relative tested 2013-09-04
encode = false,
COinS = 'info:arxiv',
separator = ':',
access = 'free', -- free to read
},
['ASIN'] = {
parameters = { 'asin', 'ASIN' },
link = 'Amazon Standard Identification Number',
redirect = 'ASIN (identifier)',
q = 'Q1753278',
label = 'ASIN',
prefix = 'https://www.amazon.',
COinS = 'url',
separator = ' ',
encode = false;
},
['BIBCODE'] = {
parameters = {'bibcode'},
link = 'Bibcode',
redirect = 'Bibcode (identifier)',
q = 'Q25754',
label = 'Bibcode',
prefix = 'https://ui.adsabs.harvard.edu/abs/',
encode = false,
COinS = 'info:bibcode',
separator = ':',
custom_access = 'bibcode-access',
},
['BIORXIV'] = {
parameters = {'biorxiv'},
link = 'bioRxiv',
redirect = 'bioRxiv (identifier)',
q = 'Q19835482',
label = 'bioRxiv',
prefix = 'https://doi.org/',
COinS = 'pre', -- use prefix value
access = 'free', -- free to read
encode = true,
separator = ' ',
},
['CITESEERX'] = {
parameters = {'citeseerx'},
link = 'CiteSeerX',
redirect = 'CiteSeerX (identifier)',
q = 'Q2715061',
label = 'CiteSeerX',
prefix = 'https://citeseerx.ist.psu.edu/viewdoc/summary?doi=',
COinS = 'pre', -- use prefix value
access = 'free', -- free to read
encode = true,
separator = ' ',
},
['DOI'] = { -- Used by InternetArchiveBot
parameters = { 'doi', 'DOI'},
link = 'Digital object identifier',
redirect = 'doi (identifier)',
q = 'Q25670',
label = 'doi',
prefix = 'https://doi.org/',
COinS = 'info:doi',
separator = ':',
encode = true,
custom_access = 'doi-access',
},
['EISSN'] = {
parameters = {'eissn', 'EISSN'},
link = 'International Standard Serial Number#Electronic ISSN',
redirect = 'eISSN (identifier)',
q = 'Q46339674',
label = 'eISSN',
prefix = 'https://www.worldcat.org/issn/',
COinS = 'rft.eissn',
encode = false,
separator = ' ',
},
['HDL'] = {
parameters = { 'hdl', 'HDL' },
link = 'Handle System',
redirect = 'hdl (identifier)',
q = 'Q3126718',
label = 'hdl',
prefix = 'https://hdl.handle.net/',
COinS = 'info:hdl',
separator = ':',
encode = true,
custom_access = 'hdl-access',
},
['ISBN'] = { -- Used by InternetArchiveBot
parameters = {'isbn', 'ISBN'},
link = 'International Standard Book Number',
redirect = 'ISBN (identifier)',
q = 'Q33057',
label = 'ISBN',
prefix = 'Special:BookSources/',
COinS = 'rft.isbn',
separator = ' ',
},
['ISMN'] = {
parameters = {'ismn', 'ISMN'},
link = 'International Standard Music Number',
redirect = 'ISMN (identifier)',
q = 'Q1666938',
label = 'ISMN',
prefix = '', -- not currently used;
COinS = nil, -- nil because we can't use pre or rft or info:
separator = ' ',
},
['ISSN'] = {
parameters = {'issn', 'ISSN'},
link = 'International Standard Serial Number',
redirect = 'ISSN (identifier)',
q = 'Q131276',
label = 'ISSN',
prefix = 'https://www.worldcat.org/issn/',
COinS = 'rft.issn',
encode = false,
separator = ' ',
},
['JFM'] = {
parameters = {'jfm', 'JFM'},
link = 'Jahrbuch über die Fortschritte der Mathematik',
redirect = 'JFM (identifier)',
q = '',
label = 'JFM',
prefix = 'https://zbmath.org/?format=complete&q=an:',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
['JSTOR'] = {
parameters = {'jstor', 'JSTOR'},
link = 'JSTOR',
redirect = 'JSTOR (identifier)',
q = 'Q1420342',
label = 'JSTOR',
prefix = 'https://www.jstor.org/stable/', -- protocol-relative tested 2013-09-04
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
custom_access = 'jstor-access',
},
['LCCN'] = {
parameters = {'lccn', 'LCCN'},
link = 'Library of Congress Control Number',
redirect = 'LCCN (identifier)',
q = 'Q620946',
label = 'LCCN',
prefix = 'https://lccn.loc.gov/', -- protocol-relative tested 2015-12-28
COinS = 'info:lccn',
encode = false,
separator = ' ',
},
['MR'] = {
parameters = {'mr', 'MR'},
link = 'Mathematical Reviews',
redirect = 'MR (identifier)',
q = 'Q211172',
label = 'MR',
prefix = 'https://mathscinet.ams.org/mathscinet-getitem?mr=',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
['OCLC'] = {
parameters = {'oclc', 'OCLC'},
link = 'OCLC',
redirect = 'OCLC (identifier)',
q = 'Q190593',
label = 'OCLC',
prefix = 'https://www.worldcat.org/oclc/',
COinS = 'info:oclcnum',
encode = true,
separator = ' ',
id_limit = 9999999999, -- 10-digits
},
['OL'] = {
parameters = { 'ol', 'OL' },
link = 'Open Library',
redirect = 'OL (identifier)',
q = 'Q1201876',
label = 'OL',
prefix = 'https://openlibrary.org/',
COinS = 'url',
separator = ' ',
encode = true,
custom_access = 'ol-access',
},
['OSTI'] = {
parameters = {'osti', 'OSTI'},
link = 'Office of Scientific and Technical Information',
redirect = 'OSTI (identifier)',
q = 'Q2015776',
label = 'OSTI',
prefix = 'https://www.osti.gov/biblio/', -- protocol-relative tested 2018-09-12
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
id_limit = 23010000,
custom_access = 'osti-access',
},
['PMC'] = {
parameters = {'pmc', 'PMC'},
link = 'PubMed Central',
redirect = 'PMC (identifier)',
q = 'Q229883',
label = 'PMC',
prefix = 'https://www.ncbi.nlm.nih.gov/pmc/articles/PMC',
suffix = '',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
id_limit = 10500000,
access = 'free', -- free to read
},
['PMID'] = {
parameters = {'pmid', 'PMID'},
link = 'PubMed Identifier',
redirect = 'PMID (identifier)',
q = 'Q2082879',
label = 'PMID',
prefix = 'https://pubmed.ncbi.nlm.nih.gov/',
COinS = 'info:pmid',
encode = false,
separator = ' ',
id_limit = 37900000,
},
['RFC'] = {
parameters = {'rfc', 'RFC'},
link = 'Request for Comments',
redirect = 'RFC (identifier)',
q = 'Q212971',
label = 'RFC',
prefix = 'https://tools.ietf.org/html/rfc',
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
id_limit = 9300,
access = 'free', -- free to read
},
['SBN'] = {
parameters = {'sbn', 'SBN'},
link = 'Standard Book Number', -- redirect to International_Standard_Book_Number#History
redirect = 'SBN (identifier)',
label = 'SBN',
prefix = 'Special:BookSources/0-', -- prefix has leading zero necessary to make 9-digit sbn a 10-digit isbn
COinS = nil, -- nil because we can't use pre or rft or info:
separator = ' ',
},
['SSRN'] = {
parameters = {'ssrn', 'SSRN'},
link = 'Social Science Research Network',
redirect = 'SSRN (identifier)',
q = 'Q7550801',
label = 'SSRN',
prefix = 'https://papers.ssrn.com/sol3/papers.cfm?abstract_id=',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
id_limit = 4600000,
custom_access = 'ssrn-access',
},
['S2CID'] = {
parameters = {'s2cid', 'S2CID'},
link = 'Semantic Scholar',
redirect = 'S2CID (identifier)',
q = 'Q22908627',
label = 'S2CID',
prefix = 'https://api.semanticscholar.org/CorpusID:',
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
id_limit = 262000000,
custom_access = 's2cid-access',
},
['USENETID'] = {
parameters = {'message-id'},
link = 'Usenet',
redirect = 'Usenet (identifier)',
q = 'Q193162',
label = 'Usenet:',
prefix = 'news:',
encode = false,
COinS = 'pre', -- use prefix value
separator = ' ',
},
['ZBL'] = {
parameters = {'zbl', 'ZBL' },
link = 'Zentralblatt MATH',
redirect = 'Zbl (identifier)',
q = 'Q190269',
label = 'Zbl',
prefix = 'https://zbmath.org/?format=complete&q=an:',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
}
--[[--------------------------< E X P O R T S >---------------------------------
]]
return {
use_identifier_redirects = true, -- when true use redirect name for identifier label links; always true at en.wiki
local_lang_cat_enable = false; -- when true categorizes pages where |language=<local wiki's language>; always false at en.wiki
date_name_auto_xlate_enable = false; -- when true translates English month-names to the local-wiki's language month names; always false at en.wiki
date_digit_auto_xlate_enable = false; -- when true translates Western date digit to the local-wiki's language digits (date_names['local_digits']); always false at en.wiki
-- tables and variables created when this module is loaded
global_df = get_date_format (), -- this line can be replaced with "global_df = 'dmy-all'," to have all dates auto translated to dmy format.
punct_skip = build_skip_table (punct_skip, punct_meta_params),
url_skip = build_skip_table (url_skip, url_meta_params),
aliases = aliases,
special_case_translation = special_case_translation,
date_names = date_names,
err_msg_supl = err_msg_supl,
error_conditions = error_conditions,
editor_markup_patterns = editor_markup_patterns,
et_al_patterns = et_al_patterns,
id_handlers = id_handlers,
keywords_lists = keywords_lists,
keywords_xlate = keywords_xlate,
stripmarkers = stripmarkers,
invisible_chars = invisible_chars,
invisible_defs = invisible_defs,
indic_script = indic_script,
emoji_t = emoji_t,
maint_cats = maint_cats,
messages = messages,
presentation = presentation,
prop_cats = prop_cats,
script_lang_codes = script_lang_codes,
lang_code_remap = lang_code_remap,
lang_name_remap = lang_name_remap,
this_wiki_code = this_wiki_code,
title_types = title_types,
uncategorized_namespaces = uncategorized_namespaces_t,
uncategorized_subpages = uncategorized_subpages,
templates_using_volume = templates_using_volume,
templates_using_issue = templates_using_issue,
templates_not_using_page = templates_not_using_page,
vol_iss_pg_patterns = vol_iss_pg_patterns,
single_letter_2nd_lvl_domains_t = single_letter_2nd_lvl_domains_t,
inter_wiki_map = inter_wiki_map,
mw_languages_by_tag_t = mw_languages_by_tag_t,
mw_languages_by_name_t = mw_languages_by_name_t,
citation_class_map_t = citation_class_map_t,
citation_issue_t = citation_issue_t,
citation_no_volume_t = citation_no_volume_t,
}
2cdaf417af636e6e0b4981038bd6c539ee5190a7
Module:Citation/CS1/Whitelist
828
113
235
234
2023-08-10T15:23:11Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Citation/CS1/Whitelist]]
Scribunto
text/plain
--[[--------------------------< S U P P O R T E D P A R A M E T E R S >--------------------------------------
Because a steady-state signal conveys no useful information, whitelist.basic_arguments[] list items can have three values:
true - these parameters are valid and supported parameters
false - these parameters are deprecated but still supported
tracked - these parameters are valid and supported parameters tracked in an eponymous properties category
nil - these parameters are no longer supported. remove entirely
]]
local basic_arguments = {
['accessdate'] = true,
['access-date'] = true,
['agency'] = true,
['archivedate'] = true,
['archive-date'] = true,
['archive-format'] = true,
['archiveurl'] = true,
['archive-url'] = true,
['article'] = true,
['article-format'] = true,
['article-number'] = true, -- {{cite journal}}, {{cite conference}}; {{citation}} when |journal= has a value
['article-url'] = true,
['article-url-access'] = true,
['arxiv'] = true, -- cite arxiv; here because allowed in cite ... as identifier
['asin'] = true,
['ASIN'] = true,
['asin-tld'] = true,
['at'] = true,
['author'] = true,
['author-first'] = true,
['author-given'] = true,
['author-last'] = true,
['author-surname'] = true,
['authorlink'] = true,
['author-link'] = true,
['author-mask'] = true,
['authors'] = true,
['bibcode'] = true,
['bibcode-access'] = true,
['biorxiv'] = true, -- cite biorxiv; here because allowed in cite ... as identifier
['chapter'] = true,
['chapter-format'] = true,
['chapter-url'] = true,
['chapter-url-access'] = true,
['citeseerx'] = true, -- cite citeseerx; here because allowed in cite ... as identifier
['collaboration'] = true,
['contribution'] = true,
['contribution-format'] = true,
['contribution-url'] = true,
['contribution-url-access'] = true,
['contributor'] = true,
['contributor-first'] = true,
['contributor-given'] = true,
['contributor-last'] = true,
['contributor-surname'] = true,
['contributor-link'] = true,
['contributor-mask'] = true,
['date'] = true,
['department'] = true,
['df'] = true,
['dictionary'] = true,
['display-authors'] = true,
['display-contributors'] = true,
['display-editors'] = true,
['display-interviewers'] = true,
['display-subjects'] = true,
['display-translators'] = true,
['doi'] = true,
['DOI'] = true,
['doi-access'] = true,
['doi-broken-date'] = true,
['edition'] = true,
['editor'] = true,
['editor-first'] = true,
['editor-given'] = true,
['editor-last'] = true,
['editor-surname'] = true,
['editor-link'] = true,
['editor-mask'] = true,
['eissn'] = true,
['EISSN'] = true,
['encyclopaedia'] = true,
['encyclopedia'] = true,
['entry'] = true,
['entry-format'] = true,
['entry-url'] = true,
['entry-url-access'] = true,
['eprint'] = true, -- cite arxiv; here because allowed in cite ... as identifier
['first'] = true,
['format'] = true,
['given'] = true,
['hdl'] = true,
['HDL'] = true,
['hdl-access'] = true,
['host'] = true, -- unique to certain templates?
['id'] = true,
['ID'] = true,
['institution'] = true, -- constrain to cite thesis?
['interviewer'] = true,
['interviewer-first'] = true,
['interviewer-given'] = true,
['interviewer-last'] = true,
['interviewer-surname'] = true,
['interviewer-link'] = true,
['interviewer-mask'] = true,
['isbn'] = true,
['ISBN'] = true,
['ismn'] = true,
['ISMN'] = true,
['issn'] = true,
['ISSN'] = true,
['issue'] = true,
['jfm'] = true,
['JFM'] = true,
['journal'] = true,
['jstor'] = true,
['JSTOR'] = true,
['jstor-access'] = true,
['lang'] = true,
['language'] = true,
['last'] = true,
['lay-date'] = false,
['lay-format'] = false,
['lay-source'] = false,
['lay-url'] = false,
['lccn'] = true,
['LCCN'] = true,
['location'] = true,
['magazine'] = true,
['medium'] = true,
['minutes'] = true, -- constrain to cite AV media and podcast?
['mode'] = true,
['mr'] = true,
['MR'] = true,
['name-list-style'] = true,
['newspaper'] = true,
['no-pp'] = true,
['no-tracking'] = true,
['number'] = true,
['oclc'] = true,
['OCLC'] = true,
['ol'] = true,
['OL'] = true,
['ol-access'] = true,
['orig-date'] = true,
['origyear'] = true,
['orig-year'] = true,
['osti'] = true,
['OSTI'] = true,
['osti-access'] = true,
['others'] = true,
['p'] = true,
['page'] = true,
['pages'] = true,
['people'] = true,
['periodical'] = true,
['place'] = true,
['pmc'] = true,
['PMC'] = true,
['pmc-embargo-date'] = true,
['pmid'] = true,
['PMID'] = true,
['postscript'] = true,
['pp'] = true,
['publication-date'] = true,
['publication-place'] = true,
['publisher'] = true,
['quotation'] = true,
['quote'] = true,
['quote-page'] = true,
['quote-pages'] = true,
['ref'] = true,
['rfc'] = true,
['RFC'] = true,
['sbn'] = true,
['SBN'] = true,
['scale'] = true,
['script-article'] = true,
['script-chapter'] = true,
['script-contribution'] = true,
['script-entry'] = true,
['script-journal'] = true,
['script-magazine'] = true,
['script-newspaper'] = true,
['script-periodical'] = true,
['script-quote'] = true,
['script-section'] = true,
['script-title'] = true,
['script-website'] = true,
['script-work'] = true,
['section'] = true,
['section-format'] = true,
['section-url'] = true,
['section-url-access'] = true,
['series'] = true,
['ssrn'] = true, -- cite ssrn; these three here because allowed in cite ... as identifier
['SSRN'] = true,
['ssrn-access'] = true,
['subject'] = true,
['subject-link'] = true,
['subject-mask'] = true,
['surname'] = true,
['s2cid'] = true,
['S2CID'] = true,
['s2cid-access'] = true,
['template-doc-demo'] = true,
['time'] = true, -- constrain to cite av media and podcast?
['time-caption'] = true, -- constrain to cite av media and podcast?
['title'] = true,
['title-link'] = true,
['translator'] = true,
['translator-first'] = true,
['translator-given'] = true,
['translator-last'] = true,
['translator-surname'] = true,
['translator-link'] = true,
['translator-mask'] = true,
['trans-article'] = true,
['trans-chapter'] = true,
['trans-contribution'] = true,
['trans-entry'] = true,
['trans-journal'] = true,
['trans-magazine'] = true,
['trans-newspaper'] = true,
['trans-periodical'] = true,
['trans-quote'] = true,
['trans-section'] = true,
['trans-title'] = true,
['trans-website'] = true,
['trans-work'] = true,
['type'] = true,
['url'] = true,
['URL'] = true,
['url-access'] = true,
['url-status'] = true,
['vauthors'] = true,
['veditors'] = true,
['version'] = true,
['via'] = true,
['volume'] = true,
['website'] = true,
['work'] = true,
['year'] = true,
['zbl'] = true,
['ZBL'] = true,
}
local numbered_arguments = {
['author#'] = true,
['author-first#'] = true,
['author#-first'] = true,
['author-given#'] = true,
['author#-given'] = true,
['author-last#'] = true,
['author#-last'] = true,
['author-surname#'] = true,
['author#-surname'] = true,
['author-link#'] = true,
['author#-link'] = true,
['authorlink#'] = true,
['author#link'] = true,
['author-mask#'] = true,
['author#-mask'] = true,
['contributor#'] = true,
['contributor-first#'] = true,
['contributor#-first'] = true,
['contributor-given#'] = true,
['contributor#-given'] = true,
['contributor-last#'] = true,
['contributor#-last'] = true,
['contributor-surname#'] = true,
['contributor#-surname'] = true,
['contributor-link#'] = true,
['contributor#-link'] = true,
['contributor-mask#'] = true,
['contributor#-mask'] = true,
['editor#'] = true,
['editor-first#'] = true,
['editor#-first'] = true,
['editor-given#'] = true,
['editor#-given'] = true,
['editor-last#'] = true,
['editor#-last'] = true,
['editor-surname#'] = true,
['editor#-surname'] = true,
['editor-link#'] = true,
['editor#-link'] = true,
['editor-mask#'] = true,
['editor#-mask'] = true,
['first#'] = true,
['given#'] = true,
['host#'] = true,
['interviewer#'] = true,
['interviewer-first#'] = true,
['interviewer#-first'] = true,
['interviewer-given#'] = true,
['interviewer#-given'] = true,
['interviewer-last#'] = true,
['interviewer#-last'] = true,
['interviewer-surname#'] = true,
['interviewer#-surname'] = true,
['interviewer-link#'] = true,
['interviewer#-link'] = true,
['interviewer-mask#'] = true,
['interviewer#-mask'] = true,
['last#'] = true,
['subject#'] = true,
['subject-link#'] = true,
['subject#-link'] = true,
['subject-mask#'] = true,
['subject#-mask'] = true,
['surname#'] = true,
['translator#'] = true,
['translator-first#'] = true,
['translator#-first'] = true,
['translator-given#'] = true,
['translator#-given'] = true,
['translator-last#'] = true,
['translator#-last'] = true,
['translator-surname#'] = true,
['translator#-surname'] = true,
['translator-link#'] = true,
['translator#-link'] = true,
['translator-mask#'] = true,
['translator#-mask'] = true,
}
--[[--------------------------< P R E P R I N T S U P P O R T E D P A R A M E T E R S >--------------------
Cite arXiv, cite biorxiv, cite citeseerx, and cite ssrn are preprint templates that use the limited set of parameters
defined in the limited_basic_arguments and limited_numbered_arguments tables. Those lists are supplemented with a
template-specific list of parameters that are required by the particular template and may be exclusive to one of the
preprint templates. Some of these parameters may also be available to the general cs1|2 templates.
Same conventions for true/false/tracked/nil as above.
]]
local preprint_arguments = {
arxiv = {
['arxiv'] = true, -- cite arxiv and arxiv identifiers
['class'] = true,
['eprint'] = true, -- cite arxiv and arxiv identifiers
},
biorxiv = {
['biorxiv'] = true,
},
citeseerx = {
['citeseerx'] = true,
},
ssrn = {
['ssrn'] = true,
['SSRN'] = true,
['ssrn-access'] = true,
},
}
--[[--------------------------< L I M I T E D S U P P O R T E D P A R A M E T E R S >----------------------
cite arxiv, cite biorxiv, cite citeseerx, and cite ssrn templates are preprint templates so are allowed only a
limited subset of parameters allowed to all other cs1|2 templates. The limited subset is defined here.
Same conventions for true/false/tracked/nil as above.
]]
local limited_basic_arguments = {
['at'] = true,
['author'] = true,
['author-first'] = true,
['author-given'] = true,
['author-last'] = true,
['author-surname'] = true,
['author-link'] = true,
['authorlink'] = true,
['author-mask'] = true,
['authors'] = true,
['collaboration'] = true,
['date'] = true,
['df'] = true,
['display-authors'] = true,
['first'] = true,
['given'] = true,
['language'] = true,
['last'] = true,
['mode'] = true,
['name-list-style'] = true,
['no-tracking'] = true,
['p'] = true,
['page'] = true,
['pages'] = true,
['postscript'] = true,
['pp'] = true,
['quotation'] = true,
['quote'] = true,
['ref'] = true,
['surname'] = true,
['template-doc-demo'] = true,
['title'] = true,
['trans-title'] = true,
['vauthors'] = true,
['year'] = true,
}
local limited_numbered_arguments = {
['author#'] = true,
['author-first#'] = true,
['author#-first'] = true,
['author-given#'] = true,
['author#-given'] = true,
['author-last#'] = true,
['author#-last'] = true,
['author-surname#'] = true,
['author#-surname'] = true,
['author-link#'] = true,
['author#-link'] = true,
['authorlink#'] = true,
['author#link'] = true,
['author-mask#'] = true,
['author#-mask'] = true,
['first#'] = true,
['given#'] = true,
['last#'] = true,
['surname#'] = true,
}
--[[--------------------------< U N I Q U E _ A R G U M E N T S >----------------------------------------------
Some templates have unique parameters. Those templates and their unique parameters are listed here. Keys in this
table are the template's CitationClass parameter value
Same conventions for true/false/tracked/nil as above.
]]
local unique_arguments = {
['audio-visual'] = {
['transcript'] = true,
['transcript-format'] = true,
['transcript-url'] = true,
},
conference = {
['book-title'] = true,
['conference'] = true,
['conference-format'] = true,
['conference-url'] = true,
['event'] = true,
},
episode = {
['airdate'] = true,
['air-date'] = true,
['credits'] = true,
['episode-link'] = true, -- alias of |title-link=
['network'] = true,
['season'] = true,
['series-link'] = true,
['series-no'] = true,
['series-number'] = true,
['station'] = true,
['transcript'] = true,
['transcript-format'] = true,
['transcripturl'] = false,
['transcript-url'] = true,
},
mailinglist = {
['mailing-list'] = true,
},
map = {
['cartography'] = true,
['inset'] = true,
['map'] = true,
['map-format'] = true,
['map-url'] = true,
['map-url-access'] = true,
['script-map'] = true,
['sections'] = true,
['sheet'] = true,
['sheets'] = true,
['trans-map'] = true,
},
newsgroup = {
['message-id'] = true,
['newsgroup'] = true,
},
report = {
['docket'] = true,
},
serial = {
['airdate'] = true,
['air-date'] = true,
['credits'] = true,
['episode'] = true, -- cite serial only TODO: make available to cite episode?
['episode-link'] = true, -- alias of |title-link=
['network'] = true,
['series-link'] = true,
['station'] = true,
},
speech = {
['conference'] = true,
['conference-format'] = true,
['conference-url'] = true,
['event'] = true,
},
thesis = {
['degree'] = true,
['docket'] = true,
},
}
--[[--------------------------< T E M P L A T E _ L I S T _ G E T >--------------------------------------------
gets a list of the templates from table t
]]
local function template_list_get (t)
local out = {}; -- a table for output
for k, _ in pairs (t) do -- spin through the table and collect the keys
table.insert (out, k) -- add each key to the output table
end
return out; -- and done
end
--[[--------------------------< E X P O R T E D T A B L E S >------------------------------------------------
]]
return {
basic_arguments = basic_arguments,
numbered_arguments = numbered_arguments,
limited_basic_arguments = limited_basic_arguments,
limited_numbered_arguments = limited_numbered_arguments,
preprint_arguments = preprint_arguments,
preprint_template_list = template_list_get (preprint_arguments), -- make a template list from preprint_arguments{} table
unique_arguments = unique_arguments,
unique_param_template_list = template_list_get (unique_arguments), -- make a template list from unique_arguments{} table
};
7c70519c4a7fa5776be7289982de9107c7a95c04
Module:Citation/CS1/Utilities
828
114
237
236
2023-08-10T15:23:11Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Citation/CS1/Utilities]]
Scribunto
text/plain
local z = {
error_cats_t = {}; -- for categorizing citations that contain errors
error_ids_t = {}; -- list of error identifiers; used to prevent duplication of certain errors; local to this module
error_msgs_t = {}; -- sequence table of error messages
maint_cats_t = {}; -- for categorizing citations that aren't erroneous per se, but could use a little work
prop_cats_t = {}; -- for categorizing citations based on certain properties, language of source for instance
prop_keys_t = {}; -- for adding classes to the citation's <cite> tag
};
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set (var)
return not (var == nil or var == '');
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array (needle, haystack)
if needle == nil then
return false;
end
for n, v in ipairs (haystack) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< H A S _ A C C E P T _ A S _ W R I T T E N >------------------------------------
When <str> is wholly wrapped in accept-as-written markup, return <str> without markup and true; return <str> and false else
with allow_empty = false, <str> must have at least one character inside the markup
with allow_empty = true, <str> the markup frame can be empty like (()) to distinguish an empty template parameter from the specific condition "has no applicable value" in citation-context.
After further evaluation the two cases might be merged at a later stage, but should be kept separated for now.
]]
local function has_accept_as_written (str, allow_empty)
if not is_set (str) then
return str, false;
end
local count;
if true == allow_empty then
str, count = str:gsub ('^%(%((.*)%)%)$', '%1'); -- allows (()) to be an empty set
else
str, count = str:gsub ('^%(%((.+)%)%)$', '%1');
end
return str, 0 ~= count;
end
--[[--------------------------< S U B S T I T U T E >----------------------------------------------------------
Populates numbered arguments in a message string using an argument table. <args> may be a single string or a
sequence table of multiple strings.
]]
local function substitute (msg, args)
return args and mw.message.newRawMessage (msg, args):plain() or msg;
end
--[[--------------------------< E R R O R _ C O M M E N T >----------------------------------------------------
Wraps error messages with CSS markup according to the state of hidden. <content> may be a single string or a
sequence table of multiple strings.
]]
local function error_comment (content, hidden)
return substitute (hidden and cfg.presentation['hidden-error'] or cfg.presentation['visible-error'], content);
end
--[[--------------------------< H Y P H E N _ T O _ D A S H >--------------------------------------------------
Converts a hyphen to a dash under certain conditions. The hyphen must separate
like items; unlike items are returned unmodified. These forms are modified:
letter - letter (A - B)
digit - digit (4-5)
digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)
letterdigit - letterdigit (A1-A5) (an optional separator between letter and
digit is supported – a.1-a.5 or a-1-a-5)
digitletter - digitletter (5a - 5d) (an optional separator between letter and
digit is supported – 5.a-5.d or 5-a-5-d)
any other forms are returned unmodified.
str may be a comma- or semicolon-separated list
]]
local function hyphen_to_dash (str)
if not is_set (str) then
return str;
end
local accept; -- boolean
str = str:gsub ("(%(%(.-%)%))", function(m) return m:gsub(",", ","):gsub(";", ";") end) -- replace commas and semicolons in accept-as-written markup with similar unicode characters so they'll be ignored during the split
str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—'] = '—'}); -- replace — and – entities with their characters; semicolon mucks up the text.split
str = str:gsub ('-', '-'); -- replace HTML numeric entity with hyphen character
str = str:gsub (' ', ' '); -- replace entity with generic keyboard space character
local out = {};
local list = mw.text.split (str, '%s*[,;]%s*'); -- split str at comma or semicolon separators if there are any
for _, item in ipairs (list) do -- for each item in the list
item, accept = has_accept_as_written (item); -- remove accept-this-as-written markup when it wraps all of item
if not accept and mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators
if item:match ('^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit)
item:match ('^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter)
item:match ('^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$') or -- digit separator digit hyphen digit separator digit
item:match ('^%d+%s*%-%s*%d+$') or -- digit hyphen digit
item:match ('^%a+%s*%-%s*%a+$') then -- letter hyphen letter
item = item:gsub ('(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)', '%1–%2'); -- replace hyphen, remove extraneous space characters
else
item = mw.ustring.gsub (item, '%s*[–—]%s*', '–'); -- for endash or emdash separated ranges, replace em with en, remove extraneous whitespace
end
end
table.insert (out, item); -- add the (possibly modified) item to the output table
end
local temp_str = ''; -- concatenate the output table into a comma separated string
temp_str, accept = has_accept_as_written (table.concat (out, ', ')); -- remove accept-this-as-written markup when it wraps all of concatenated out
if accept then
temp_str = has_accept_as_written (str); -- when global markup removed, return original str; do it this way to suppress boolean second return value
return temp_str:gsub(",", ","):gsub(";", ";");
else
return temp_str:gsub(",", ","):gsub(";", ";"); -- else, return assembled temp_str
end
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided (or link and display are the same), returns a wikilink in the form [[L]]; if neither are
provided or link is omitted, returns an empty string.
]=]
local function make_wikilink (link, display)
if not is_set (link) then return '' end
if is_set (display) and link ~= display then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
end
--[[--------------------------< S E T _ M E S S A G E >----------------------------------------------------------
Sets an error message using the ~/Configuration error_conditions{} table along with arguments supplied in the function
call, inserts the resulting message in z.error_msgs_t{} sequence table, and returns the error message.
<error_id> – key value for appropriate error handler in ~/Configuration error_conditions{} table
<arguments> – may be a single string or a sequence table of multiple strings to be subsititued into error_conditions[error_id].message
<raw> – boolean
true – causes this function to return the error message not wrapped in visible-error, hidden-error span tag;
returns error_conditions[error_id].hidden as a second return value
does not add message to z.error_msgs_t sequence table
false, nil – adds message wrapped in visible-error, hidden-error span tag to z.error_msgs_t
returns the error message wrapped in visible-error, hidden-error span tag; there is no second return value
<prefix> – string to be prepended to <message> -- TODO: remove support for these unused(?) arguments?
<suffix> – string to be appended to <message>
TODO: change z.error_cats_t and z.maint_cats_t to have the form cat_name = true? this to avoid dups without having to have an extra table
]]
local added_maint_cats = {} -- list of maintenance categories that have been added to z.maint_cats_t; TODO: figure out how to delete this table
local function set_message (error_id, arguments, raw, prefix, suffix)
local error_state = cfg.error_conditions[error_id];
prefix = prefix or '';
suffix = suffix or '';
if error_state == nil then
error (cfg.messages['undefined_error'] .. ': ' .. error_id); -- because missing error handler in Module:Citation/CS1/Configuration
elseif is_set (error_state.category) then
if error_state.message then -- when error_state.message defined, this is an error message
table.insert (z.error_cats_t, error_state.category);
else
if not added_maint_cats[error_id] then
added_maint_cats[error_id] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (error_state.category, arguments)); -- make cat name then add to table
end
return; -- because no message, nothing more to do
end
end
local message = substitute (error_state.message, arguments);
message = table.concat (
{
message,
' (',
make_wikilink (
table.concat (
{
cfg.messages['help page link'],
'#',
error_state.anchor
}),
cfg.messages['help page label']),
')'
});
z.error_ids_t[error_id] = true;
if z.error_ids_t['err_citation_missing_title'] and -- if missing-title error already noted
in_array (error_id, {'err_bare_url_missing_title', 'err_trans_missing_title'}) then -- and this error is one of these
return '', false; -- don't bother because one flavor of missing title is sufficient
end
message = table.concat ({prefix, message, suffix});
if true == raw then
return message, error_state.hidden; -- return message not wrapped in visible-error, hidden-error span tag
end
message = error_comment (message, error_state.hidden); -- wrap message in visible-error, hidden-error span tag
table.insert (z.error_msgs_t, message); -- add it to the messages sequence table
return message; -- and done; return value generally not used but is used as a flag in various functions of ~/Identifiers
end
--[[-------------------------< I S _ A L I A S _ U S E D >-----------------------------------------------------
This function is used by select_one() to determine if one of a list of alias parameters is in the argument list
provided by the template.
Input:
args – pointer to the arguments table from calling template
alias – one of the list of possible aliases in the aliases lists from Module:Citation/CS1/Configuration
index – for enumerated parameters, identifies which one
enumerated – true/false flag used to choose how enumerated aliases are examined
value – value associated with an alias that has previously been selected; nil if not yet selected
selected – the alias that has previously been selected; nil if not yet selected
error_list – list of aliases that are duplicates of the alias already selected
Returns:
value – value associated with alias we selected or that was previously selected or nil if an alias not yet selected
selected – the alias we selected or the alias that was previously selected or nil if an alias not yet selected
]]
local function is_alias_used (args, alias, index, enumerated, value, selected, error_list)
if enumerated then -- is this a test for an enumerated parameters?
alias = alias:gsub ('#', index); -- replace '#' with the value in index
else
alias = alias:gsub ('#', ''); -- remove '#' if it exists
end
if is_set (args[alias]) then -- alias is in the template's argument list
if value ~= nil and selected ~= alias then -- if we have already selected one of the aliases
local skip;
for _, v in ipairs (error_list) do -- spin through the error list to see if we've added this alias
if v == alias then
skip = true;
break; -- has been added so stop looking
end
end
if not skip then -- has not been added so
table.insert (error_list, alias); -- add error alias to the error list
end
else
value = args[alias]; -- not yet selected an alias, so select this one
selected = alias;
end
end
return value, selected; -- return newly selected alias, or previously selected alias
end
--[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
Adds a category to z.maint_cats_t using names from the configuration file with additional text if any.
To prevent duplication, the added_maint_cats table lists the categories by key that have been added to z.maint_cats_t.
]]
local function add_maint_cat (key, arguments)
if not added_maint_cats [key] then
added_maint_cats [key] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (cfg.maint_cats [key], arguments)); -- make name then add to table
end
end
--[[--------------------------< A D D _ P R O P _ C A T >--------------------------------------------------------
Adds a category to z.prop_cats_t using names from the configuration file with additional text if any.
foreign_lang_source and foreign_lang_source_2 keys have a language code appended to them so that multiple languages
may be categorized but multiples of the same language are not categorized.
added_prop_cats is a table declared in page scope variables above
]]
local added_prop_cats = {}; -- list of property categories that have been added to z.prop_cats_t
local function add_prop_cat (key, arguments, key_modifier)
local key_modified = key .. ((key_modifier and key_modifier) or ''); -- modify <key> with <key_modifier> if present and not nil
if not added_prop_cats [key_modified] then
added_prop_cats [key_modified] = true; -- note that we've added this category
table.insert (z.prop_cats_t, substitute (cfg.prop_cats [key], arguments)); -- make name then add to table
table.insert (z.prop_keys_t, 'cs1-prop-' .. key); -- convert key to class for use in the citation's <cite> tag
end
end
--[[--------------------------< S A F E _ F O R _ I T A L I C S >----------------------------------------------
Protects a string that will be wrapped in wiki italic markup '' ... ''
Note: We cannot use <i> for italics, as the expected behavior for italics specified by ''...'' in the title is that
they will be inverted (i.e. unitalicized) in the resulting references. In addition, <i> and '' tend to interact
poorly under Mediawiki's HTML tidy.
]]
local function safe_for_italics (str)
if not is_set (str) then return str end
if str:sub (1, 1) == "'" then str = "<span></span>" .. str; end
if str:sub (-1, -1) == "'" then str = str .. "<span></span>"; end
return str:gsub ('\n', ' '); -- Remove newlines as they break italics.
end
--[[--------------------------< W R A P _ S T Y L E >----------------------------------------------------------
Applies styling to various parameters. Supplied string is wrapped using a message_list configuration taking one
argument; protects italic styled parameters. Additional text taken from citation_config.presentation - the reason
this function is similar to but separate from wrap_msg().
]]
local function wrap_style (key, str)
if not is_set (str) then
return "";
elseif in_array (key, {'italic-title', 'trans-italic-title'}) then
str = safe_for_italics (str);
end
return substitute (cfg.presentation[key], {str});
end
--[[--------------------------< M A K E _ S E P _ L I S T >------------------------------------------------------------
make a separated list of items using provided separators.
<sep_list> - typically '<comma><space>'
<sep_list_pair> - typically '<space>and<space>'
<sep_list_end> - typically '<comma><space>and<space>' or '<comma><space>&<space>'
defaults to cfg.presentation['sep_list'], cfg.presentation['sep_list_pair'], and cfg.presentation['sep_list_end']
if <sep_list_end> is specified, <sep_list> and <sep_list_pair> must also be supplied
]]
local function make_sep_list (count, list_seq, sep_list, sep_list_pair, sep_list_end)
local list = '';
if not sep_list then -- set the defaults
sep_list = cfg.presentation['sep_list'];
sep_list_pair = cfg.presentation['sep_list_pair'];
sep_list_end = cfg.presentation['sep_list_end'];
end
if 2 >= count then
list = table.concat (list_seq, sep_list_pair); -- insert separator between two items; returns list_seq[1] then only one item
elseif 2 < count then
list = table.concat (list_seq, sep_list, 1, count - 1); -- concatenate all but last item with plain list separator
list = table.concat ({list, list_seq[count]}, sep_list_end); -- concatenate last item onto end of <list> with final separator
end
return list;
end
--[[--------------------------< S E L E C T _ O N E >----------------------------------------------------------
Chooses one matching parameter from a list of parameters to consider. The list of parameters to consider is just
names. For parameters that may be enumerated, the position of the numerator in the parameter name is identified
by the '#' so |author-last1= and |author1-last= are represented as 'author-last#' and 'author#-last'.
Because enumerated parameter |<param>1= is an alias of |<param>= we must test for both possibilities.
Generates an error if more than one match is present.
]]
local function select_one (args, aliases_list, error_condition, index)
local value = nil; -- the value assigned to the selected parameter
local selected = ''; -- the name of the parameter we have chosen
local error_list = {};
if index ~= nil then index = tostring(index); end
for _, alias in ipairs (aliases_list) do -- for each alias in the aliases list
if alias:match ('#') then -- if this alias can be enumerated
if '1' == index then -- when index is 1 test for enumerated and non-enumerated aliases
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- first test for non-enumerated alias
end
value, selected = is_alias_used (args, alias, index, true, value, selected, error_list); -- test for enumerated alias
else
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- test for non-enumerated alias
end
end
if #error_list > 0 and 'none' ~= error_condition then -- for cases where this code is used outside of extract_names()
for i, v in ipairs (error_list) do
error_list[i] = wrap_style ('parameter', v);
end
table.insert (error_list, wrap_style ('parameter', selected));
set_message (error_condition, {make_sep_list (#error_list, error_list)});
end
return value, selected;
end
--[=[-------------------------< R E M O V E _ W I K I _ L I N K >----------------------------------------------
Gets the display text from a wikilink like [[A|B]] or [[B]] gives B
The str:gsub() returns either A|B froma [[A|B]] or B from [[B]] or B from B (no wikilink markup).
In l(), l:gsub() removes the link and pipe (if they exist); the second :gsub() trims whitespace from the label
if str was wrapped in wikilink markup. Presumably, this is because without wikimarkup in str, there is no match
in the initial gsub, the replacement function l() doesn't get called.
]=]
local function remove_wiki_link (str)
return (str:gsub ("%[%[([^%[%]]*)%]%]", function(l)
return l:gsub ("^[^|]*|(.*)$", "%1" ):gsub ("^%s*(.-)%s*$", "%1");
end));
end
--[=[-------------------------< I S _ W I K I L I N K >--------------------------------------------------------
Determines if str is a wikilink, extracts, and returns the wikilink type, link text, and display text parts.
If str is a complex wikilink ([[L|D]]):
returns wl_type 2 and D and L from [[L|D]];
if str is a simple wikilink ([[D]])
returns wl_type 1 and D from [[D]] and L as empty string;
if not a wikilink:
returns wl_type 0, str as D, and L as empty string.
trims leading and trailing whitespace and pipes from L and D ([[L|]] and [[|D]] are accepted by MediaWiki and
treated like [[D]]; while [[|D|]] is not accepted by MediaWiki, here, we accept it and return D without the pipes).
]=]
local function is_wikilink (str)
local D, L
local wl_type = 2; -- assume that str is a complex wikilink [[L|D]]
if not str:match ('^%[%[[^%]]+%]%]$') then -- is str some sort of a wikilink (must have some sort of content)
return 0, str, ''; -- not a wikilink; return wl_type as 0, str as D, and empty string as L
end
L, D = str:match ('^%[%[([^|]+)|([^%]]+)%]%]$'); -- get L and D from [[L|D]]
if not is_set (D) then -- if no separate display
D = str:match ('^%[%[([^%]]*)|*%]%]$'); -- get D from [[D]] or [[D|]]
wl_type = 1;
end
D = mw.text.trim (D, '%s|'); -- trim white space and pipe characters
return wl_type, D, L or '';
end
--[[--------------------------< S T R I P _ A P O S T R O P H E _ M A R K U P >--------------------------------
Strip wiki italic and bold markup from argument so that it doesn't contaminate COinS metadata.
This function strips common patterns of apostrophe markup. We presume that editors who have taken the time to
markup a title have, as a result, provided valid markup. When they don't, some single apostrophes are left behind.
Returns the argument without wiki markup and a number; the number is more-or-less meaningless except as a flag
to indicate that markup was replaced; do not rely on it as an indicator of how many of any kind of markup was
removed; returns the argument and nil when no markup removed
]]
local function strip_apostrophe_markup (argument)
if not is_set (argument) then
return argument, nil; -- no argument, nothing to do
end
if nil == argument:find ( "''", 1, true ) then -- Is there at least one double apostrophe? If not, exit.
return argument, nil;
end
local flag;
while true do
if argument:find ("'''''", 1, true) then -- bold italic (5)
argument, flag = argument:gsub ("%'%'%'%'%'", ""); -- remove all instances of it
elseif argument:find ("''''", 1, true) then -- italic start and end without content (4)
argument, flag=argument:gsub ("%'%'%'%'", "");
elseif argument:find ("'''", 1, true) then -- bold (3)
argument, flag=argument:gsub ("%'%'%'", "");
elseif argument:find ("''", 1, true) then -- italic (2)
argument, flag = argument:gsub ("%'%'", "");
else
break;
end
end
return argument, flag; -- done
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr)
cfg = cfg_table_ptr;
end
--[[--------------------------< E X P O R T S >----------------------------------------------------------------
]]
return {
add_maint_cat = add_maint_cat, -- exported functions
add_prop_cat = add_prop_cat,
error_comment = error_comment,
has_accept_as_written = has_accept_as_written,
hyphen_to_dash = hyphen_to_dash,
in_array = in_array,
is_set = is_set,
is_wikilink = is_wikilink,
make_sep_list = make_sep_list,
make_wikilink = make_wikilink,
remove_wiki_link = remove_wiki_link,
safe_for_italics = safe_for_italics,
select_one = select_one,
set_message = set_message,
set_selected_modules = set_selected_modules,
strip_apostrophe_markup = strip_apostrophe_markup,
substitute = substitute,
wrap_style = wrap_style,
z = z, -- exported table
}
b006801b48981b2987f20fc09cbe0dfda525e044
Module:Citation/CS1/Date validation
828
115
239
238
2023-08-10T15:23:11Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Citation/CS1/Date_validation]]
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local add_prop_cat, is_set, in_array, set_message, substitute, wrap_style; -- imported functions from selected Module:Citation/CS1/Utilities
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< F I L E - S C O P E D E C L A R A T I O N S >--------------------------------
File-scope variables are declared here
]]
local lang_object = mw.getContentLanguage(); -- used by is_valid_accessdate(), is_valid_year(), date_name_xlate(); TODO: move to ~/Configuration?
local year_limit; -- used by is_valid_year()
--[=[-------------------------< I S _ V A L I D _ A C C E S S D A T E >----------------------------------------
returns true if:
Wikipedia start date <= accessdate < today + 2 days
Wikipedia start date is 2001-01-15T00:00:00 UTC which is 979516800 seconds after 1970-01-01T00:00:00 UTC (the start of Unix time)
accessdate is the date provided in |access-date= at time 00:00:00 UTC
today is the current date at time 00:00:00 UTC plus 48 hours
if today is 2015-01-01T00:00:00 then
adding 24 hours gives 2015-01-02T00:00:00 – one second more than today
adding 24 hours gives 2015-01-03T00:00:00 – one second more than tomorrow
This function does not work if it is fed month names for languages other than English. Wikimedia #time: parser
apparently doesn't understand non-English date month names. This function will always return false when the date
contains a non-English month name because good1 is false after the call to lang.formatDate(). To get around that
call this function with YYYY-MM-DD format dates.
]=]
local function is_valid_accessdate (accessdate)
local good1, good2;
local access_ts, tomorrow_ts; -- to hold Unix time stamps representing the dates
good1, access_ts = pcall (lang_object.formatDate, lang_object, 'U', accessdate ); -- convert accessdate value to Unix timestamp
good2, tomorrow_ts = pcall (lang_object.formatDate, lang_object, 'U', 'today + 2 days' ); -- today midnight + 2 days is one second more than all day tomorrow
if good1 and good2 then -- lang.formatDate() returns a timestamp in the local script which which tonumber() may not understand
access_ts = tonumber (access_ts) or lang_object:parseFormattedNumber (access_ts); -- convert to numbers for the comparison;
tomorrow_ts = tonumber (tomorrow_ts) or lang_object:parseFormattedNumber (tomorrow_ts);
else
return false; -- one or both failed to convert to Unix time stamp
end
if 979516800 <= access_ts and access_ts < tomorrow_ts then -- Wikipedia start date <= accessdate < tomorrow's date
return true;
else
return false; -- accessdate out of range
end
end
--[[--------------------------< G E T _ M O N T H _ N U M B E R >----------------------------------------------
returns a number according to the month in a date: 1 for January, etc. Capitalization and spelling must be correct.
If not a valid month, returns 0
]]
local function get_month_number (month)
return cfg.date_names['local'].long[month] or cfg.date_names['local'].short[month] or -- look for local names first
cfg.date_names['en'].long[month] or cfg.date_names['en'].short[month] or -- failing that, look for English names
0; -- not a recognized month name
end
--[[--------------------------< G E T _ S E A S O N _ N U M B E R >--------------------------------------------
returns a number according to the sequence of seasons in a year: 21 for Spring, etc. Capitalization and spelling
must be correct. If not a valid season, returns 0.
21-24 = Spring, Summer, Autumn, Winter, independent of “Hemisphere”
returns 0 when <param> is not |date=
Season numbering is defined by Extended Date/Time Format (EDTF) specification (https://www.loc.gov/standards/datetime/)
which became part of ISO 8601 in 2019. See '§Sub-year groupings'. The standard defines various divisions using
numbers 21-41. cs1|2 only supports generic seasons. EDTF does support the distinction between north and south
hemisphere seasons but cs1|2 has no way to make that distinction.
These additional divisions not currently supported:
25-28 = Spring - Northern Hemisphere, Summer- Northern Hemisphere, Autumn - Northern Hemisphere, Winter - Northern Hemisphere
29-32 = Spring – Southern Hemisphere, Summer– Southern Hemisphere, Autumn – Southern Hemisphere, Winter - Southern Hemisphere
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
37-39 = Quadrimester 1, Quadrimester 2, Quadrimester 3 (4 months each)
40-41 = Semestral 1, Semestral-2 (6 months each)
]]
local function get_season_number (season, param)
if 'date' ~= param then
return 0; -- season dates only supported by |date=
end
return cfg.date_names['local'].season[season] or -- look for local names first
cfg.date_names['en'].season[season] or -- failing that, look for English names
0; -- not a recognized season name
end
--[[--------------------------< G E T _ Q U A R T E R _ N U M B E R >------------------------------------------
returns a number according to the sequence of quarters in a year: 33 for first quarter, etc. Capitalization and spelling
must be correct. If not a valid quarter, returns 0.
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
returns 0 when <param> is not |date=
Quarter numbering is defined by Extended Date/Time Format (EDTF) specification (https://www.loc.gov/standards/datetime/)
which became part of ISO 8601 in 2019. See '§Sub-year groupings'. The standard defines various divisions using
numbers 21-41. cs1|2 only supports generic seasons and quarters.
These additional divisions not currently supported:
37-39 = Quadrimester 1, Quadrimester 2, Quadrimester 3 (4 months each)
40-41 = Semestral 1, Semestral-2 (6 months each)
]]
local function get_quarter_number (quarter, param)
if 'date' ~= param then
return 0; -- quarter dates only supported by |date=
end
quarter = mw.ustring.gsub (quarter, ' +', ' '); -- special case replace multiple space chars with a single space char
return cfg.date_names['local'].quarter[quarter] or -- look for local names first
cfg.date_names['en'].quarter[quarter] or -- failing that, look for English names
0; -- not a recognized quarter name
end
--[[--------------------------< G E T _ P R O P E R _ N A M E _ N U M B E R >----------------------------------
returns a non-zero number if date contains a recognized proper-name. Capitalization and spelling must be correct.
returns 0 when <param> is not |date=
]]
local function get_proper_name_number (name, param)
if 'date' ~= param then
return 0; -- proper-name dates only supported by |date=
end
return cfg.date_names['local'].named[name] or -- look for local names dates first
cfg.date_names['en'].named[name] or -- failing that, look for English names
0; -- not a recognized named date
end
--[[--------------------------< G E T _ E L E M E N T _ N U M B E R <------------------------------------------
returns true if month or season or quarter or proper name is valid (properly spelled, capitalized, abbreviated)
]]
local function get_element_number (element, param)
local num;
local funcs = {get_month_number, get_season_number, get_quarter_number, get_proper_name_number}; -- list of functions to execute in order
for _, func in ipairs (funcs) do -- spin through the function list
num = func (element, param); -- call the function and get the returned number
if 0 ~= num then -- non-zero when valid month season quarter
return num; -- return that number
end
end
return nil; -- not valid
end
--[[--------------------------< I S _ V A L I D _ Y E A R >----------------------------------------------------
Function gets current year from the server and compares it to year from a citation parameter. Years more than one
year in the future are not acceptable.
Special case for |pmc-embargo-date=: years more than two years in the future are not acceptable
]]
local function is_valid_year (year, param)
if not is_set (year_limit) then
year_limit = tonumber(os.date("%Y"))+1; -- global variable so we only have to fetch it once
end
year = tonumber (year) or lang_object:parseFormattedNumber (year); -- convert to number for the comparison;
if 'pmc-embargo-date' == param then -- special case for |pmc-embargo-date=
return year and (year <= tonumber(os.date("%Y"))+2) or false; -- years more than two years in the future are not accepted
end
return year and (year <= year_limit) or false;
end
--[[--------------------------< I S _ V A L I D _ D A T E >----------------------------------------------------
Returns true if day is less than or equal to the number of days in month and year is no farther into the future
than next year; else returns false.
Assumes Julian calendar prior to year 1582 and Gregorian calendar thereafter. Accounts for Julian calendar leap
years before 1582 and Gregorian leap years after 1582. Where the two calendars overlap (1582 to approximately
1923) dates are assumed to be Gregorian.
]]
local function is_valid_date (year, month, day, param)
local days_in_month = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
local month_length;
if not is_valid_year (year, param) then -- no farther into the future than next year except |pmc-embargo-date= no more than two years in the future
return false;
end
month = tonumber (month); -- required for YYYY-MM-DD dates
if (2 == month) then -- if February
month_length = 28; -- then 28 days unless
if 1582 > tonumber(year) then -- Julian calendar
if 0 == (year%4) then -- is a leap year?
month_length = 29; -- if leap year then 29 days in February
end
else -- Gregorian calendar
if (0 == (year%4) and (0 ~= (year%100) or 0 == (year%400))) then -- is a leap year?
month_length = 29; -- if leap year then 29 days in February
end
end
else
month_length = days_in_month[month];
end
if tonumber (day) > month_length then
return false;
end
return true;
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ R A N G E _ S T Y L E >--------------------------
Months in a range are expected to have the same style: Jan–Mar or October–December but not February–Mar or Jul–August.
This function looks in cfg.date_names{} to see if both month names are listed in the long subtable or both are
listed in the short subtable. When both have the same style (both are listed in the same table), returns true; false else
]]
local function is_valid_month_range_style (month1, month2)
if (cfg.date_names.en.long[month1] and cfg.date_names.en.long[month2]) or -- are both English names listed in the long subtable?
(cfg.date_names.en.short[month1] and cfg.date_names.en.short[month2]) or -- are both English names listed in the short subtable?
(cfg.date_names['local'].long[month1] and cfg.date_names['local'].long[month2]) or -- are both local names listed in the long subtable?
(cfg.date_names['local'].short[month1] and cfg.date_names['local'].short[month2]) then -- are both local names listed in the short subtable?
return true;
end
return false; -- names are mixed
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ S E A S O N _ R A N G E >------------------------
Check a pair of months or seasons to see if both are valid members of a month or season pair.
Month pairs are expected to be left to right, earliest to latest in time.
All season ranges are accepted as valid because there are publishers out there who have published a Summer–Spring YYYY issue, hence treat as ok
]]
local function is_valid_month_season_range(range_start, range_end, param)
local range_start_number = get_month_number (range_start);
local range_end_number;
if 0 == range_start_number then -- is this a month range?
range_start_number = get_season_number (range_start, param); -- not a month; is it a season? get start season number
range_end_number = get_season_number (range_end, param); -- get end season number
if (0 ~= range_start_number) and (0 ~= range_end_number) and (range_start_number ~= range_end_number) then
return true; -- any season pairing is accepted except when both are the same
end
return false; -- range_start and/or range_end is not a season
end
-- here when range_start is a month
range_end_number = get_month_number (range_end); -- get end month number
if range_start_number < range_end_number and -- range_start is a month; does range_start precede range_end?
is_valid_month_range_style (range_start, range_end) then -- do months have the same style?
return true; -- proper order and same style
end
return false; -- range_start month number is greater than or equal to range end number; or range end isn't a month
end
--[[--------------------------< M A K E _ C O I N S _ D A T E >------------------------------------------------
This function receives a table of date parts for one or two dates and an empty table reference declared in
Module:Citation/CS1. The function is called only for |date= parameters and only if the |date=<value> is
determined to be a valid date format. The question of what to do with invalid date formats is not answered here.
The date parts in the input table are converted to an ISO 8601 conforming date string:
single whole dates: yyyy-mm-dd
month and year dates: yyyy-mm
year dates: yyyy
ranges: yyyy-mm-dd/yyyy-mm-dd
yyyy-mm/yyyy-mm
yyyy/yyyy
Dates in the Julian calendar are reduced to year or year/year so that we don't have to do calendar conversion from
Julian to Proleptic Gregorian.
The input table has:
year, year2 – always present; if before 1582, ignore months and days if present
month, month2 – 0 if not provided, 1-12 for months, 21-24 for seasons; 99 Christmas
day, day2 – 0 if not provided, 1-31 for days
the output table receives:
rftdate: an ISO 8601 formatted date
rftchron: a free-form version of the date, usually without year which is in rftdate (season ranges and proper-name dates)
rftssn: one of four season keywords: winter, spring, summer, fall (lowercase)
rftquarter: one of four values: 1, 2, 3, 4
]]
local function make_COinS_date (input, tCOinS_date)
local date; -- one date or first date in a range
local date2 = ''; -- end of range date
-- start temporary Julian / Gregorian calendar uncertainty detection
local year = tonumber(input.year); -- this temporary code to determine the extent of sources dated to the Julian/Gregorian
local month = tonumber(input.month); -- interstice 1 October 1582 – 1 January 1926
local day = tonumber (input.day);
if (0 ~= day) and -- day must have a value for this to be a whole date
(((1582 == year) and (10 <= month) and (12 >= month)) or -- any whole 1582 date from 1 October to 31 December or
((1926 == year) and (1 == month) and (1 == input.day)) or -- 1 January 1926 or
((1582 < year) and (1925 >= year))) then -- any date 1 January 1583 – 31 December 1925
tCOinS_date.inter_cal_cat = true; -- set category flag true
end
-- end temporary Julian / Gregorian calendar uncertainty detection
if 1582 > tonumber(input.year) or 20 < tonumber(input.month) then -- Julian calendar or season so &rft.date gets year only
date = input.year;
if 0 ~= input.year2 and input.year ~= input.year2 then -- if a range, only the second year portion when not the same as range start year
date = string.format ('%.4d/%.4d', tonumber(input.year), tonumber(input.year2)) -- assemble the date range
end
if 20 < tonumber(input.month) then -- if season or proper-name date
local season = {[24] = 'winter', [21] = 'spring', [22] = 'summer', [23] = 'fall', [33] = '1', [34] = '2', [35] = '3', [36] = '4', [98] = 'Easter', [99] = 'Christmas'}; -- seasons lowercase, no autumn; proper-names use title case
if 0 == input.month2 then -- single season date
if 40 < tonumber(input.month) then
tCOinS_date.rftchron = season[input.month]; -- proper-name dates
elseif 30 < tonumber(input.month) then
tCOinS_date.rftquarter = season[input.month]; -- quarters
else
tCOinS_date.rftssn = season[input.month]; -- seasons
end
else -- season range with a second season specified
if input.year ~= input.year2 then -- season year – season year range or season year–year
tCOinS_date.rftssn = season[input.month]; -- start of range season; keep this?
if 0~= input.month2 then
tCOinS_date.rftchron = string.format ('%s %s – %s %s', season[input.month], input.year, season[input.month2], input.year2);
end
else -- season–season year range
tCOinS_date.rftssn = season[input.month]; -- start of range season; keep this?
tCOinS_date.rftchron = season[input.month] .. '–' .. season[input.month2]; -- season–season year range
end
end
end
tCOinS_date.rftdate = date;
return; -- done
end
if 0 ~= input.day then
date = string.format ('%s-%.2d-%.2d', input.year, tonumber(input.month), tonumber(input.day)); -- whole date
elseif 0 ~= input.month then
date = string.format ('%s-%.2d', input.year, tonumber(input.month)); -- year and month
else
date = string.format ('%s', input.year); -- just year
end
if 0 ~= input.year2 then
if 0 ~= input.day2 then
date2 = string.format ('/%s-%.2d-%.2d', input.year2, tonumber(input.month2), tonumber(input.day2)); -- whole date
elseif 0 ~= input.month2 then
date2 = string.format ('/%s-%.2d', input.year2, tonumber(input.month2)); -- year and month
else
date2 = string.format ('/%s', input.year2); -- just year
end
end
tCOinS_date.rftdate = date .. date2; -- date2 has the '/' separator
return;
end
--[[--------------------------< P A T T E R N S >--------------------------------------------------------------
this is the list of patterns for date formats that this module recognizes. Approximately the first half of these
patterns represent formats that might be reformatted into another format. Those that might be reformatted have
'indicator' letters that identify the content of the matching capture: 'd' (day), 'm' (month), 'a' (anchor year),
'y' (year); second day, month, year have a '2' suffix.
These patterns are used for both date validation and for reformatting. This table should not be moved to ~/Configuration
because changes to this table require changes to check_date() and to reformatter() and reformat_date()
]]
local patterns = {
-- year-initial numerical year-month-day
['ymd'] = {'^(%d%d%d%d)%-(%d%d)%-(%d%d)$', 'y', 'm', 'd'},
-- month-initial: month day, year
['Mdy'] = {'^(%D-) +([1-9]%d?), +((%d%d%d%d?)%a?)$', 'm', 'd', 'a', 'y'},
-- month-initial day range: month day–day, year; days are separated by endash
['Md-dy'] = {'^(%D-) +([1-9]%d?)[%-–]([1-9]%d?), +((%d%d%d%d)%a?)$', 'm', 'd', 'd2', 'a', 'y'},
-- day-initial: day month year
['dMy'] = {'^([1-9]%d?) +(%D-) +((%d%d%d%d?)%a?)$', 'd', 'm', 'a', 'y'},
-- year-initial: year month day; day: 1 or 2 two digits, leading zero allowed; not supported at en.wiki
-- ['yMd'] = {'^((%d%d%d%d?)%a?) +(%D-) +(%d%d?)$', 'a', 'y', 'm', 'd'},
-- day-range-initial: day–day month year; days are separated by endash
['d-dMy'] = {'^([1-9]%d?)[%-–]([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'd2', 'm', 'a', 'y'},
-- day initial month-day-range: day month - day month year; uses spaced endash
['dM-dMy'] = {'^([1-9]%d?) +(%D-) +[%-–] +([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'm', 'd2', 'm2', 'a', 'y'},
-- month initial month-day-range: month day – month day, year; uses spaced endash
['Md-Mdy'] = {'^(%D-) +([1-9]%d?) +[%-–] +(%D-) +([1-9]%d?), +((%d%d%d%d)%a?)$','m', 'd', 'm2', 'd2', 'a', 'y'},
-- day initial month-day-year-range: day month year - day month year; uses spaced endash
['dMy-dMy'] = {'^([1-9]%d?) +(%D-) +(%d%d%d%d) +[%-–] +([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'm', 'y', 'd2', 'm2', 'a', 'y2'},
-- month initial month-day-year-range: month day, year – month day, year; uses spaced endash
['Mdy-Mdy'] = {'^(%D-) +([1-9]%d?), +(%d%d%d%d) +[%-–] +(%D-) +([1-9]%d?), +((%d%d%d%d)%a?)$', 'm', 'd', 'y', 'm2', 'd2', 'a', 'y2'},
-- these date formats cannot be converted, per se, but month name can be rendered short or long
-- month/season year - month/season year; separated by spaced endash
['My-My'] = {'^(%D-) +(%d%d%d%d) +[%-–] +(%D-) +((%d%d%d%d)%a?)$', 'm', 'y', 'm2', 'a', 'y2'},
-- month/season range year; months separated by endash
['M-My'] = {'^(%D-)[%-–](%D-) +((%d%d%d%d)%a?)$', 'm', 'm2', 'a', 'y'},
-- month/season year or proper-name year; quarter year when First Quarter YYYY etc.
['My'] = {'^([^%d–]-) +((%d%d%d%d)%a?)$', 'm', 'a', 'y'}, -- this way because endash is a member of %D; %D- will match January–March 2019 when it shouldn't
-- these date formats cannot be converted
['Sy4-y2'] = {'^(%D-) +((%d%d)%d%d)[%-–]((%d%d)%a?)$'}, -- special case Winter/Summer year-year (YYYY-YY); year separated with unspaced endash
['Sy-y'] = {'^(%D-) +(%d%d%d%d)[%-–]((%d%d%d%d)%a?)$'}, -- special case Winter/Summer year-year; year separated with unspaced endash
['y-y'] = {'^(%d%d%d%d?)[%-–]((%d%d%d%d?)%a?)$'}, -- year range: YYY-YYY or YYY-YYYY or YYYY–YYYY; separated by unspaced endash; 100-9999
['y4-y2'] = {'^((%d%d)%d%d)[%-–]((%d%d)%a?)$'}, -- year range: YYYY–YY; separated by unspaced endash
['y'] = {'^((%d%d%d%d?)%a?)$'}, -- year; here accept either YYY or YYYY
}
--[[--------------------------< I S _ V A L I D _ E M B A R G O _ D A T E >------------------------------------
returns true and date value if that value has proper dmy, mdy, ymd format.
returns false and 9999 (embargoed forever) when date value is not proper format; assumes that when |pmc-embargo-date= is
set, the editor intended to embargo a PMC but |pmc-embargo-date= does not hold a single date.
]]
local function is_valid_embargo_date (v)
if v:match (patterns['ymd'][1]) or -- ymd
v:match (patterns['Mdy'][1]) or -- dmy
v:match (patterns['dMy'][1]) then -- mdy
return true, v;
end
return false, '9999'; -- if here not good date so return false and set embargo date to long time in future
end
--[[--------------------------< C H E C K _ D A T E >----------------------------------------------------------
Check date format to see that it is one of the formats approved by WP:DATESNO or WP:DATERANGE. Exception: only
allowed range separator is endash. Additionally, check the date to see that it is a real date: no 31 in 30-day
months; no 29 February when not a leap year. Months, both long-form and three character abbreviations, and seasons
must be spelled correctly. Future years beyond next year are not allowed.
If the date fails the format tests, this function returns false and does not return values for anchor_year and
COinS_date. When this happens, the date parameter is (DEBUG: not?) used in the COinS metadata and the CITEREF identifier gets
its year from the year parameter if present otherwise CITEREF does not get a date value.
Inputs:
date_string - date string from date-holding parameters (date, year, publication-date, access-date, pmc-embargo-date, archive-date, lay-date)
Returns:
false if date string is not a real date; else
true, anchor_year, COinS_date
anchor_year can be used in CITEREF anchors
COinS_date is ISO 8601 format date; see make_COInS_date()
]]
local function check_date (date_string, param, tCOinS_date)
local year; -- assume that year2, months, and days are not used;
local year2 = 0; -- second year in a year range
local month = 0;
local month2 = 0; -- second month in a month range
local day = 0;
local day2 = 0; -- second day in a day range
local anchor_year;
local coins_date;
if date_string:match (patterns['ymd'][1]) then -- year-initial numerical year month day format
year, month, day = date_string:match (patterns['ymd'][1]);
if 12 < tonumber(month) or 1 > tonumber(month) or 1582 > tonumber(year) or 0 == tonumber(day) then return false; end -- month or day number not valid or not Gregorian calendar
anchor_year = year;
elseif mw.ustring.match(date_string, patterns['Mdy'][1]) then -- month-initial: month day, year
month, day, anchor_year, year = mw.ustring.match(date_string, patterns['Mdy'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
elseif mw.ustring.match(date_string, patterns['Md-dy'][1]) then -- month-initial day range: month day–day, year; days are separated by endash
month, day, day2, anchor_year, year = mw.ustring.match(date_string, patterns['Md-dy'][1]);
if tonumber(day) >= tonumber(day2) then return false; end -- date range order is left to right: earlier to later; dates may not be the same;
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
month2=month; -- for metadata
year2 = year;
elseif mw.ustring.match(date_string, patterns['dMy'][1]) then -- day-initial: day month year
day, month, anchor_year, year = mw.ustring.match(date_string, patterns['dMy'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
--[[ NOT supported at en.wiki
elseif mw.ustring.match(date_string, patterns['yMd'][1]) then -- year-initial: year month day; day: 1 or 2 two digits, leading zero allowed
anchor_year, year, month, day = mw.ustring.match(date_string, patterns['yMd'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
-- end NOT supported at en.wiki ]]
elseif mw.ustring.match(date_string, patterns['d-dMy'][1]) then -- day-range-initial: day–day month year; days are separated by endash
day, day2, month, anchor_year, year = mw.ustring.match(date_string, patterns['d-dMy'][1]);
if tonumber(day) >= tonumber(day2) then return false; end -- date range order is left to right: earlier to later; dates may not be the same;
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
month2 = month; -- for metadata
year2 = year;
elseif mw.ustring.match(date_string, patterns['dM-dMy'][1]) then -- day initial month-day-range: day month - day month year; uses spaced endash
day, month, day2, month2, anchor_year, year = mw.ustring.match(date_string, patterns['dM-dMy'][1]);
if (not is_valid_month_season_range(month, month2)) or not is_valid_year(year) then return false; end -- date range order is left to right: earlier to later;
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
year2 = year;
elseif mw.ustring.match(date_string, patterns['Md-Mdy'][1]) then -- month initial month-day-range: month day – month day, year; uses spaced endash
month, day, month2, day2, anchor_year, year = mw.ustring.match(date_string, patterns['Md-Mdy'][1]);
if (not is_valid_month_season_range(month, month2, param)) or not is_valid_year(year) then return false; end
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
year2 = year;
elseif mw.ustring.match(date_string, patterns['dMy-dMy'][1]) then -- day initial month-day-year-range: day month year - day month year; uses spaced endash
day, month, year, day2, month2, anchor_year, year2 = mw.ustring.match(date_string, patterns['dMy-dMy'][1]);
if tonumber(year2) <= tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) or not is_valid_month_range_style(month, month2) then return false; end -- year2 no more than one year in the future; months same style
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
if 0 == month or 0 == month2 then return false; end -- both must be valid
elseif mw.ustring.match(date_string, patterns['Mdy-Mdy'][1]) then -- month initial month-day-year-range: month day, year – month day, year; uses spaced endash
month, day, year, month2, day2, anchor_year, year2 = mw.ustring.match(date_string, patterns['Mdy-Mdy'][1]);
if tonumber(year2) <= tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) or not is_valid_month_range_style(month, month2) then return false; end -- year2 no more than one year in the future; months same style
month = get_month_number (month); -- for metadata
month2 = get_month_number(month2);
if 0 == month or 0 == month2 then return false; end -- both must be valid
elseif mw.ustring.match(date_string, patterns['Sy4-y2'][1]) then -- special case Winter/Summer year-year (YYYY-YY); year separated with unspaced endash
local century;
month, year, century, anchor_year, year2 = mw.ustring.match(date_string, patterns['Sy4-y2'][1]);
if 'Winter' ~= month and 'Summer' ~= month then return false end; -- 'month' can only be Winter or Summer
anchor_year = year .. '–' .. anchor_year; -- assemble anchor_year from both years
year2 = century..year2; -- add the century to year2 for comparisons
if 1 ~= tonumber(year2) - tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
month = get_season_number(month, param);
elseif mw.ustring.match(date_string, patterns['Sy-y'][1]) then -- special case Winter/Summer year-year; year separated with unspaced endash
month, year, anchor_year, year2 = mw.ustring.match(date_string, patterns['Sy-y'][1]);
month = get_season_number (month, param); -- <month> can only be winter or summer; also for metadata
if (month ~= cfg.date_names['en'].season['Winter']) and (month ~= cfg.date_names['en'].season['Summer']) then
return false; -- not Summer or Winter; abandon
end
anchor_year = year .. '–' .. anchor_year; -- assemble anchor_year from both years
if 1 ~= tonumber(year2) - tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match(date_string, patterns['My-My'][1]) then -- month/season year - month/season year; separated by spaced endash
month, year, month2, anchor_year, year2 = mw.ustring.match(date_string, patterns['My-My'][1]);
anchor_year = year .. '–' .. anchor_year; -- assemble anchor_year from both years
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
if 0 ~= get_month_number(month) and 0 ~= get_month_number(month2) and is_valid_month_range_style(month, month2) then -- both must be month year, same month style
month = get_month_number(month);
month2 = get_month_number(month2);
elseif 0 ~= get_season_number(month, param) and 0 ~= get_season_number(month2, param) then -- both must be season year, not mixed
month = get_season_number(month, param);
month2 = get_season_number(month2, param);
else
return false;
end
elseif mw.ustring.match(date_string, patterns['M-My'][1]) then -- month/season range year; months separated by endash
month, month2, anchor_year, year = mw.ustring.match(date_string, patterns['M-My'][1]);
if (not is_valid_month_season_range(month, month2, param)) or (not is_valid_year(year)) then return false; end
if 0 ~= get_month_number(month) then -- determined to be a valid range so just check this one to know if month or season
month = get_month_number(month);
month2 = get_month_number(month2);
if 0 == month or 0 == month2 then return false; end
else
month = get_season_number(month, param);
month2 = get_season_number(month2, param);
end
year2 = year;
elseif mw.ustring.match(date_string, patterns['My'][1]) then -- month/season/quarter/proper-name year
month, anchor_year, year = mw.ustring.match(date_string, patterns['My'][1]);
if not is_valid_year(year) then return false; end
month = get_element_number(month, param); -- get month season quarter proper-name number or nil
if not month then return false; end -- not valid whatever it is
elseif mw.ustring.match(date_string, patterns['y-y'][1]) then -- Year range: YYY-YYY or YYY-YYYY or YYYY–YYYY; separated by unspaced endash; 100-9999
year, anchor_year, year2 = mw.ustring.match(date_string, patterns['y-y'][1]);
anchor_year = year .. '–' .. anchor_year; -- assemble anchor year from both years
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match(date_string, patterns['y4-y2'][1]) then -- Year range: YYYY–YY; separated by unspaced endash
local century;
year, century, anchor_year, year2 = mw.ustring.match(date_string, patterns['y4-y2'][1]);
anchor_year = year .. '–' .. anchor_year; -- assemble anchor year from both years
if in_array (param, {'date', 'publication-date', 'year'}) then
add_prop_cat ('year-range-abbreviated');
end
if 13 > tonumber(year2) then return false; end -- don't allow 2003-05 which might be May 2003
year2 = century .. year2; -- add the century to year2 for comparisons
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match(date_string, patterns['y'][1]) then -- year; here accept either YYY or YYYY
anchor_year, year = mw.ustring.match(date_string, patterns['y'][1]);
if false == is_valid_year(year) then
return false;
end
else
return false; -- date format not one of the MOS:DATE approved formats
end
if param ~= 'date' then -- CITEREF disambiguation only allowed in |date=; |year= & |publication-date= promote to date
if anchor_year:match ('%l$') then
return false;
end
end
if 'access-date' == param then -- test accessdate here because we have numerical date parts
if 0 ~= year and 0 ~= month and 0 ~= day and -- all parts of a single date required
0 == year2 and 0 == month2 and 0 == day2 then -- none of these; accessdate must not be a range
if not is_valid_accessdate(year .. '-' .. month .. '-' .. day) then
return false; -- return false when accessdate out of bounds
end
else
return false; -- return false when accessdate is a range of two dates
end
end
local result=true; -- check whole dates for validity; assume true because not all dates will go through this test
if 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 == day2 then -- YMD (simple whole date)
result = is_valid_date (year, month, day, param); -- <param> for |pmc-embargo-date=
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 ~= day2 then -- YMD-d (day range)
result = is_valid_date (year, month, day);
result = result and is_valid_date (year, month, day2);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 ~= month2 and 0 ~= day2 then -- YMD-md (day month range)
result = is_valid_date (year, month, day);
result = result and is_valid_date (year, month2, day2);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 ~= year2 and 0 ~= month2 and 0 ~= day2 then -- YMD-ymd (day month year range)
result = is_valid_date(year, month, day);
result = result and is_valid_date(year2, month2, day2);
end
if false == result then return false; end
if nil ~= tCOinS_date then -- this table only passed into this function when testing |date= parameter values
make_COinS_date ({year = year, month = month, day = day, year2 = year2, month2 = month2, day2 = day2}, tCOinS_date); -- make an ISO 8601 date string for COinS
end
return true, anchor_year; -- format is good and date string represents a real date
end
--[[--------------------------< D A T E S >--------------------------------------------------------------------
Cycle the date-holding parameters in passed table date_parameters_list through check_date() to check compliance with MOS:DATE. For all valid dates, check_date() returns
true. The |date= parameter test is unique, it is the only date holding parameter from which values for anchor_year (used in CITEREF identifiers) and COinS_date (used in
the COinS metadata) are derived. The |date= parameter is the only date-holding parameter that is allowed to contain the no-date keywords "n.d." or "nd" (without quotes).
Unlike most error messages created in this module, only one error message is created by this function. Because all of the date holding parameters are processed serially,
parameters with errors are added to the <error_list> sequence table as the dates are tested.
]]
local function dates(date_parameters_list, tCOinS_date, error_list)
local anchor_year; -- will return as nil if the date being tested is not |date=
local COinS_date; -- will return as nil if the date being tested is not |date=
local embargo_date; -- if embargo date is a good dmy, mdy, ymd date then holds original value else reset to 9999
local good_date = false;
for k, v in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set(v.val) then -- if the parameter has a value
v.val = mw.ustring.gsub(v.val, '%d', cfg.date_names.local_digits); -- translate 'local' digits to Western 0-9
if v.val:match("^c%. [1-9]%d%d%d?%a?$") then -- special case for c. year or with or without CITEREF disambiguator - only |date= and |year=
local year = v.val:match("c%. ([1-9]%d%d%d?)%a?"); -- get the year portion so it can be tested
if 'date' == k then
anchor_year, COinS_date = v.val:match("((c%. [1-9]%d%d%d?)%a?)"); -- anchor year and COinS_date only from |date= parameter
good_date = is_valid_year(year);
elseif 'year' == k then
good_date = is_valid_year(year);
end
elseif 'date' == k then -- if the parameter is |date=
if v.val:match("^n%.d%.%a?$") then -- ToDo: I18N -- if |date=n.d. with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((n%.d%.)%a?)"); -- ToDo: I18N -- "n.d."; no error when date parameter is set to no date
elseif v.val:match("^nd%a?$") then -- ToDo: I18N -- if |date=nd with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((nd)%a?)"); -- ToDo: I18N -- "nd"; no error when date parameter is set to no date
else
good_date, anchor_year, COinS_date = check_date (v.val, k, tCOinS_date); -- go test the date
end
elseif 'year' == k then -- if the parameter is |year= it should hold only a year value
if v.val:match("^[1-9]%d%d%d?%a?$") then -- if |year = 3 or 4 digits only with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((%d+)%a?)");
end
elseif 'pmc-embargo-date' == k then -- if the parameter is |pmc-embargo-date=
good_date = check_date (v.val, k); -- go test the date
if true == good_date then -- if the date is a valid date
good_date, embargo_date = is_valid_embargo_date (v.val); -- is |pmc-embargo-date= date a single dmy, mdy, or ymd formatted date? yes: returns embargo date; no: returns 9999
end
else -- any other date-holding parameter
good_date = check_date (v.val, k); -- go test the date
end
if false == good_date then -- assemble one error message so we don't add the tracking category multiple times
table.insert (error_list, wrap_style ('parameter', v.name)); -- make parameter name suitable for error message list
end
end
end
return anchor_year, embargo_date; -- and done
end
--[[--------------------------< Y E A R _ D A T E _ C H E C K >------------------------------------------------
Compare the value provided in |year= with the year value(s) provided in |date=. This function sets a local numeric value:
0 - year value does not match the year value in date
1 - (default) year value matches the year value in date or one of the year values when date contains two years
2 - year value matches the year value in date when date is in the form YYYY-MM-DD and year is disambiguated (|year=YYYYx)
the numeric value in <result> determines the 'output' if any from this function:
0 – adds error message to error_list sequence table
1 – adds maint cat
2 – does nothing
]]
local function year_date_check (year_string, year_origin, date_string, date_origin, error_list)
local year;
local date1;
local date2;
local result = 1; -- result of the test; assume that the test passes
year = year_string:match ('(%d%d%d%d?)');
if date_string:match ('%d%d%d%d%-%d%d%-%d%d') and year_string:match ('%d%d%d%d%a') then --special case where both date and year are required YYYY-MM-DD and YYYYx
date1 = date_string:match ('(%d%d%d%d)');
year = year_string:match ('(%d%d%d%d)');
if year ~= date1 then
result = 0; -- years don't match
else
result = 2; -- years match; but because disambiguated, don't add to maint cat
end
elseif date_string:match ("%d%d%d%d?.-%d%d%d%d?") then -- any of the standard range formats of date with two three- or four-digit years
date1, date2 = date_string:match ("(%d%d%d%d?).-(%d%d%d%d?)");
if year ~= date1 and year ~= date2 then
result = 0;
end
elseif mw.ustring.match(date_string, "%d%d%d%d[%-–]%d%d") then -- YYYY-YY date ranges
local century;
date1, century, date2 = mw.ustring.match(date_string, "((%d%d)%d%d)[%-–]+(%d%d)");
date2 = century..date2; -- convert YY to YYYY
if year ~= date1 and year ~= date2 then
result = 0;
end
elseif date_string:match ("%d%d%d%d?") then -- any of the standard formats of date with one year
date1 = date_string:match ("(%d%d%d%d?)");
if year ~= date1 then
result = 0;
end
else -- should never get here; this function called only when no other date errors
result = 0; -- no recognizable year in date
end
if 0 == result then -- year / date mismatch
table.insert (error_list, substitute (cfg.messages['mismatch'], {year_origin, date_origin})); -- add error message to error_list sequence table
elseif 1 == result then -- redundant year / date
set_message ('maint_date_year'); -- add a maint cat
end
end
--[[--------------------------< R E F O R M A T T E R >--------------------------------------------------------
reformat 'date' into new format specified by format_param if pattern_idx (the current format of 'date') can be
reformatted. Does the grunt work for reformat_dates().
The table re_formats maps pattern_idx (current format) and format_param (desired format) to a table that holds:
format string used by string.format()
identifier letters ('d', 'm', 'y', 'd2', 'm2', 'y2') that serve as indexes into a table t{} that holds captures
from mw.ustring.match() for the various date parts specified by patterns[pattern_idx][1]
Items in patterns{} have the general form:
['ymd'] = {'^(%d%d%d%d)%-(%d%d)%-(%d%d)$', 'y', 'm', 'd'}, where:
['ymd'] is pattern_idx
patterns['ymd'][1] is the match pattern with captures for mw.ustring.match()
patterns['ymd'][2] is an indicator letter identifying the content of the first capture
patterns['ymd'][3] ... the second capture etc.
when a pattern matches a date, the captures are loaded into table t{} in capture order using the idemtifier
characters as indexes into t{} For the above, a ymd date is in t{} as:
t.y = first capture (year), t.m = second capture (month), t.d = third capture (day)
To reformat, this function is called with the pattern_idx that matches the current format of the date and with
format_param set to the desired format. This function loads table t{} as described and then calls string.format()
with the format string specified by re_format[pattern_idx][format_param][1] using values taken from t{} according
to the capture identifier letters specified by patterns[pattern_idx][format_param][n] where n is 2..
]]
local re_formats = {
['ymd'] = { -- date format is ymd; reformat to:
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['Mdy'] = { -- date format is Mdy; reformat to:
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- for long/short reformatting
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['dMy'] = { -- date format is dMy; reformat to:
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['Md-dy'] = { -- date format is Md-dy; reformat to:
['mdy'] = {'%s %s–%s, %s', 'm', 'd', 'd2', 'y'}, -- for long/short reformatting
['dmy'] = {'%s–%s %s %s', 'd', 'd2', 'm', 'y'}, -- |df=dmy -> d-dMy
},
['d-dMy'] = { -- date format is d-d>y; reformat to:
['dmy'] = {'%s–%s %s %s', 'd', 'd2', 'm', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s–%s, %s', 'm', 'd', 'd2', 'y'}, -- |df=mdy -> Md-dy
},
['dM-dMy'] = { -- date format is dM-dMy; reformat to:
['dmy'] = {'%s %s – %s %s %s', 'd', 'm', 'd2', 'm2', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s – %s %s, %s', 'm', 'd', 'm2', 'd2', 'y'}, -- |df=mdy -> Md-Mdy
},
['Md-Mdy'] = { -- date format is Md-Mdy; reformat to:
['mdy'] = {'%s %s – %s %s, %s', 'm', 'd', 'm2', 'd2', 'y'}, -- for long/short reformatting
['dmy'] = {'%s %s – %s %s %s', 'd', 'm', 'd2', 'm2', 'y'}, -- |df=dmy -> dM-dMy
},
['dMy-dMy'] = { -- date format is dMy-dMy; reformat to:
['dmy'] = {'%s %s %s – %s %s %s', 'd', 'm', 'y', 'd2', 'm2', 'y2'}, -- for long/short reformatting
['mdy'] = {'%s %s, %s – %s %s, %s', 'm', 'd', 'y', 'm2', 'd2', 'y2'}, -- |df=mdy -> Mdy-Mdy
},
['Mdy-Mdy'] = { -- date format is Mdy-Mdy; reformat to:
['mdy'] = {'%s %s, %s – %s %s, %s', 'm', 'd', 'y', 'm2', 'd2', 'y2'}, -- for long/short reformatting
['dmy'] = {'%s %s %s – %s %s %s', 'd', 'm', 'y', 'd2', 'm2', 'y2'}, -- |df=dmy -> dMy-dMy
},
['My-My'] = { -- these for long/short reformatting
['any'] = {'%s %s – %s %s', 'm', 'y', 'm2', 'y2'}, -- dmy/mdy agnostic
},
['M-My'] = { -- these for long/short reformatting
['any'] = {'%s–%s %s', 'm', 'm2', 'y'}, -- dmy/mdy agnostic
},
['My'] = { -- these for long/short reformatting
['any'] = {'%s %s', 'm', 'y'}, -- dmy/mdy agnostic
},
-- ['yMd'] = { -- not supported at en.wiki
-- ['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
-- ['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
-- ['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- },
}
local function reformatter (date, pattern_idx, format_param, mon_len)
if not in_array (pattern_idx, {'ymd', 'Mdy', 'Md-dy', 'dMy', 'yMd', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy', 'My-My', 'M-My', 'My'}) then
return; -- not in this set of date format patterns then not a reformattable date
end
if 'ymd' == format_param and in_array (pattern_idx, {'ymd', 'Md-dy', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy', 'My-My', 'M-My', 'My'}) then
return; -- ymd date ranges not supported at en.wiki; no point in reformatting ymd to ymd
end
if in_array (pattern_idx, {'My', 'M-My', 'My-My'}) then -- these are not dmy/mdy so can't be 'reformatted' into either
format_param = 'any'; -- so format-agnostic
end
-- yMd is not supported at en.wiki; when yMd is supported at your wiki, uncomment the next line
-- if 'yMd' == format_param and in_array (pattern_idx, {'yMd', 'Md-dy', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy'}) then -- these formats not convertable; yMd not supported at en.wiki
if 'yMd' == format_param then -- yMd not supported at en.wiki; when yMd is supported at your wiki, remove or comment-out this line
return; -- not a reformattable date
end
local c1, c2, c3, c4, c5, c6, c7; -- these hold the captures specified in patterns[pattern_idx][1]
c1, c2, c3, c4, c5, c6, c7 = mw.ustring.match (date, patterns[pattern_idx][1]); -- get the captures
local t = { -- table that holds k/v pairs of date parts from the captures and patterns[pattern_idx][2..]
[patterns[pattern_idx][2]] = c1; -- at minimum there is always one capture with a matching indicator letter
[patterns[pattern_idx][3] or 'x'] = c2; -- patterns can have a variable number of captures; each capture requires an indicator letter;
[patterns[pattern_idx][4] or 'x'] = c3; -- where there is no capture, there is no indicator letter so n in patterns[pattern_idx][n] will be nil;
[patterns[pattern_idx][5] or 'x'] = c4; -- the 'x' here spoofs an indicator letter to prevent 'table index is nil' error
[patterns[pattern_idx][6] or 'x'] = c5;
[patterns[pattern_idx][7] or 'x'] = c6;
[patterns[pattern_idx][8] or 'x'] = c7;
};
if t.a then -- if this date has an anchor year capture (all convertable date formats except ymd)
if t.y2 then -- for year range date formats
t.y2 = t.a; -- use the anchor year capture when reassembling the date
else -- here for single date formats (except ymd)
t.y = t.a; -- use the anchor year capture when reassembling the date
end
end
if tonumber(t.m) then -- if raw month is a number (converting from ymd)
if 's' == mon_len then -- if we are to use abbreviated month names
t.m = cfg.date_names['inv_local_short'][tonumber(t.m)]; -- convert it to a month name
else
t.m = cfg.date_names['inv_local_long'][tonumber(t.m)]; -- convert it to a month name
end
t.d = t.d:gsub ('0(%d)', '%1'); -- strip leading '0' from day if present
elseif 'ymd' == format_param then -- when converting to ymd
t.y = t.y:gsub ('%a', ''); -- strip CITREF disambiguator if present; anchor year already known so process can proceed; TODO: maint message?
if 1582 > tonumber (t.y) then -- ymd format dates not allowed before 1582
return;
end
t.m = string.format ('%02d', get_month_number (t.m)); -- make sure that month and day are two digits
t.d = string.format ('%02d', t.d);
elseif mon_len then -- if mon_len is set to either 'short' or 'long'
for _, mon in ipairs ({'m', 'm2'}) do -- because there can be two month names, check both
if t[mon] then
t[mon] = get_month_number (t[mon]); -- get the month number for this month (is length agnostic)
if 0 == t[mon] then return; end -- seasons and named dates can't be converted
t[mon] = (('s' == mon_len) and cfg.date_names['inv_local_short'][t[mon]]) or cfg.date_names['inv_local_long'][t[mon]]; -- fetch month name according to length
end
end
end
local new_date = string.format (re_formats[pattern_idx][format_param][1], -- format string
t[re_formats[pattern_idx][format_param][2]], -- named captures from t{}
t[re_formats[pattern_idx][format_param][3]],
t[re_formats[pattern_idx][format_param][4]],
t[re_formats[pattern_idx][format_param][5]],
t[re_formats[pattern_idx][format_param][6]],
t[re_formats[pattern_idx][format_param][7]],
t[re_formats[pattern_idx][format_param][8]]
);
return new_date;
end
--[[-------------------------< R E F O R M A T _ D A T E S >--------------------------------------------------
Reformats existing dates into the format specified by format.
format is one of several manual keywords: dmy, dmy-all, mdy, mdy-all, ymd, ymd-all. The -all version includes
access- and archive-dates; otherwise these dates are not reformatted.
This function allows automatic date formatting. In ~/Configuration, the article source is searched for one of
the {{use xxx dates}} templates. If found, xxx becomes the global date format as xxx-all. If |cs1-dates= in
{{use xxx dates}} has legitimate value then that value determines how cs1|2 dates will be rendered. Legitimate
values for |cs1-dates= are:
l - all dates are rendered with long month names
ls - publication dates use long month names; access-/archive-dates use abbreviated month names
ly - publication dates use long month names; access-/archive-dates rendered in ymd format
s - all dates are rendered with abbreviated (short) month names
sy - publication dates use abbreviated month names; access-/archive-dates rendered in ymd format
y - all dates are rendered in ymd format
the format argument for automatic date formatting will be the format specified by {{use xxx dates}} with the
value supplied by |cs1-dates so one of: xxx-l, xxx-ls, xxx-ly, xxx-s, xxx-sy, xxx-y, or simply xxx (|cs1-dates=
empty, omitted, or invalid) where xxx shall be either of dmy or mdy.
dates are extracted from date_parameters_list, reformatted (if appropriate), and then written back into the
list in the new format. Dates in date_parameters_list are presumed here to be valid (no errors). This function
returns true when a date has been reformatted, false else. Actual reformatting is done by reformatter().
]]
local function reformat_dates (date_parameters_list, format)
local all = false; -- set to false to skip access- and archive-dates
local len_p = 'l'; -- default publication date length shall be long
local len_a = 'l'; -- default access-/archive-date length shall be long
local result = false;
local new_date;
if format:match('%a+%-all') then -- manual df keyword; auto df keyword when length not specified in {{use xxx dates}};
format = format:match('(%a+)%-all'); -- extract the format
all = true; -- all dates are long format dates because this keyword doesn't specify length
elseif format:match('%a+%-[lsy][sy]?') then -- auto df keywords; internal only
all = true; -- auto df applies to all dates; use length specified by capture len_p for all dates
format, len_p, len_a = format:match('(%a+)%-([lsy])([sy]?)'); -- extract the format and length keywords
if 'y' == len_p then -- because allowed by MOS:DATEUNIFY (sort of) range dates and My dates not reformatted
format = 'ymd'; -- override {{use xxx dates}}
elseif (not is_set(len_a)) or (len_p == len_a) then -- no access-/archive-date length specified or same length as publication dates then
len_a = len_p; -- in case len_a not set
end
end -- else only publication dates and they are long
for param_name, param_val in pairs (date_parameters_list) do -- for each date-holding parameter in the list
if is_set (param_val.val) then -- if the parameter has a value
if not (not all and in_array (param_name, {'access-date', 'archive-date'})) then -- skip access- or archive-date unless format is xxx-all; yeah, ugly; TODO: find a better way
for pattern_idx, pattern in pairs (patterns) do
if mw.ustring.match (param_val.val, pattern[1]) then
if all and in_array (param_name, {'access-date', 'archive-date'}) then -- if this date is an access- or archive-date
new_date = reformatter (param_val.val, pattern_idx, (('y' == len_a) and 'ymd') or format, len_a); -- choose ymd or dmy/mdy according to len_a setting
else -- all other dates
new_date = reformatter (param_val.val, pattern_idx, format, len_p);
end
if new_date then -- set when date was reformatted
date_parameters_list[param_name].val = new_date; -- update date in date list
result = true; -- and announce that changes have been made
end
end -- if
end -- for
end -- if
end -- if
end -- for
return result; -- declare boolean result and done
end
--[[--------------------------< D A T E _ H Y P H E N _ T O _ D A S H >----------------------------------------
Loops through the list of date-holding parameters and converts any hyphen to an ndash. Not called if the cs1|2
template has any date errors.
Modifies the date_parameters_list and returns true if hyphens are replaced, else returns false.
]]
local function date_hyphen_to_dash (date_parameters_list)
local result = false;
local n;
for param_name, param_val in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set (param_val.val) and
not mw.ustring.match (param_val.val, patterns.ymd[1]) then -- for those that are not ymd dates (ustring because here digits may not be Western)
param_val.val, n = param_val.val:gsub ('%-', '–'); -- replace any hyphen with ndash
if 0 ~= n then
date_parameters_list[param_name].val = param_val.val; -- update the list
result = true;
end
end
end
return result; -- so we know if any hyphens were replaced
end
--[[-------------------------< D A T E _ N A M E _ X L A T E >------------------------------------------------
Attempts to translate English date names to local-language date names using names supplied by MediaWiki's
date parser function. This is simple name-for-name replacement and may not work for all languages.
if xlat_dig is true, this function will also translate Western (English) digits to the local language's digits.
This will also translate ymd dates.
]]
local function date_name_xlate (date_parameters_list, xlt_dig)
local xlate;
local mode; -- long or short month names
local modified = false;
local date;
local sources_t = {
{cfg.date_names.en.long, cfg.date_names.inv_local_long}, -- for translating long English month names to long local month names
{cfg.date_names.en.short, cfg.date_names.inv_local_short}, -- short month names
{cfg.date_names.en.quarter, cfg.date_names.inv_local_quarter}, -- quarter date names
{cfg.date_names.en.season, cfg.date_names.inv_local_season}, -- season date nam
{cfg.date_names.en.named, cfg.date_names.inv_local_named}, -- named dates
}
local function is_xlateable (month) -- local function to get local date name that replaces existing English-language date name
for _, date_names_t in ipairs (sources_t) do -- for each sequence table in date_names_t
if date_names_t[1][month] then -- if date name is English month (long or short), quarter, season or named and
if date_names_t[2][date_names_t[1][month]] then -- if there is a matching local date name
return date_names_t[2][date_names_t[1][month]]; -- return the local date name
end
end
end
end
for param_name, param_val in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set(param_val.val) then -- if the parameter has a value
date = param_val.val;
for month in mw.ustring.gmatch (date, '[%a ]+') do -- iterate through all date names in the date (single date or date range)
month = mw.text.trim (month); -- this because quarterly dates contain whitespace
xlate = is_xlateable (month); -- get translate <month>; returns translation or nil
if xlate then
date = mw.ustring.gsub (date, month, xlate); -- replace the English with the translation
date_parameters_list[param_name].val = date; -- save the translated date
modified = true;
end
end
if xlt_dig then -- shall we also translate digits?
date = date:gsub ('%d', cfg.date_names.xlate_digits); -- translate digits from Western to 'local digits'
date_parameters_list[param_name].val = date; -- save the translated date
modified = true;
end
end
end
return modified;
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
add_prop_cat = utilities_page_ptr.add_prop_cat ; -- import functions from selected Module:Citation/CS1/Utilities module
is_set = utilities_page_ptr.is_set;
in_array = utilities_page_ptr.in_array;
set_message = utilities_page_ptr.set_message;
substitute = utilities_page_ptr.substitute;
wrap_style = utilities_page_ptr.wrap_style;
cfg = cfg_table_ptr; -- import tables from selected Module:Citation/CS1/Configuration
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return { -- return exported functions
dates = dates,
year_date_check = year_date_check,
reformat_dates = reformat_dates,
date_hyphen_to_dash = date_hyphen_to_dash,
date_name_xlate = date_name_xlate,
set_selected_modules = set_selected_modules
}
46ec997eed12f96ed5a030aee3a4264622c84955
Module:Citation/CS1/Identifiers
828
116
241
240
2023-08-10T15:23:12Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Citation/CS1/Identifiers]]
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local has_accept_as_written, is_set, in_array, set_message, select_one, -- functions in Module:Citation/CS1/Utilities
substitute, make_wikilink;
local z; -- table of tables defined in Module:Citation/CS1/Utilities
local cfg; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
--[[--------------------------< P A G E S C O P E V A R I A B L E S >--------------------------------------
declare variables here that have page-wide scope that are not brought in from other modules; that are created here and used here
]]
local auto_link_urls = {}; -- holds identifier URLs for those identifiers that can auto-link |title=
--============================<< H E L P E R F U N C T I O N S >>============================================
--[[--------------------------< W I K I D A T A _ A R T I C L E _ N A M E _ G E T >----------------------------
as an aid to internationalizing identifier-label wikilinks, gets identifier article names from Wikidata.
returns :<lang code>:<article title> when <q> has an <article title> for <lang code>; nil else
for identifiers that do not have q, returns nil
for wikis that do not have mw.wikibase installed, returns nil
]]
local function wikidata_article_name_get (q)
if not is_set (q) or (q and not mw.wikibase) then -- when no q number or when a q number but mw.wikibase not installed on this wiki
return nil; -- abandon
end
local wd_article;
local this_wiki_code = cfg.this_wiki_code; -- Wikipedia subdomain; 'en' for en.wikipedia.org
wd_article = mw.wikibase.getSitelink (q, this_wiki_code .. 'wiki'); -- fetch article title from WD; nil when no title available at this wiki
if wd_article then
wd_article = table.concat ({':', this_wiki_code, ':', wd_article}); -- interwiki-style link without brackets if taken from WD; leading colon required
end
return wd_article; -- article title from WD; nil else
end
--[[--------------------------< L I N K _ L A B E L _ M A K E >------------------------------------------------
common function to create identifier link label from handler table or from Wikidata
returns the first available of
1. redirect from local wiki's handler table (if enabled)
2. Wikidata (if there is a Wikidata entry for this identifier in the local wiki's language)
3. label specified in the local wiki's handler table
]]
local function link_label_make (handler)
local wd_article;
if not (cfg.use_identifier_redirects and is_set (handler.redirect)) then -- redirect has priority so if enabled and available don't fetch from Wikidata because expensive
wd_article = wikidata_article_name_get (handler.q); -- if Wikidata has an article title for this wiki, get it;
end
return (cfg.use_identifier_redirects and is_set (handler.redirect) and handler.redirect) or wd_article or handler.link;
end
--[[--------------------------< E X T E R N A L _ L I N K _ I D >----------------------------------------------
Formats a wiki-style external link
]]
local function external_link_id (options)
local url_string = options.id;
local ext_link;
local this_wiki_code = cfg.this_wiki_code; -- Wikipedia subdomain; 'en' for en.wikipedia.org
local wd_article; -- article title from Wikidata
if options.encode == true or options.encode == nil then
url_string = mw.uri.encode (url_string, 'PATH');
end
if options.auto_link and is_set (options.access) then
auto_link_urls[options.auto_link] = table.concat ({options.prefix, url_string, options.suffix});
end
ext_link = mw.ustring.format ('[%s%s%s %s]', options.prefix, url_string, options.suffix or "", mw.text.nowiki (options.id));
if is_set (options.access) then
ext_link = substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[options.access].class, cfg.presentation[options.access].title, ext_link}); -- add the free-to-read / paywall lock
end
return table.concat ({
make_wikilink (link_label_make (options), options.label), -- redirect, Wikidata link, or locally specified link (in that order)
options.separator or ' ',
ext_link
});
end
--[[--------------------------< I N T E R N A L _ L I N K _ I D >----------------------------------------------
Formats a wiki-style internal link
TODO: Does not currently need to support options.access, options.encode, auto-linking and COinS (as in external_link_id),
but may be needed in the future for :m:Interwiki_map custom-prefixes like :arxiv:, :bibcode:, :DOI:, :hdl:, :ISSN:,
:JSTOR:, :Openlibrary:, :PMID:, :RFC:.
]]
local function internal_link_id (options)
local id = mw.ustring.gsub (options.id, '%d', cfg.date_names.local_digits); -- translate 'local' digits to Western 0-9
return table.concat (
{
make_wikilink (link_label_make (options), options.label), -- wiki-link the identifier label
options.separator or ' ', -- add the separator
make_wikilink (
table.concat (
{
options.prefix,
id, -- translated to Western digits
options.suffix or ''
}),
substitute (cfg.presentation['bdi'], {'', mw.text.nowiki (options.id)}) -- bdi tags to prevent Latin script identifiers from being reversed at RTL language wikis
); -- nowiki because MediaWiki still has magic links for ISBN and the like; TODO: is it really required?
});
end
--[[--------------------------< I S _ E M B A R G O E D >------------------------------------------------------
Determines if a PMC identifier's online version is embargoed. Compares the date in |pmc-embargo-date= against
today's date. If embargo date is in the future, returns the content of |pmc-embargo-date=; otherwise, returns
an empty string because the embargo has expired or because |pmc-embargo-date= was not set in this cite.
]]
local function is_embargoed (embargo)
if is_set (embargo) then
local lang = mw.getContentLanguage();
local good1, embargo_date, todays_date;
good1, embargo_date = pcall (lang.formatDate, lang, 'U', embargo);
todays_date = lang:formatDate ('U');
if good1 then -- if embargo date is a good date
if tonumber (embargo_date) >= tonumber (todays_date) then -- is embargo date is in the future?
return embargo; -- still embargoed
else
set_message ('maint_pmc_embargo'); -- embargo has expired; add main cat
return ''; -- unset because embargo has expired
end
end
end
return ''; -- |pmc-embargo-date= not set return empty string
end
--[=[-------------------------< I S _ V A L I D _ B I O R X I V _ D A T E >------------------------------------
returns true if:
2019-12-11T00:00Z <= biorxiv_date < today + 2 days
The dated form of biorxiv identifier has a start date of 2019-12-11. The Unix timestamp for that date is {{#time:U|2019-12-11}} = 1576022400
biorxiv_date is the date provided in those |biorxiv= parameter values that are dated at time 00:00:00 UTC
today is the current date at time 00:00:00 UTC plus 48 hours
if today is 2015-01-01T00:00:00 then
adding 24 hours gives 2015-01-02T00:00:00 – one second more than today
adding 24 hours gives 2015-01-03T00:00:00 – one second more than tomorrow
This function does not work if it is fed month names for languages other than English. Wikimedia #time: parser
apparently doesn't understand non-English date month names. This function will always return false when the date
contains a non-English month name because good1 is false after the call to lang_object.formatDate(). To get
around that call this function with date parts and create a YYYY-MM-DD format date.
]=]
local function is_valid_biorxiv_date (y, m, d)
local biorxiv_date = table.concat ({y, m, d}, '-'); -- make ymd date
local good1, good2;
local biorxiv_ts, tomorrow_ts; -- to hold Unix timestamps representing the dates
local lang_object = mw.getContentLanguage();
good1, biorxiv_ts = pcall (lang_object.formatDate, lang_object, 'U', biorxiv_date); -- convert biorxiv_date value to Unix timestamp
good2, tomorrow_ts = pcall (lang_object.formatDate, lang_object, 'U', 'today + 2 days' ); -- today midnight + 2 days is one second more than all day tomorrow
if good1 and good2 then -- lang.formatDate() returns a timestamp in the local script which tonumber() may not understand
biorxiv_ts = tonumber (biorxiv_ts) or lang_object:parseFormattedNumber (biorxiv_ts); -- convert to numbers for the comparison;
tomorrow_ts = tonumber (tomorrow_ts) or lang_object:parseFormattedNumber (tomorrow_ts);
else
return false; -- one or both failed to convert to Unix timestamp
end
return ((1576022400 <= biorxiv_ts) and (biorxiv_ts < tomorrow_ts)) -- 2012-12-11T00:00Z <= biorxiv_date < tomorrow's date
end
--[[--------------------------< IS _ V A L I D _ I S X N >-----------------------------------------------------
ISBN-10 and ISSN validator code calculates checksum across all ISBN/ISSN digits including the check digit.
ISBN-13 is checked in isbn().
If the number is valid the result will be 0. Before calling this function, ISBN/ISSN must be checked for length
and stripped of dashes, spaces and other non-ISxN characters.
]]
local function is_valid_isxn (isxn_str, len)
local temp = 0;
isxn_str = { isxn_str:byte(1, len) }; -- make a table of byte values '0' → 0x30 .. '9' → 0x39, 'X' → 0x58
len = len + 1; -- adjust to be a loop counter
for i, v in ipairs (isxn_str) do -- loop through all of the bytes and calculate the checksum
if v == string.byte ("X" ) then -- if checkdigit is X (compares the byte value of 'X' which is 0x58)
temp = temp + 10 * (len - i); -- it represents 10 decimal
else
temp = temp + tonumber (string.char (v) )*(len-i);
end
end
return temp % 11 == 0; -- returns true if calculation result is zero
end
--[[--------------------------< IS _ V A L I D _ I S X N _ 1 3 >-----------------------------------------------
ISBN-13 and ISMN validator code calculates checksum across all 13 ISBN/ISMN digits including the check digit.
If the number is valid, the result will be 0. Before calling this function, ISBN-13/ISMN must be checked for length
and stripped of dashes, spaces and other non-ISxN-13 characters.
]]
local function is_valid_isxn_13 (isxn_str)
local temp=0;
isxn_str = { isxn_str:byte(1, 13) }; -- make a table of byte values '0' → 0x30 .. '9' → 0x39
for i, v in ipairs (isxn_str) do
temp = temp + (3 - 2*(i % 2)) * tonumber (string.char (v) ); -- multiply odd index digits by 1, even index digits by 3 and sum; includes check digit
end
return temp % 10 == 0; -- sum modulo 10 is zero when ISBN-13/ISMN is correct
end
--[[--------------------------< N O R M A L I Z E _ L C C N >--------------------------------------------------
LCCN normalization (https://www.loc.gov/marc/lccn-namespace.html#normalization)
1. Remove all blanks.
2. If there is a forward slash (/) in the string, remove it, and remove all characters to the right of the forward slash.
3. If there is a hyphen in the string:
a. Remove it.
b. Inspect the substring following (to the right of) the (removed) hyphen. Then (and assuming that steps 1 and 2 have been carried out):
1. All these characters should be digits, and there should be six or less. (not done in this function)
2. If the length of the substring is less than 6, left-fill the substring with zeroes until the length is six.
Returns a normalized LCCN for lccn() to validate. There is no error checking (step 3.b.1) performed in this function.
]]
local function normalize_lccn (lccn)
lccn = lccn:gsub ("%s", ""); -- 1. strip whitespace
if nil ~= string.find (lccn, '/') then
lccn = lccn:match ("(.-)/"); -- 2. remove forward slash and all character to the right of it
end
local prefix
local suffix
prefix, suffix = lccn:match ("(.+)%-(.+)"); -- 3.a remove hyphen by splitting the string into prefix and suffix
if nil ~= suffix then -- if there was a hyphen
suffix = string.rep("0", 6-string.len (suffix)) .. suffix; -- 3.b.2 left fill the suffix with 0s if suffix length less than 6
lccn = prefix..suffix; -- reassemble the LCCN
end
return lccn;
end
--============================<< I D E N T I F I E R F U N C T I O N S >>====================================
--[[--------------------------< A R X I V >--------------------------------------------------------------------
See: https://arxiv.org/help/arxiv_identifier
format and error check arXiv identifier. There are three valid forms of the identifier:
the first form, valid only between date codes 9107 and 0703, is:
arXiv:<archive>.<class>/<date code><number><version>
where:
<archive> is a string of alpha characters - may be hyphenated; no other punctuation
<class> is a string of alpha characters - may be hyphenated; no other punctuation; not the same as |class= parameter which is not supported in this form
<date code> is four digits in the form YYMM where YY is the last two digits of the four-digit year and MM is the month number January = 01
first digit of YY for this form can only 9 and 0
<number> is a three-digit number
<version> is a 1 or more digit number preceded with a lowercase v; no spaces (undocumented)
the second form, valid from April 2007 through December 2014 is:
arXiv:<date code>.<number><version>
where:
<date code> is four digits in the form YYMM where YY is the last two digits of the four-digit year and MM is the month number January = 01
<number> is a four-digit number
<version> is a 1 or more digit number preceded with a lowercase v; no spaces
the third form, valid from January 2015 is:
arXiv:<date code>.<number><version>
where:
<date code> and <version> are as defined for 0704-1412
<number> is a five-digit number
]]
local function arxiv (options)
local id = options.id;
local class = options.Class; -- TODO: lowercase?
local handler = options.handler;
local year, month, version;
local err_msg = false; -- assume no error message
local text; -- output text
if id:match("^%a[%a%.%-]+/[90]%d[01]%d%d%d%d$") or id:match("^%a[%a%.%-]+/[90]%d[01]%d%d%d%dv%d+$") then -- test for the 9107-0703 format with or without version
year, month = id:match("^%a[%a%.%-]+/([90]%d)([01]%d)%d%d%d[v%d]*$");
year = tonumber (year);
month = tonumber (month);
if ((not (90 < year or 8 > year)) or (1 > month or 12 < month)) or -- if invalid year or invalid month
((91 == year and 7 > month) or (7 == year and 3 < month)) then -- if years ok, are starting and ending months ok?
err_msg = true; -- flag for error message
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%dv%d+$") then -- test for the 0704-1412 with or without version
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d[v%d]*$");
year = tonumber (year);
month = tonumber (month);
if ((7 > year) or (14 < year) or (1 > month or 12 < month)) or -- is year invalid or is month invalid? (doesn't test for future years)
((7 == year) and (4 > month)) then -- when year is 07, is month invalid (before April)?
err_msg = true; -- flag for error message
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%d%dv%d+$") then -- test for the 1501- format with or without version
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d%d[v%d]*$");
year = tonumber (year);
month = tonumber (month);
if ((15 > year) or (1 > month or 12 < month)) then -- is year invalid or is month invalid? (doesn't test for future years)
err_msg = true; -- flag for error message
end
else
err_msg = true; -- not a recognized format; flag for error message
end
if err_msg then
options.coins_list_t['ARXIV'] = nil; -- when error, unset so not included in COinS
end
local err_msg_t = {};
if err_msg then
set_message ('err_bad_arxiv');
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = handler.access});
if is_set (class) then
if id:match ('^%d+') then
text = table.concat ({text, ' [[//arxiv.org/archive/', class, ' ', class, ']]'}); -- external link within square brackets, not wikilink
else
set_message ('err_class_ignored');
end
end
return text;
end
--[[--------------------------< B I B C O D E >--------------------------------------------------------------------
Validates (sort of) and formats a bibcode ID.
Format for bibcodes is specified here: https://adsabs.harvard.edu/abs_doc/help_pages/data.html#bibcodes
But, this: 2015arXiv151206696F is apparently valid so apparently, the only things that really matter are length, 19 characters
and first four digits must be a year. This function makes these tests:
length must be 19 characters
characters in position
1–4 must be digits and must represent a year in the range of 1000 – next year
5 must be a letter
6–8 must be letter, digit, ampersand, or dot (ampersand cannot directly precede a dot; &. )
9–18 must be letter, digit, or dot
19 must be a letter or dot
]]
local function bibcode (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local err_type;
local err_msg = '';
local year;
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode,
access = access});
if 19 ~= id:len() then
err_type = cfg.err_msg_supl.length;
else
year = id:match ("^(%d%d%d%d)[%a][%w&%.][%w&%.][%w&%.][%w.]+[%a%.]$");
if not year then -- if nil then no pattern match
err_type = cfg.err_msg_supl.value; -- so value error
else
local next_year = tonumber (os.date ('%Y')) + 1; -- get the current year as a number and add one for next year
year = tonumber (year); -- convert year portion of bibcode to a number
if (1000 > year) or (year > next_year) then
err_type = cfg.err_msg_supl.year; -- year out of bounds
end
if id:find('&%.') then
err_type = cfg.err_msg_supl.journal; -- journal abbreviation must not have '&.' (if it does it's missing a letter)
end
end
end
if is_set (err_type) then -- if there was an error detected
set_message ('err_bad_bibcode', {err_type});
options.coins_list_t['BIBCODE'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< B I O R X I V >-----------------------------------------------------------------
Format bioRxiv ID and do simple error checking. Before 2019-12-11, biorXiv IDs were 10.1101/ followed by exactly
6 digits. After 2019-12-11, biorXiv IDs retained the six-digit identifier but prefixed that with a yyyy.mm.dd.
date and suffixed with an optional version identifier.
The bioRxiv ID is the string of characters:
https://doi.org/10.1101/078733 -> 10.1101/078733
or a date followed by a six-digit number followed by an optional version indicator 'v' and one or more digits:
https://www.biorxiv.org/content/10.1101/2019.12.11.123456v2 -> 10.1101/2019.12.11.123456v2
see https://www.biorxiv.org/about-biorxiv
]]
local function biorxiv (options)
local id = options.id;
local handler = options.handler;
local err_msg = true; -- flag; assume that there will be an error
local patterns = {
'^10.1101/%d%d%d%d%d%d$', -- simple 6-digit identifier (before 2019-12-11)
'^10.1101/(20[1-9]%d)%.([01]%d)%.([0-3]%d)%.%d%d%d%d%d%dv%d+$', -- y.m.d. date + 6-digit identifier + version (after 2019-12-11)
'^10.1101/(20[1-9]%d)%.([01]%d)%.([0-3]%d)%.%d%d%d%d%d%d$', -- y.m.d. date + 6-digit identifier (after 2019-12-11)
}
for _, pattern in ipairs (patterns) do -- spin through the patterns looking for a match
if id:match (pattern) then
local y, m, d = id:match (pattern); -- found a match, attempt to get year, month and date from the identifier
if m then -- m is nil when id is the six-digit form
if not is_valid_biorxiv_date (y, m, d) then -- validate the encoded date; TODO: don't ignore leap-year and actual month lengths ({{#time:}} is a poor date validator)
break; -- date fail; break out early so we don't unset the error message
end
end
err_msg = nil; -- we found a match so unset the error message
break; -- and done
end
end -- err_cat remains set here when no match
if err_msg then
options.coins_list_t['BIORXIV'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_biorxiv'); -- and set the error message
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator,
encode = handler.encode, access = handler.access});
end
--[[--------------------------< C I T E S E E R X >------------------------------------------------------------
CiteSeerX use their own notion of "doi" (not to be confused with the identifiers resolved via doi.org).
The description of the structure of this identifier can be found at Help_talk:Citation_Style_1/Archive_26#CiteSeerX_id_structure
]]
local function citeseerx (options)
local id = options.id;
local handler = options.handler;
local matched;
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode,
access = handler.access});
matched = id:match ("^10%.1%.1%.[1-9]%d?%d?%d?%.[1-9]%d?%d?%d?$");
if not matched then
set_message ('err_bad_citeseerx' );
options.coins_list_t['CITESEERX'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< D O I >------------------------------------------------------------------------
Formats a DOI and checks for DOI errors.
DOI names contain two parts: prefix and suffix separated by a forward slash.
Prefix: directory indicator '10.' followed by a registrant code
Suffix: character string of any length chosen by the registrant
This function checks a DOI name for: prefix/suffix. If the DOI name contains spaces or endashes, or, if it ends
with a period or a comma, this function will emit a bad_doi error message.
DOI names are case-insensitive and can incorporate any printable Unicode characters so the test for spaces, endash,
and terminal punctuation may not be technically correct but it appears, that in practice these characters are rarely
if ever used in DOI names.
https://www.doi.org/doi_handbook/2_Numbering.html -- 2.2 Syntax of a DOI name
https://www.doi.org/doi_handbook/2_Numbering.html#2.2.2 -- 2.2.2 DOI prefix
]]
local function doi (options)
local id = options.id;
local inactive = options.DoiBroken
local access = options.access;
local ignore_invalid = options.accept;
local handler = options.handler;
local err_flag;
local text;
if is_set (inactive) then
local inactive_year = inactive:match("%d%d%d%d") or ''; -- try to get the year portion from the inactive date
local inactive_month, good;
if is_set (inactive_year) then
if 4 < inactive:len() then -- inactive date has more than just a year (could be anything)
local lang_obj = mw.getContentLanguage(); -- get a language object for this wiki
good, inactive_month = pcall (lang_obj.formatDate, lang_obj, 'F', inactive); -- try to get the month name from the inactive date
if not good then
inactive_month = nil; -- something went wrong so make sure this is unset
end
end
else
inactive_year = nil; -- |doi-broken-date= has something but it isn't a date
end
if is_set (inactive_year) and is_set (inactive_month) then
set_message ('maint_doi_inactive_dated', {inactive_year, inactive_month, ' '});
elseif is_set (inactive_year) then
set_message ('maint_doi_inactive_dated', {inactive_year, '', ''});
else
set_message ('maint_doi_inactive');
end
inactive = " (" .. cfg.messages['inactive'] .. ' ' .. inactive .. ')';
end
local registrant = mw.ustring.match (id, '^10%.([^/]+)/[^%s–]-[^%.,]$'); -- registrant set when DOI has the proper basic form
local registrant_err_patterns = { -- these patterns are for code ranges that are not supported
'^[^1-3]%d%d%d%d%.%d%d*$', -- 5 digits with subcode (0xxxx, 40000+); accepts: 10000–39999
'^[^1-5]%d%d%d%d$', -- 5 digits without subcode (0xxxx, 60000+); accepts: 10000–59999
'^[^1-9]%d%d%d%.%d%d*$', -- 4 digits with subcode (0xxx); accepts: 1000–9999
'^[^1-9]%d%d%d$', -- 4 digits without subcode (0xxx); accepts: 1000–9999
'^%d%d%d%d%d%d+', -- 6 or more digits
'^%d%d?%d?$', -- less than 4 digits without subcode (3 digits with subcode is legitimate)
'^%d%d?%.[%d%.]+', -- 1 or 2 digits with subcode
'^5555$', -- test registrant will never resolve
'[^%d%.]', -- any character that isn't a digit or a dot
}
if not ignore_invalid then
if registrant then -- when DOI has proper form
for i, pattern in ipairs (registrant_err_patterns) do -- spin through error patterns
if registrant:match (pattern) then -- to validate registrant codes
err_flag = set_message ('err_bad_doi'); -- when found, mark this DOI as bad
break; -- and done
end
end
else
err_flag = set_message ('err_bad_doi'); -- invalid directory or malformed
end
else
set_message ('maint_doi_ignore');
end
if err_flag then
options.coins_list_t['DOI'] = nil; -- when error, unset so not included in COinS
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access,
auto_link = not (err_flag or is_set (inactive) or ignore_invalid) and 'doi' or nil -- do not auto-link when |doi-broken-date= has a value or when there is a DOI error or (to play it safe, after all, auto-linking is not essential) when invalid DOIs are ignored
}) .. (inactive or '');
return text;
end
--[[--------------------------< H D L >------------------------------------------------------------------------
Formats an HDL with minor error checking.
HDL names contain two parts: prefix and suffix separated by a forward slash.
Prefix: character string using any character in the UCS-2 character set except '/'
Suffix: character string of any length using any character in the UCS-2 character set chosen by the registrant
This function checks a HDL name for: prefix/suffix. If the HDL name contains spaces, endashes, or, if it ends
with a period or a comma, this function will emit a bad_hdl error message.
HDL names are case-insensitive and can incorporate any printable Unicode characters so the test for endashes and
terminal punctuation may not be technically correct but it appears, that in practice these characters are rarely
if ever used in HDLs.
Query string parameters are named here: https://www.handle.net/proxy_servlet.html. query strings are not displayed
but since '?' is an allowed character in an HDL, '?' followed by one of the query parameters is the only way we
have to detect the query string so that it isn't URL-encoded with the rest of the identifier.
]]
local function hdl (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local query_params = { -- list of known query parameters from https://www.handle.net/proxy_servlet.html
'noredirect',
'ignore_aliases',
'auth',
'cert',
'index',
'type',
'urlappend',
'locatt',
'action',
}
local hdl, suffix, param = id:match ('(.-)(%?(%a+).+)$'); -- look for query string
local found;
if hdl then -- when there are query strings, this is the handle identifier portion
for _, q in ipairs (query_params) do -- spin through the list of query parameters
if param:match ('^' .. q) then -- if the query string begins with one of the parameters
found = true; -- announce a find
break; -- and stop looking
end
end
end
if found then
id = hdl; -- found so replace id with the handle portion; this will be URL-encoded, suffix will not
else
suffix = ''; -- make sure suffix is empty string for concatenation else
end
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, suffix = suffix, separator = handler.separator, encode = handler.encode, access = access})
if nil == id:match("^[^%s–]-/[^%s–]-[^%.,]$") then -- HDL must contain a forward slash, must not contain spaces, endashes, and must not end with period or comma
set_message ('err_bad_hdl' );
options.coins_list_t['HDL'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< I S B N >----------------------------------------------------------------------
Determines whether an ISBN string is valid
]]
local function isbn (options)
local isbn_str = options.id;
local ignore_invalid = options.accept;
local handler = options.handler;
local function return_result (check, err_type) -- local function to handle the various returns
local ISBN = internal_link_id ({link = handler.link, label = handler.label, redirect = handler.redirect,
prefix = handler.prefix, id = isbn_str, separator = handler.separator});
if ignore_invalid then -- if ignoring ISBN errors
set_message ('maint_isbn_ignore'); -- add a maint category even when there is no error
else -- here when not ignoring
if not check then -- and there is an error
options.coins_list_t['ISBN'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_isbn', err_type); -- set an error message
return ISBN; -- return id text
end
end
return ISBN; -- return id text
end
if nil ~= isbn_str:match ('[^%s-0-9X]') then
return return_result (false, cfg.err_msg_supl.char); -- fail if isbn_str contains anything but digits, hyphens, or the uppercase X
end
local id = isbn_str:gsub ('[%s-]', ''); -- remove hyphens and whitespace
local len = id:len();
if len ~= 10 and len ~= 13 then
return return_result (false, cfg.err_msg_supl.length); -- fail if incorrect length
end
if len == 10 then
if id:match ('^%d*X?$') == nil then -- fail if isbn_str has 'X' anywhere but last position
return return_result (false, cfg.err_msg_supl.form);
end
if not is_valid_isxn (id, 10) then -- test isbn-10 for numerical validity
return return_result (false, cfg.err_msg_supl.check); -- fail if isbn-10 is not numerically valid
end
if id:find ('^63[01]') then -- 630xxxxxxx and 631xxxxxxx are (apparently) not valid isbn group ids but are used by amazon as numeric identifiers (asin)
return return_result (false, cfg.err_msg_supl.group); -- fail if isbn-10 begins with 630/1
end
return return_result (true, cfg.err_msg_supl.check); -- pass if isbn-10 is numerically valid
else
if id:match ('^%d+$') == nil then
return return_result (false, cfg.err_msg_supl.char); -- fail if ISBN-13 is not all digits
end
if id:match ('^97[89]%d*$') == nil then
return return_result (false, cfg.err_msg_supl.prefix); -- fail when ISBN-13 does not begin with 978 or 979
end
if id:match ('^9790') then
return return_result (false, cfg.err_msg_supl.group); -- group identifier '0' is reserved to ISMN
end
return return_result (is_valid_isxn_13 (id), cfg.err_msg_supl.check);
end
end
--[[--------------------------< A S I N >----------------------------------------------------------------------
Formats a link to Amazon. Do simple error checking: ASIN must be mix of 10 numeric or uppercase alpha
characters. If a mix, first character must be uppercase alpha; if all numeric, ASINs must be 10-digit
ISBN. If 10-digit ISBN, add a maintenance category so a bot or AWB script can replace |asin= with |isbn=.
Error message if not 10 characters, if not ISBN-10, if mixed and first character is a digit.
|asin=630....... and |asin=631....... are (apparently) not a legitimate ISBN though it checksums as one; these
do not cause this function to emit the maint_asin message
This function is positioned here because it calls isbn()
]]
local function asin (options)
local id = options.id;
local domain = options.ASINTLD;
local err_flag;
if not id:match("^[%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u]$") then
err_flag = set_message ('err_bad_asin'); -- ASIN is not a mix of 10 uppercase alpha and numeric characters
else
if id:match("^%d%d%d%d%d%d%d%d%d[%dX]$") then -- if 10-digit numeric (or 9 digits with terminal X)
if is_valid_isxn (id, 10) then -- see if ASIN value is or validates as ISBN-10
if not id:find ('^63[01]') then -- 630xxxxxxx and 631xxxxxxx are (apparently) not a valid isbn prefixes but are used by amazon as a numeric identifier
err_flag = set_message ('err_bad_asin'); -- ASIN has ISBN-10 form but begins with something other than 630/1 so probably an isbn
end
elseif not is_set (err_flag) then
err_flag = set_message ('err_bad_asin'); -- ASIN is not ISBN-10
end
elseif not id:match("^%u[%d%u]+$") then
err_flag = set_message ('err_bad_asin'); -- asin doesn't begin with uppercase alpha
end
end
if (not is_set (domain)) or in_array (domain, {'us'}) then -- default: United States
domain = "com";
elseif in_array (domain, {'jp', 'uk'}) then -- Japan, United Kingdom
domain = "co." .. domain;
elseif in_array (domain, {'z.cn'}) then -- China
domain = "cn";
elseif in_array (domain, {'au', 'br', 'mx', 'sg', 'tr'}) then -- Australia, Brazil, Mexico, Singapore, Turkey
domain = "com." .. domain;
elseif not in_array (domain, {'ae', 'ca', 'cn', 'de', 'es', 'fr', 'in', 'it', 'nl', 'pl', 'sa', 'se', 'co.jp', 'co.uk', 'com', 'com.au', 'com.br', 'com.mx', 'com.sg', 'com.tr'}) then -- Arabic Emirates, Canada, China, Germany, Spain, France, Indonesia, Italy, Netherlands, Poland, Saudi Arabia, Sweden (as of 2021-03 Austria (.at), Liechtenstein (.li) and Switzerland (.ch) still redirect to the German site (.de) with special settings, so don't maintain local ASINs for them)
err_flag = set_message ('err_bad_asin_tld'); -- unsupported asin-tld value
end
local handler = options.handler;
if not is_set (err_flag) then
options.coins_list_t['ASIN'] = handler.prefix .. domain .. "/dp/" .. id; -- asin for coins
else
options.coins_list_t['ASIN'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix .. domain .. "/dp/",
id = id, encode = handler.encode, separator = handler.separator})
end
--[[--------------------------< I S M N >----------------------------------------------------------------------
Determines whether an ISMN string is valid. Similar to ISBN-13, ISMN is 13 digits beginning 979-0-... and uses the
same check digit calculations. See https://www.ismn-international.org/download/Web_ISMN_Users_Manual_2008-6.pdf
section 2, pages 9–12.
ismn value not made part of COinS metadata because we don't have a url or isn't a COinS-defined identifier (rft.xxx)
or an identifier registered at info-uri.info (info:)
]]
local function ismn (options)
local id = options.id;
local handler = options.handler;
local text;
local valid_ismn = true;
local id_copy;
id_copy = id; -- save a copy because this testing is destructive
id = id:gsub ('[%s-]', ''); -- remove hyphens and white space
if 13 ~= id:len() or id:match ("^9790%d*$" ) == nil then -- ISMN must be 13 digits and begin with 9790
valid_ismn = false;
else
valid_ismn=is_valid_isxn_13 (id); -- validate ISMN
end
-- text = internal_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect, -- use this (or external version) when there is some place to link to
-- prefix = handler.prefix, id = id_copy, separator = handler.separator, encode = handler.encode})
text = table.concat ( -- because no place to link to yet
{
make_wikilink (link_label_make (handler), handler.label),
handler.separator,
id_copy
});
if false == valid_ismn then
options.coins_list_t['ISMN'] = nil; -- when error, unset so not included in COinS; not really necessary here because ismn not made part of COinS
set_message ('err_bad_ismn'); -- create an error message if the ISMN is invalid
end
return text;
end
--[[--------------------------< I S S N >----------------------------------------------------------------------
Validate and format an ISSN. This code fixes the case where an editor has included an ISSN in the citation but
has separated the two groups of four digits with a space. When that condition occurred, the resulting link looked
like this:
|issn=0819 4327 gives: [https://www.worldcat.org/issn/0819 4327 0819 4327] -- can't have spaces in an external link
This code now prevents that by inserting a hyphen at the ISSN midpoint. It also validates the ISSN for length
and makes sure that the checkdigit agrees with the calculated value. Incorrect length (8 digits), characters
other than 0-9 and X, or checkdigit / calculated value mismatch will all cause a check ISSN error message. The
ISSN is always displayed with a hyphen, even if the ISSN was given as a single group of 8 digits.
]]
local function issn (options)
local id = options.id;
local handler = options.handler;
local ignore_invalid = options.accept;
local issn_copy = id; -- save a copy of unadulterated ISSN; use this version for display if ISSN does not validate
local text;
local valid_issn = true;
id = id:gsub ('[%s-]', ''); -- remove hyphens and whitespace
if 8 ~= id:len() or nil == id:match ("^%d*X?$" ) then -- validate the ISSN: 8 digits long, containing only 0-9 or X in the last position
valid_issn = false; -- wrong length or improper character
else
valid_issn = is_valid_isxn (id, 8); -- validate ISSN
end
if true == valid_issn then
id = string.sub (id, 1, 4 ) .. "-" .. string.sub (id, 5 ); -- if valid, display correctly formatted version
else
id = issn_copy; -- if not valid, show the invalid ISSN with error message
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode})
if ignore_invalid then
set_message ('maint_issn_ignore');
else
if false == valid_issn then
options.coins_list_t['ISSN'] = nil; -- when error, unset so not included in COinS
set_message ('err_bad_issn', (options.hkey == 'EISSN') and 'e' or ''); -- create an error message if the ISSN is invalid
end
end
return text;
end
--[[--------------------------< J F M >-----------------------------------------------------------------------
A numerical identifier in the form nn.nnnn.nn
]]
local function jfm (options)
local id = options.id;
local handler = options.handler;
local id_num;
id_num = id:match ('^[Jj][Ff][Mm](.*)$'); -- identifier with jfm prefix; extract identifier
if is_set (id_num) then
set_message ('maint_jfm_format');
else -- plain number without JFM prefix
id_num = id; -- if here id does not have prefix
end
if id_num and id_num:match('^%d%d%.%d%d%d%d%.%d%d$') then
id = id_num; -- jfm matches pattern
else
set_message ('err_bad_jfm' ); -- set an error message
options.coins_list_t['JFM'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< J S T O R >--------------------------------------------------------------------
Format a JSTOR with some error checking
]]
local function jstor (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
if id:find ('[Jj][Ss][Tt][Oo][Rr]') or id:find ('^https?://') or id:find ('%s') then
set_message ('err_bad_jstor'); -- set an error message
options.coins_list_t['JSTOR'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access});
end
--[[--------------------------< L C C N >----------------------------------------------------------------------
Format LCCN link and do simple error checking. LCCN is a character string 8-12 characters long. The length of
the LCCN dictates the character type of the first 1-3 characters; the rightmost eight are always digits.
https://oclc-research.github.io/infoURI-Frozen/info-uri.info/info:lccn/reg.html
length = 8 then all digits
length = 9 then lccn[1] is lowercase alpha
length = 10 then lccn[1] and lccn[2] are both lowercase alpha or both digits
length = 11 then lccn[1] is lower case alpha, lccn[2] and lccn[3] are both lowercase alpha or both digits
length = 12 then lccn[1] and lccn[2] are both lowercase alpha
]]
local function lccn (options)
local lccn = options.id;
local handler = options.handler;
local err_flag; -- presume that LCCN is valid
local id = lccn; -- local copy of the LCCN
id = normalize_lccn (id); -- get canonical form (no whitespace, hyphens, forward slashes)
local len = id:len(); -- get the length of the LCCN
if 8 == len then
if id:match("[^%d]") then -- if LCCN has anything but digits (nil if only digits)
err_flag = set_message ('err_bad_lccn'); -- set an error message
end
elseif 9 == len then -- LCCN should be adddddddd
if nil == id:match("%l%d%d%d%d%d%d%d%d") then -- does it match our pattern?
err_flag = set_message ('err_bad_lccn'); -- set an error message
end
elseif 10 == len then -- LCCN should be aadddddddd or dddddddddd
if id:match("[^%d]") then -- if LCCN has anything but digits (nil if only digits) ...
if nil == id:match("^%l%l%d%d%d%d%d%d%d%d") then -- ... see if it matches our pattern
err_flag = set_message ('err_bad_lccn'); -- no match, set an error message
end
end
elseif 11 == len then -- LCCN should be aaadddddddd or adddddddddd
if not (id:match("^%l%l%l%d%d%d%d%d%d%d%d") or id:match("^%l%d%d%d%d%d%d%d%d%d%d")) then -- see if it matches one of our patterns
err_flag = set_message ('err_bad_lccn'); -- no match, set an error message
end
elseif 12 == len then -- LCCN should be aadddddddddd
if not id:match("^%l%l%d%d%d%d%d%d%d%d%d%d") then -- see if it matches our pattern
err_flag = set_message ('err_bad_lccn'); -- no match, set an error message
end
else
err_flag = set_message ('err_bad_lccn'); -- wrong length, set an error message
end
if not is_set (err_flag) and nil ~= lccn:find ('%s') then
err_flag = set_message ('err_bad_lccn'); -- lccn contains a space, set an error message
end
if is_set (err_flag) then
options.coins_list_t['LCCN'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = lccn, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< M R >--------------------------------------------------------------------------
A seven digit number; if not seven digits, zero-fill leading digits to make seven digits.
]]
local function mr (options)
local id = options.id;
local handler = options.handler;
local id_num;
local id_len;
id_num = id:match ('^[Mm][Rr](%d+)$'); -- identifier with mr prefix
if is_set (id_num) then
set_message ('maint_mr_format'); -- add maint cat
else -- plain number without mr prefix
id_num = id:match ('^%d+$'); -- if here id is all digits
end
id_len = id_num and id_num:len() or 0;
if (7 >= id_len) and (0 ~= id_len) then
id = string.rep ('0', 7-id_len) .. id_num; -- zero-fill leading digits
else
set_message ('err_bad_mr'); -- set an error message
options.coins_list_t['MR'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< O C L C >----------------------------------------------------------------------
Validate and format an OCLC ID. https://www.oclc.org/batchload/controlnumber.en.html {{dead link}}
archived at: https://web.archive.org/web/20161228233804/https://www.oclc.org/batchload/controlnumber.en.html
]]
local function oclc (options)
local id = options.id;
local handler = options.handler;
local number;
if id:match('^ocm%d%d%d%d%d%d%d%d$') then -- ocm prefix and 8 digits; 001 field (12 characters)
number = id:match('ocm(%d+)'); -- get the number
elseif id:match('^ocn%d%d%d%d%d%d%d%d%d$') then -- ocn prefix and 9 digits; 001 field (12 characters)
number = id:match('ocn(%d+)'); -- get the number
elseif id:match('^on%d%d%d%d%d%d%d%d%d%d+$') then -- on prefix and 10 or more digits; 001 field (12 characters)
number = id:match('^on(%d%d%d%d%d%d%d%d%d%d+)$'); -- get the number
elseif id:match('^%(OCoLC%)[1-9]%d*$') then -- (OCoLC) prefix and variable number digits; no leading zeros; 035 field
number = id:match('%(OCoLC%)([1-9]%d*)'); -- get the number
if 9 < number:len() then
number = nil; -- constrain to 1 to 9 digits; change this when OCLC issues 10-digit numbers
end
elseif id:match('^%d+$') then -- no prefix
number = id; -- get the number
if 10 < number:len() then
number = nil; -- constrain to 1 to 10 digits; change this when OCLC issues 11-digit numbers
end
end
if number then -- proper format
id = number; -- exclude prefix, if any, from external link
else
set_message ('err_bad_oclc') -- add an error message if the id is malformed
options.coins_list_t['OCLC'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< O P E N L I B R A R Y >--------------------------------------------------------
Formats an OpenLibrary link, and checks for associated errors.
]]
local function openlibrary (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local ident, code = id:gsub('^OL', ''):match("^(%d+([AMW]))$"); -- strip optional OL prefix followed immediately by digits followed by 'A', 'M', or 'W';
local err_flag;
local prefix = { -- these are appended to the handler.prefix according to code
['A']='authors/OL',
['M']='books/OL',
['W']='works/OL',
['X']='OL' -- not a code; spoof when 'code' in id is invalid
};
if not ident then
code = 'X'; -- no code or id completely invalid
ident = id; -- copy id to ident so that we display the flawed identifier
err_flag = set_message ('err_bad_ol');
end
if not is_set (err_flag) then
options.coins_list_t['OL'] = handler.prefix .. prefix[code] .. ident; -- experiment for ol coins
else
options.coins_list_t['OL'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix .. prefix[code],
id = ident, separator = handler.separator, encode = handler.encode,
access = access});
end
--[[--------------------------< O S T I >----------------------------------------------------------------------
Format OSTI and do simple error checking. OSTIs are sequential numbers beginning at 1 and counting up. This
code checks the OSTI to see that it contains only digits and is less than test_limit specified in the configuration;
the value in test_limit will need to be updated periodically as more OSTIs are issued.
NB. 1018 is the lowest OSTI number found in the wild (so far) and resolving OK on the OSTI site
]]
local function osti (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
if id:match("[^%d]") then -- if OSTI has anything but digits
set_message ('err_bad_osti'); -- set an error message
options.coins_list_t['OSTI'] = nil; -- when error, unset so not included in COinS
else -- OSTI is only digits
local id_num = tonumber (id); -- convert id to a number for range testing
if 1018 > id_num or handler.id_limit < id_num then -- if OSTI is outside test limit boundaries
set_message ('err_bad_osti'); -- set an error message
options.coins_list_t['OSTI'] = nil; -- when error, unset so not included in COinS
end
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access});
end
--[[--------------------------< P M C >------------------------------------------------------------------------
Format a PMC, do simple error checking, and check for embargoed articles.
The embargo parameter takes a date for a value. If the embargo date is in the future the PMC identifier will not
be linked to the article. If the embargo date is today or in the past, or if it is empty or omitted, then the
PMC identifier is linked to the article through the link at cfg.id_handlers['PMC'].prefix.
PMC embargo date testing is done in function is_embargoed () which is called earlier because when the citation
has |pmc=<value> but does not have a |url= then |title= is linked with the PMC link. Function is_embargoed ()
returns the embargo date if the PMC article is still embargoed, otherwise it returns an empty string.
PMCs are sequential numbers beginning at 1 and counting up. This code checks the PMC to see that it contains only digits and is less
than test_limit; the value in local variable test_limit will need to be updated periodically as more PMCs are issued.
]]
local function pmc (options)
local id = options.id;
local embargo = options.Embargo; -- TODO: lowercase?
local handler = options.handler;
local err_flag;
local id_num;
local text;
id_num = id:match ('^[Pp][Mm][Cc](%d+)$'); -- identifier with PMC prefix
if is_set (id_num) then
set_message ('maint_pmc_format');
else -- plain number without PMC prefix
id_num = id:match ('^%d+$'); -- if here id is all digits
end
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber (id_num); -- convert id_num to a number for range testing
if 1 > id_num or handler.id_limit < id_num then -- if PMC is outside test limit boundaries
err_flag = set_message ('err_bad_pmc'); -- set an error message
else
id = tostring (id_num); -- make sure id is a string
end
else -- when id format incorrect
err_flag = set_message ('err_bad_pmc'); -- set an error message
end
if is_set (embargo) and is_set (is_embargoed (embargo)) then -- is PMC is still embargoed?
text = table.concat ( -- still embargoed so no external link
{
make_wikilink (link_label_make (handler), handler.label),
handler.separator,
id,
});
else
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect, -- no embargo date or embargo has expired, ok to link to article
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = handler.access,
auto_link = not err_flag and 'pmc' or nil -- do not auto-link when PMC has error
});
end
if err_flag then
options.coins_list_t['PMC'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< P M I D >----------------------------------------------------------------------
Format PMID and do simple error checking. PMIDs are sequential numbers beginning at 1 and counting up. This
code checks the PMID to see that it contains only digits and is less than test_limit; the value in local variable
test_limit will need to be updated periodically as more PMIDs are issued.
]]
local function pmid (options)
local id = options.id;
local handler = options.handler;
if id:match("[^%d]") then -- if PMID has anything but digits
set_message ('err_bad_pmid'); -- set an error message
options.coins_list_t['PMID'] = nil; -- when error, unset so not included in COinS
else -- PMID is only digits
local id_num = tonumber (id); -- convert id to a number for range testing
if 1 > id_num or handler.id_limit < id_num then -- if PMID is outside test limit boundaries
set_message ('err_bad_pmid'); -- set an error message
options.coins_list_t['PMID'] = nil; -- when error, unset so not included in COinS
end
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--[[--------------------------< R F C >------------------------------------------------------------------------
Format RFC and do simple error checking. RFCs are sequential numbers beginning at 1 and counting up. This
code checks the RFC to see that it contains only digits and is less than test_limit specified in the configuration;
the value in test_limit will need to be updated periodically as more RFCs are issued.
An index of all RFCs is here: https://tools.ietf.org/rfc/
]]
local function rfc (options)
local id = options.id;
local handler = options.handler;
if id:match("[^%d]") then -- if RFC has anything but digits
set_message ('err_bad_rfc'); -- set an error message
options.coins_list_t['RFC'] = nil; -- when error, unset so not included in COinS
else -- RFC is only digits
local id_num = tonumber (id); -- convert id to a number for range testing
if 1 > id_num or handler.id_limit < id_num then -- if RFC is outside test limit boundaries
set_message ('err_bad_rfc'); -- set an error message
options.coins_list_t['RFC'] = nil; -- when error, unset so not included in COinS
end
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = handler.access});
end
--[[--------------------------< S 2 C I D >--------------------------------------------------------------------
Format an S2CID, do simple error checking
S2CIDs are sequential numbers beginning at 1 and counting up. This code checks the S2CID to see that it is only
digits and is less than test_limit; the value in local variable test_limit will need to be updated periodically
as more S2CIDs are issued.
]]
local function s2cid (options)
local id = options.id;
local access = options.access;
local handler = options.handler;
local id_num;
local text;
id_num = id:match ('^[1-9]%d*$'); -- id must be all digits; must not begin with 0; no open access flag
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber (id_num); -- convert id_num to a number for range testing
if handler.id_limit < id_num then -- if S2CID is outside test limit boundaries
set_message ('err_bad_s2cid'); -- set an error message
options.coins_list_t['S2CID'] = nil; -- when error, unset so not included in COinS
end
else -- when id format incorrect
set_message ('err_bad_s2cid'); -- set an error message
options.coins_list_t['S2CID'] = nil; -- when error, unset so not included in COinS
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = access});
return text;
end
--[[--------------------------< S B N >------------------------------------------------------------------------
9-digit form of ISBN-10; uses same check-digit validation when SBN is prefixed with an additional '0' to make 10 digits
sbn value not made part of COinS metadata because we don't have a url or isn't a COinS-defined identifier (rft.xxx)
or an identifier registered at info-uri.info (info:)
]]
local function sbn (options)
local id = options.id;
local ignore_invalid = options.accept;
local handler = options.handler;
local function return_result (check, err_type) -- local function to handle the various returns
local SBN = internal_link_id ({link = handler.link, label = handler.label, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator});
if not ignore_invalid then -- if not ignoring SBN errors
if not check then
options.coins_list_t['SBN'] = nil; -- when error, unset so not included in COinS; not really necessary here because sbn not made part of COinS
set_message ('err_bad_sbn', {err_type}); -- display an error message
return SBN;
end
else
set_message ('maint_isbn_ignore'); -- add a maint category even when there is no error (ToDo: Possibly switch to separate message for SBNs only)
end
return SBN;
end
if id:match ('[^%s-0-9X]') then
return return_result (false, cfg.err_msg_supl.char); -- fail if SBN contains anything but digits, hyphens, or the uppercase X
end
local ident = id:gsub ('[%s-]', ''); -- remove hyphens and whitespace; they interfere with the rest of the tests
if 9 ~= ident:len() then
return return_result (false, cfg.err_msg_supl.length); -- fail if incorrect length
end
if ident:match ('^%d*X?$') == nil then
return return_result (false, cfg.err_msg_supl.form); -- fail if SBN has 'X' anywhere but last position
end
return return_result (is_valid_isxn ('0' .. ident, 10), cfg.err_msg_supl.check);
end
--[[--------------------------< S S R N >----------------------------------------------------------------------
Format an SSRN, do simple error checking
SSRNs are sequential numbers beginning at 100? and counting up. This code checks the SSRN to see that it is
only digits and is greater than 99 and less than test_limit; the value in local variable test_limit will need
to be updated periodically as more SSRNs are issued.
]]
local function ssrn (options)
local id = options.id;
local handler = options.handler;
local id_num;
local text;
id_num = id:match ('^%d+$'); -- id must be all digits
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber (id_num); -- convert id_num to a number for range testing
if 100 > id_num or handler.id_limit < id_num then -- if SSRN is outside test limit boundaries
set_message ('err_bad_ssrn'); -- set an error message
options.coins_list_t['SSRN'] = nil; -- when error, unset so not included in COinS
end
else -- when id format incorrect
set_message ('err_bad_ssrn'); -- set an error message
options.coins_list_t['SSRN'] = nil; -- when error, unset so not included in COinS
end
text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode, access = options.access});
return text;
end
--[[--------------------------< U S E N E T _ I D >------------------------------------------------------------
Validate and format a usenet message id. Simple error checking, looks for 'id-left@id-right' not enclosed in
'<' and/or '>' angle brackets.
]]
local function usenet_id (options)
local id = options.id;
local handler = options.handler;
local text = external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode})
if not id:match('^.+@.+$') or not id:match('^[^<].*[^>]$') then -- doesn't have '@' or has one or first or last character is '< or '>'
set_message ('err_bad_usenet_id') -- add an error message if the message id is invalid
options.coins_list_t['USENETID'] = nil; -- when error, unset so not included in COinS
end
return text;
end
--[[--------------------------< Z B L >-----------------------------------------------------------------------
A numerical identifier in the form nnnn.nnnnn - leading zeros in the first quartet optional
format described here: http://emis.mi.sanu.ac.rs/ZMATH/zmath/en/help/search/
temporary format is apparently eight digits. Anything else is an error
]]
local function zbl (options)
local id = options.id;
local handler = options.handler;
if id:match('^%d%d%d%d%d%d%d%d$') then -- is this identifier using temporary format?
set_message ('maint_zbl'); -- yes, add maint cat
elseif not id:match('^%d?%d?%d?%d%.%d%d%d%d%d$') then -- not temporary, is it normal format?
set_message ('err_bad_zbl'); -- no, set an error message
options.coins_list_t['ZBL'] = nil; -- when error, unset so not included in COinS
end
return external_link_id ({link = handler.link, label = handler.label, q = handler.q, redirect = handler.redirect,
prefix = handler.prefix, id = id, separator = handler.separator, encode = handler.encode});
end
--============================<< I N T E R F A C E F U N C T I O N S >>==========================================
--[[--------------------------< E X T R A C T _ I D S >------------------------------------------------------------
Populates ID table from arguments using configuration settings. Loops through cfg.id_handlers and searches args for
any of the parameters listed in each cfg.id_handlers['...'].parameters. If found, adds the parameter and value to
the identifier list. Emits redundant error message if more than one alias exists in args
]]
local function extract_ids (args)
local id_list = {}; -- list of identifiers found in args
for k, v in pairs (cfg.id_handlers) do -- k is uppercase identifier name as index to cfg.id_handlers; e.g. cfg.id_handlers['ISBN'], v is a table
v = select_one (args, v.parameters, 'err_redundant_parameters' ); -- v.parameters is a table of aliases for k; here we pick one from args if present
if is_set (v) then id_list[k] = v; end -- if found in args, add identifier to our list
end
return id_list;
end
--[[--------------------------< E X T R A C T _ I D _ A C C E S S _ L E V E L S >--------------------------------------
Fetches custom id access levels from arguments using configuration settings. Parameters which have a predefined access
level (e.g. arxiv) do not use this function as they are directly rendered as free without using an additional parameter.
returns a table of k/v pairs where k is same as the identifier's key in cfg.id_handlers and v is the assigned (valid) keyword
access-level values must match the case used in cfg.keywords_lists['id-access'] (lowercase unless there is some special reason for something else)
]]
local function extract_id_access_levels (args, id_list)
local id_accesses_list = {};
for k, v in pairs (cfg.id_handlers) do
local access_param = v.custom_access; -- name of identifier's access-level parameter
if is_set (access_param) then
local access_level = args[access_param]; -- get the assigned value if there is one
if is_set (access_level) then
if not in_array (access_level, cfg.keywords_lists['id-access']) then -- exact match required
set_message ('err_invalid_param_val', {access_param, access_level});
access_level = nil; -- invalid so unset
end
if not is_set (id_list[k]) then -- identifier access-level must have a matching identifier
set_message ('err_param_access_requires_param', {k:lower()}); -- parameter name is uppercase in cfg.id_handlers (k); lowercase for error message
end
id_accesses_list[k] = cfg.keywords_xlate[access_level]; -- get translated keyword
end
end
end
return id_accesses_list;
end
--[[--------------------------< B U I L D _ I D _ L I S T >----------------------------------------------------
render the identifiers into a sorted sequence table
<ID_list_coins_t> is a table of k/v pairs where k is same as key in cfg.id_handlers and v is the assigned value
<options_t> is a table of various k/v option pairs provided in the call to new_build_id_list();
modified by this function and passed to all identifier rendering functions
<access_levels_t> is a table of k/v pairs where k is same as key in cfg.id_handlers and v is the assigned value (if valid)
returns a sequence table of sorted (by hkey - 'handler' key) rendered identifier strings
]]
local function build_id_list (ID_list_coins_t, options_t, access_levels_t)
local ID_list_t = {};
local accept;
local func_map = { --function map points to functions associated with hkey identifier
['ARXIV'] = arxiv,
['ASIN'] = asin,
['BIBCODE'] = bibcode,
['BIORXIV'] = biorxiv,
['CITESEERX'] = citeseerx,
['DOI'] = doi,
['EISSN'] = issn,
['HDL'] = hdl,
['ISBN'] = isbn,
['ISMN'] = ismn,
['ISSN'] = issn,
['JFM'] = jfm,
['JSTOR'] = jstor,
['LCCN'] = lccn,
['MR'] = mr,
['OCLC'] = oclc,
['OL'] = openlibrary,
['OSTI'] = osti,
['PMC'] = pmc,
['PMID'] = pmid,
['RFC'] = rfc,
['S2CID'] = s2cid,
['SBN'] = sbn,
['SSRN'] = ssrn,
['USENETID'] = usenet_id,
['ZBL'] = zbl,
}
for hkey, v in pairs (ID_list_coins_t) do
v, accept = has_accept_as_written (v); -- remove accept-as-written markup if present; accept is boolean true when markup removed; false else
-- every function gets the options table with value v and accept boolean
options_t.hkey = hkey; -- ~/Configuration handler key
options_t.id = v; -- add that identifier value to the options table
options_t.accept = accept; -- add the accept boolean flag
options_t.access = access_levels_t[hkey]; -- add the access level for those that have an |<identifier-access= parameter
options_t.handler = cfg.id_handlers[hkey];
options_t.coins_list_t = ID_list_coins_t; -- pointer to ID_list_coins_t; for |asin= and |ol=; also to keep erroneous values out of the citation's metadata
options_t.coins_list_t[hkey] = v; -- id value without accept-as-written markup for metadata
if options_t.handler.access and not in_array (options_t.handler.access, cfg.keywords_lists['id-access']) then
error (cfg.messages['unknown_ID_access'] .. options_t.handler.access); -- here when handler access key set to a value not listed in list of allowed id access keywords
end
if func_map[hkey] then
local id_text = func_map[hkey] (options_t); -- call the function to get identifier text and any error message
table.insert (ID_list_t, {hkey, id_text}); -- add identifier text to the output sequence table
else
error (cfg.messages['unknown_ID_key'] .. hkey); -- here when func_map doesn't have a function for hkey
end
end
local function comp (a, b) -- used by following table.sort()
return a[1]:lower() < b[1]:lower(); -- sort by hkey
end
table.sort (ID_list_t, comp); -- sequence table of tables sort
for k, v in ipairs (ID_list_t) do -- convert sequence table of tables to simple sequence table of strings
ID_list_t[k] = v[2]; -- v[2] is the identifier rendering from the call to the various functions in func_map{}
end
return ID_list_t;
end
--[[--------------------------< O P T I O N S _ C H E C K >----------------------------------------------------
check that certain option parameters have their associated identifier parameters with values
<ID_list_coins_t> is a table of k/v pairs where k is same as key in cfg.id_handlers and v is the assigned value
<ID_support_t> is a sequence table of tables created in citation0() where each subtable has four elements:
[1] is the support parameter's assigned value; empty string if not set
[2] is a text string same as key in cfg.id_handlers
[3] is cfg.error_conditions key used to create error message
[4] is original ID support parameter name used to create error message
returns nothing; on error emits an appropriate error message
]]
local function options_check (ID_list_coins_t, ID_support_t)
for _, v in ipairs (ID_support_t) do
if is_set (v[1]) and not ID_list_coins_t[v[2]] then -- when support parameter has a value but matching identifier parameter is missing or empty
set_message (v[3], (v[4])); -- emit the appropriate error message
end
end
end
--[[--------------------------< I D E N T I F I E R _ L I S T S _ G E T >--------------------------------------
Creates two identifier lists: a k/v table of identifiers and their values to be used locally and for use in the
COinS metadata, and a sequence table of the rendered identifier strings that will be included in the rendered
citation.
]]
local function identifier_lists_get (args_t, options_t, ID_support_t)
local ID_list_coins_t = extract_ids (args_t); -- get a table of identifiers and their values for use locally and for use in COinS
options_check (ID_list_coins_t, ID_support_t); -- ID support parameters must have matching identifier parameters
local ID_access_levels_t = extract_id_access_levels (args_t, ID_list_coins_t); -- get a table of identifier access levels
local ID_list_t = build_id_list (ID_list_coins_t, options_t, ID_access_levels_t); -- get a sequence table of rendered identifier strings
return ID_list_t, ID_list_coins_t; -- return the tables
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table and imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
cfg = cfg_table_ptr;
has_accept_as_written = utilities_page_ptr.has_accept_as_written; -- import functions from select Module:Citation/CS1/Utilities module
is_set = utilities_page_ptr.is_set;
in_array = utilities_page_ptr.in_array;
set_message = utilities_page_ptr.set_message;
select_one = utilities_page_ptr.select_one;
substitute = utilities_page_ptr.substitute;
make_wikilink = utilities_page_ptr.make_wikilink;
z = utilities_page_ptr.z; -- table of tables in Module:Citation/CS1/Utilities
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
auto_link_urls = auto_link_urls, -- table of identifier URLs to be used when auto-linking |title=
identifier_lists_get = identifier_lists_get, -- experiment to replace individual calls to build_id_list(), extract_ids, extract_id_access_levels
is_embargoed = is_embargoed;
set_selected_modules = set_selected_modules;
}
7de1cb3ecf620ae52d26ff9beaf2d8b1c95dedca
Module:Citation/CS1/COinS
828
117
243
242
2023-08-10T15:23:12Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Citation/CS1/COinS]]
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local has_accept_as_written, is_set, in_array, remove_wiki_link, strip_apostrophe_markup; -- functions in Module:Citation/CS1/Utilities
local cfg; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
--[[--------------------------< M A K E _ C O I N S _ T I T L E >----------------------------------------------
Makes a title for COinS from Title and / or ScriptTitle (or any other name-script pairs)
Apostrophe markup (bold, italics) is stripped from each value so that the COinS metadata isn't corrupted with strings
of %27%27...
]]
local function make_coins_title (title, script)
title = has_accept_as_written (title);
if is_set (title) then
title = strip_apostrophe_markup (title); -- strip any apostrophe markup
else
title = ''; -- if not set, make sure title is an empty string
end
if is_set (script) then
script = script:gsub ('^%l%l%s*:%s*', ''); -- remove language prefix if present (script value may now be empty string)
script = strip_apostrophe_markup (script); -- strip any apostrophe markup
else
script = ''; -- if not set, make sure script is an empty string
end
if is_set (title) and is_set (script) then
script = ' ' .. script; -- add a space before we concatenate
end
return title .. script; -- return the concatenation
end
--[[--------------------------< E S C A P E _ L U A _ M A G I C _ C H A R S >----------------------------------
Returns a string where all of Lua's magic characters have been escaped. This is important because functions like
string.gsub() treat their pattern and replace strings as patterns, not literal strings.
]]
local function escape_lua_magic_chars (argument)
argument = argument:gsub("%%", "%%%%"); -- replace % with %%
argument = argument:gsub("([%^%$%(%)%.%[%]%*%+%-%?])", "%%%1"); -- replace all other Lua magic pattern characters
return argument;
end
--[[--------------------------< G E T _ C O I N S _ P A G E S >------------------------------------------------
Extract page numbers from external wikilinks in any of the |page=, |pages=, or |at= parameters for use in COinS.
]]
local function get_coins_pages (pages)
local pattern;
if not is_set (pages) then return pages; end -- if no page numbers then we're done
while true do
pattern = pages:match("%[(%w*:?//[^ ]+%s+)[%w%d].*%]"); -- pattern is the opening bracket, the URL and following space(s): "[url "
if nil == pattern then break; end -- no more URLs
pattern = escape_lua_magic_chars (pattern); -- pattern is not a literal string; escape Lua's magic pattern characters
pages = pages:gsub(pattern, ""); -- remove as many instances of pattern as possible
end
pages = pages:gsub("[%[%]]", ""); -- remove the brackets
pages = pages:gsub("–", "-" ); -- replace endashes with hyphens
pages = pages:gsub("&%w+;", "-" ); -- and replace HTML entities (– etc.) with hyphens; do we need to replace numerical entities like   and the like?
return pages;
end
--[=[-------------------------< C O I N S _ R E P L A C E _ M A T H _ S T R I P M A R K E R >------------------
There are three options for math markup rendering that depend on the editor's math preference settings. These
settings are at [[Special:Preferences#mw-prefsection-rendering]] and are
PNG images
TeX source
MathML with SVG or PNG fallback
All three are heavy with HTML and CSS which doesn't belong in the metadata.
Without this function, the metadata saved in the raw wikitext contained the rendering determined by the settings
of the last editor to save the page.
This function gets the rendered form of an equation according to the editor's preference before the page is saved. It
then searches the rendering for the text equivalent of the rendered equation and replaces the rendering with that so
that the page is saved without extraneous HTML/CSS markup and with a reasonably readable text form of the equation.
When a replacement is made, this function returns true and the value with replacement; otherwise false and the initial
value. To replace multipe equations it is necessary to call this function from within a loop.
]=]
local function coins_replace_math_stripmarker (value)
local stripmarker = cfg.stripmarkers['math'];
local rendering = value:match (stripmarker); -- is there a math stripmarker
if not rendering then -- when value doesn't have a math stripmarker, abandon this test
return false, value;
end
rendering = mw.text.unstripNoWiki (rendering); -- convert stripmarker into rendered value (or nil? ''? when math render error)
if rendering:match ('alt="[^"]+"') then -- if PNG math option
rendering = rendering:match ('alt="([^"]+)"'); -- extract just the math text
elseif rendering:match ('$%s+.+%s+%$') then -- if TeX math option; $ is legit character that is escapes as \$
rendering = rendering:match ('$%s+(.+)%s+%$') -- extract just the math text
elseif rendering:match ('<annotation[^>]+>.+</annotation>') then -- if MathML math option
rendering = rendering:match ('<annotation[^>]+>(.+)</annotation>') -- extract just the math text
else
return false, value; -- had math stripmarker but not one of the three defined forms
end
return true, value:gsub (stripmarker, rendering, 1);
end
--[[--------------------------< C O I N S _ C L E A N U P >----------------------------------------------------
Cleanup parameter values for the metadata by removing or replacing invisible characters and certain HTML entities.
2015-12-10: there is a bug in mw.text.unstripNoWiki (). It replaces math stripmarkers with the appropriate content
when it shouldn't. See https://phabricator.wikimedia.org/T121085 and Wikipedia_talk:Lua#stripmarkers_and_mw.text.unstripNoWiki.28.29
TODO: move the replacement patterns and replacement values into a table in /Configuration similar to the invisible
characters table?
]]
local function coins_cleanup (value)
local replaced = true; -- default state to get the do loop running
while replaced do -- loop until all math stripmarkers replaced
replaced, value = coins_replace_math_stripmarker (value); -- replace math stripmarker with text representation of the equation
end
value = value:gsub (cfg.stripmarkers['math'], "MATH RENDER ERROR"); -- one or more couldn't be replaced; insert vague error message
value = mw.text.unstripNoWiki (value); -- replace nowiki stripmarkers with their content
value = value:gsub ('<span class="nowrap" style="padding%-left:0%.1em;">'(s?)</span>', "'%1"); -- replace {{'}} or {{'s}} with simple apostrophe or apostrophe-s
value = value:gsub (' ', ' '); -- replace entity with plain space
value = value:gsub ('\226\128\138', ' '); -- replace hair space with plain space
if not mw.ustring.find (value, cfg.indic_script) then -- don't remove zero-width joiner characters from indic script
value = value:gsub ('‍', ''); -- remove ‍ entities
value = mw.ustring.gsub (value, '[\226\128\141\226\128\139\194\173]', ''); -- remove zero-width joiner, zero-width space, soft hyphen
end
value = value:gsub ('[\009\010\013 ]+', ' '); -- replace horizontal tab, line feed, carriage return with plain space
return value;
end
--[[--------------------------< C O I N S >--------------------------------------------------------------------
COinS metadata (see <http://ocoins.info/>) allows automated tools to parse the citation information.
]]
local function COinS(data, class)
if 'table' ~= type(data) or nil == next(data) then
return '';
end
for k, v in pairs (data) do -- spin through all of the metadata parameter values
if 'ID_list' ~= k and 'Authors' ~= k then -- except the ID_list and Author tables (author nowiki stripmarker done when Author table processed)
data[k] = coins_cleanup (v);
end
end
local ctx_ver = "Z39.88-2004";
-- treat table strictly as an array with only set values.
local OCinSoutput = setmetatable( {}, {
__newindex = function(self, key, value)
if is_set(value) then
rawset( self, #self+1, table.concat{ key, '=', mw.uri.encode( remove_wiki_link( value ) ) } );
end
end
});
if in_array (class, {'arxiv', 'biorxiv', 'citeseerx', 'ssrn', 'journal', 'news', 'magazine'}) or
(in_array (class, {'conference', 'interview', 'map', 'press release', 'web'}) and is_set(data.Periodical)) or
('citation' == class and is_set(data.Periodical) and not is_set (data.Encyclopedia)) then
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:journal"; -- journal metadata identifier
if in_array (class, {'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) then -- set genre according to the type of citation template we are rendering
OCinSoutput["rft.genre"] = "preprint"; -- cite arxiv, cite biorxiv, cite citeseerx, cite ssrn
elseif 'conference' == class then
OCinSoutput["rft.genre"] = "conference"; -- cite conference (when Periodical set)
elseif 'web' == class then
OCinSoutput["rft.genre"] = "unknown"; -- cite web (when Periodical set)
else
OCinSoutput["rft.genre"] = "article"; -- journal and other 'periodical' articles
end
OCinSoutput["rft.jtitle"] = data.Periodical; -- journal only
OCinSoutput["rft.atitle"] = data.Title; -- 'periodical' article titles
-- these used only for periodicals
OCinSoutput["rft.ssn"] = data.Season; -- keywords: winter, spring, summer, fall
OCinSoutput["rft.quarter"] = data.Quarter; -- single digits 1->first quarter, etc.
OCinSoutput["rft.chron"] = data.Chron; -- free-form date components
OCinSoutput["rft.volume"] = data.Volume; -- does not apply to books
OCinSoutput["rft.issue"] = data.Issue;
OCinSoutput['rft.artnum'] = data.ArticleNumber; -- {{cite journal}} only
OCinSoutput["rft.pages"] = data.Pages; -- also used in book metadata
elseif 'thesis' ~= class then -- all others except cite thesis are treated as 'book' metadata; genre distinguishes
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:book"; -- book metadata identifier
if 'report' == class or 'techreport' == class then -- cite report and cite techreport
OCinSoutput["rft.genre"] = "report";
elseif 'conference' == class then -- cite conference when Periodical not set
OCinSoutput["rft.genre"] = "conference";
OCinSoutput["rft.atitle"] = data.Chapter; -- conference paper as chapter in proceedings (book)
elseif in_array (class, {'book', 'citation', 'encyclopaedia', 'interview', 'map'}) then
if is_set (data.Chapter) then
OCinSoutput["rft.genre"] = "bookitem";
OCinSoutput["rft.atitle"] = data.Chapter; -- book chapter, encyclopedia article, interview in a book, or map title
else
if 'map' == class or 'interview' == class then
OCinSoutput["rft.genre"] = 'unknown'; -- standalone map or interview
else
OCinSoutput["rft.genre"] = 'book'; -- book and encyclopedia
end
end
else -- {'audio-visual', 'AV-media-notes', 'DVD-notes', 'episode', 'interview', 'mailinglist', 'map', 'newsgroup', 'podcast', 'press release', 'serial', 'sign', 'speech', 'web'}
OCinSoutput["rft.genre"] = "unknown";
end
OCinSoutput["rft.btitle"] = data.Title; -- book only
OCinSoutput["rft.place"] = data.PublicationPlace; -- book only
OCinSoutput["rft.series"] = data.Series; -- book only
OCinSoutput["rft.pages"] = data.Pages; -- book, journal
OCinSoutput["rft.edition"] = data.Edition; -- book only
OCinSoutput["rft.pub"] = data.PublisherName; -- book and dissertation
else -- cite thesis
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:dissertation"; -- dissertation metadata identifier
OCinSoutput["rft.title"] = data.Title; -- dissertation (also patent but that is not yet supported)
OCinSoutput["rft.degree"] = data.Degree; -- dissertation only
OCinSoutput['rft.inst'] = data.PublisherName; -- book and dissertation
end
-- NB. Not currently supported are "info:ofi/fmt:kev:mtx:patent", "info:ofi/fmt:kev:mtx:dc", "info:ofi/fmt:kev:mtx:sch_svc", "info:ofi/fmt:kev:mtx:ctx"
-- and now common parameters (as much as possible)
OCinSoutput["rft.date"] = data.Date; -- book, journal, dissertation
for k, v in pairs( data.ID_list ) do -- what to do about these? For now assume that they are common to all?
if k == 'ISBN' then v = v:gsub( "[^-0-9X]", "" ); end
local id = cfg.id_handlers[k].COinS;
if string.sub( id or "", 1, 4 ) == 'info' then -- for ids that are in the info:registry
OCinSoutput["rft_id"] = table.concat{ id, "/", v };
elseif string.sub (id or "", 1, 3 ) == 'rft' then -- for isbn, issn, eissn, etc. that have defined COinS keywords
OCinSoutput[ id ] = v;
elseif 'url' == id then -- for urls that are assembled in ~/Identifiers; |asin= and |ol=
OCinSoutput["rft_id"] = table.concat ({data.ID_list[k], "#id-name=", cfg.id_handlers[k].label});
elseif id then -- when cfg.id_handlers[k].COinS is not nil so urls created here
OCinSoutput["rft_id"] = table.concat{ cfg.id_handlers[k].prefix, v, cfg.id_handlers[k].suffix or '', "#id-name=", cfg.id_handlers[k].label }; -- others; provide a URL and indicate identifier name as #fragment (human-readable, but transparent to browsers)
end
end
local last, first;
for k, v in ipairs( data.Authors ) do
last, first = coins_cleanup (v.last), coins_cleanup (v.first or ''); -- replace any nowiki stripmarkers, non-printing or invisible characters
if k == 1 then -- for the first author name only
if is_set(last) and is_set(first) then -- set these COinS values if |first= and |last= specify the first author name
OCinSoutput["rft.aulast"] = last; -- book, journal, dissertation
OCinSoutput["rft.aufirst"] = first; -- book, journal, dissertation
elseif is_set(last) then
OCinSoutput["rft.au"] = last; -- book, journal, dissertation -- otherwise use this form for the first name
end
else -- for all other authors
if is_set(last) and is_set(first) then
OCinSoutput["rft.au"] = table.concat{ last, ", ", first }; -- book, journal, dissertation
elseif is_set(last) then
OCinSoutput["rft.au"] = last; -- book, journal, dissertation
end
-- TODO: At present we do not report "et al.". Add anything special if this condition applies?
end
end
OCinSoutput.rft_id = data.URL;
OCinSoutput.rfr_id = table.concat{ "info:sid/", mw.site.server:match( "[^/]*$" ), ":", data.RawPage };
-- TODO: Add optional extra info:
-- rfr_dat=#REVISION<version> (referrer private data)
-- ctx_id=<data.RawPage>#<ref> (identifier for the context object)
-- ctx_tim=<ts> (timestamp in format yyyy-mm-ddThh:mm:ssTZD or yyyy-mm-dd)
-- ctx_enc=info:ofi/enc:UTF-8 (character encoding)
OCinSoutput = setmetatable( OCinSoutput, nil );
-- sort with version string always first, and combine.
-- table.sort( OCinSoutput );
table.insert( OCinSoutput, 1, "ctx_ver=" .. ctx_ver ); -- such as "Z39.88-2004"
return table.concat(OCinSoutput, "&");
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table and imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
cfg = cfg_table_ptr;
has_accept_as_written = utilities_page_ptr.has_accept_as_written; -- import functions from selected Module:Citation/CS1/Utilities module
is_set = utilities_page_ptr.is_set;
in_array = utilities_page_ptr.in_array;
remove_wiki_link = utilities_page_ptr.remove_wiki_link;
strip_apostrophe_markup = utilities_page_ptr.strip_apostrophe_markup;
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
make_coins_title = make_coins_title,
get_coins_pages = get_coins_pages,
COinS = COinS,
set_selected_modules = set_selected_modules,
}
55b7d6a7605b5e672604b0210feeb5286b799f8e
Module:Citation/CS1/styles.css
828
118
245
244
2023-08-10T15:23:13Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Citation/CS1/styles.css]]
sanitized-css
text/css
/* Protection icon
the following line controls the page-protection icon in the upper right corner
it must remain within this comment
{{sandbox other||{{pp-template}}}}
*/
/* Overrides
Some wikis do not override user agent default styles for HTML <cite> and <q>,
unlike en.wp. On en.wp, keep these the same as [[MediaWiki:Common.css]].
The word-wrap and :target styles were moved here from Common.css.
On en.wp, keep these the same as [[Template:Citation/styles.css]].
*/
cite.citation {
font-style: inherit; /* Remove italics for <cite> */
/* Break long urls, etc., rather than overflowing box */
word-wrap: break-word;
}
.citation q {
quotes: '"' '"' "'" "'"; /* Straight quote marks for <q> */
}
/* Highlight linked elements (such as clicked references) in blue */
.citation:target {
/* ignore the linter - all browsers of interest implement this */
background-color: rgba(0, 127, 255, 0.133);
}
/* ID and URL access
Both core and Common.css have selector .mw-parser-output a[href$=".pdf"].external
for PDF pages. All TemplateStyles pages are hoisted to .mw-parser-output. We need
to have specificity equal to a[href$=".pdf"].external for locks to override PDF icon.
That's essentially 2 classes and 1 element.
the .id-lock-... selectors are for use by non-citation templates like
{{Catalog lookup link}} which do not have to handle PDF links
*/
.id-lock-free a,
.citation .cs1-lock-free a {
background: url(//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg)
right 0.1em center/9px no-repeat;
}
.id-lock-limited a,
.id-lock-registration a,
.citation .cs1-lock-limited a,
.citation .cs1-lock-registration a {
background: url(//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg)
right 0.1em center/9px no-repeat;
}
.id-lock-subscription a,
.citation .cs1-lock-subscription a {
background: url(//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg)
right 0.1em center/9px no-repeat;
}
/* Wikisource
Wikisource icon when |chapter= or |title= is wikilinked to Wikisource
as in cite wikisource
*/
.cs1-ws-icon a {
background: url(//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg)
right 0.1em center/12px no-repeat;
}
/* Errors and maintenance */
.cs1-code {
/* <code>...</code> style override: mediawiki's css definition is specified here:
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/
69cd73811f7aadd093050dbf20ed70ef0b42a713/skins%2Fcommon%2FcommonElements.css#L199
*/
color: inherit;
background: inherit;
border: none;
padding: inherit;
}
.cs1-hidden-error {
display: none;
color: #d33;
}
.cs1-visible-error {
color: #d33;
}
.cs1-maint {
display: none;
color: #3a3;
margin-left: 0.3em;
}
/* Small text size
Set small text size in one place. 0.95 (here) * 0.9 (from references list) is
~0.85, which is the lower bound for size for accessibility. Old styling for this
was just 0.85. We could write the rule so that when this template is inside
references/reflist, only then does it multiply by 0.95; else multiply by 0.85 */
.cs1-format {
font-size: 95%;
}
/* kerning */
.cs1-kern-left {
padding-left: 0.2em;
}
.cs1-kern-right {
padding-right: 0.2em;
}
/* selflinks – avoid bold font style when cs1|2 template links to the current page */
.citation .mw-selflink {
font-weight: inherit;
}
7c96feb084b1883e7b6522660da6a14bdcc94752
Template:If both
10
119
247
246
2023-08-10T15:23:14Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:If_both]]
wikitext
text/x-wiki
{{{{{|safesubst:}}}#if:{{{1|}}}| {{{{{|safesubst:}}}#if:{{{2|}}}|{{{3|}}}|{{{4|}}}}} |{{{4|}}} }}<noinclude>
{{Documentation}}
<!--
PLEASE ADD CATEGORIES AND INTERWIKIS
TO THE /doc SUBPAGE, THANKS
-->
</noinclude>
d77fc191cada8977a8131dd6d85dde5e31d0e6f2
Template:Flatlist
10
120
249
248
2023-08-10T15:23:15Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Flatlist]]
wikitext
text/x-wiki
<templatestyles src="Hlist/styles.css"/><div class="hlist {{{class|}}}" {{#if:{{{style|}}}{{{indent|}}}|style="{{#if:{{{indent|}}}|margin-left: {{#expr:{{{indent}}}*1.6}}em;}} {{{style|}}}"}}>{{#if:{{{1|}}}|
{{{1}}}
</div>}}<noinclude></div>
{{documentation}}
</noinclude>
cf60aa4aef920d48fa394e786f72fe5f6dcd3169
Template:Br separated entries
10
121
251
250
2023-08-10T15:23:16Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Br_separated_entries]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:Separated entries|br}}<noinclude>
{{documentation}}
</noinclude>
2019f7fc383259e70d66e43cbd97a43d20889f1b
Template:Unbulleted list
10
122
253
252
2023-08-10T15:23:16Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Unbulleted_list]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:list|unbulleted}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
89815a491d3e05b20af446e34cda13f13c25fb4f
Module:Infobox
828
123
255
254
2023-08-10T15:23:17Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Infobox]]
Scribunto
text/plain
local p = {}
local args = {}
local origArgs = {}
local root
local empty_row_categories = {}
local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'
local has_rows = false
local lists = {
plainlist_t = {
patterns = {
'^plainlist$',
'%splainlist$',
'^plainlist%s',
'%splainlist%s'
},
found = false,
styles = 'Plainlist/styles.css'
},
hlist_t = {
patterns = {
'^hlist$',
'%shlist$',
'^hlist%s',
'%shlist%s'
},
found = false,
styles = 'Hlist/styles.css'
}
}
local function has_list_class(args_to_check)
for _, list in pairs(lists) do
if not list.found then
for _, arg in pairs(args_to_check) do
for _, pattern in ipairs(list.patterns) do
if mw.ustring.find(arg or '', pattern) then
list.found = true
break
end
end
if list.found then break end
end
end
end
end
local function fixChildBoxes(sval, tt)
local function notempty( s ) return s and s:match( '%S' ) end
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
-- start moving templatestyles and categories inside of table rows
local slast = ''
while slast ~= s do
slast = s
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')
end
-- end moving templatestyles and categories inside of table rows
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' ..
subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' ..
subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
-- the next two lines add a newline at the end of lists for the PHP parser
-- [[Special:Diff/849054481]]
-- remove when [[:phab:T191516]] is fixed or OBE
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
return s
else
return sval
end
end
-- Cleans empty tables
local function cleanInfobox()
root = tostring(root)
if has_rows == false then
root = mw.ustring.gsub(root, '<table[^<>]*>%s*</table>', '')
end
end
-- Returns the union of the values of two tables, as a sequence.
local function union(t1, t2)
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local function getArgNums(prefix)
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
local function addRow(rowArgs)
if rowArgs.header and rowArgs.header ~= '_BLANK_' then
has_rows = true
has_list_class({ rowArgs.rowclass, rowArgs.class, args.headerclass })
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:tag('th')
:attr('colspan', '2')
:addClass('infobox-header')
:addClass(rowArgs.class)
:addClass(args.headerclass)
-- @deprecated next; target .infobox-<name> .infobox-header
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
if rowArgs.data then
root:wikitext(
'[[Category:Pages using infobox templates with ignored data cells]]'
)
end
elseif rowArgs.data and rowArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ rowArgs.rowclass, rowArgs.class })
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:addClass('infobox-label')
-- @deprecated next; target .infobox-<name> .infobox-label
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
dataCell
:attr('colspan', not rowArgs.label and '2' or nil)
:addClass(not rowArgs.label and 'infobox-full-data' or 'infobox-data')
:addClass(rowArgs.class)
-- @deprecated next; target .infobox-<name> .infobox(-full)-data
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
else
table.insert(empty_row_categories, rowArgs.data or '')
end
end
local function renderTitle()
if not args.title then return end
has_rows = true
has_list_class({args.titleclass})
root
:tag('caption')
:addClass('infobox-title')
:addClass(args.titleclass)
-- @deprecated next; target .infobox-<name> .infobox-title
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
has_rows = true
has_list_class({ args.aboveclass })
root
:tag('tr')
:tag('th')
:attr('colspan', '2')
:addClass('infobox-above')
:addClass(args.aboveclass)
-- @deprecated next; target .infobox-<name> .infobox-above
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
has_rows = true
has_list_class({ args.belowclass })
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-below')
:addClass(args.belowclass)
-- @deprecated next; target .infobox-<name> .infobox-below
:cssText(args.belowstyle)
:wikitext(fixChildBoxes(args.below,'td'))
end
local function addSubheaderRow(subheaderArgs)
if subheaderArgs.data and
subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ subheaderArgs.rowclass, subheaderArgs.class })
local row = root:tag('tr')
row:addClass(subheaderArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-subheader')
:addClass(subheaderArgs.class)
:cssText(subheaderArgs.datastyle)
:cssText(subheaderArgs.rowcellstyle)
:wikitext(fixChildBoxes(subheaderArgs.data, 'td'))
else
table.insert(empty_row_categories, subheaderArgs.data or '')
end
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addSubheaderRow({
data = args['subheader' .. tostring(num)],
-- @deprecated next; target .infobox-<name> .infobox-subheader
datastyle = args.subheaderstyle,
rowcellstyle = args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function addImageRow(imageArgs)
if imageArgs.data and
imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ imageArgs.rowclass, imageArgs.class })
local row = root:tag('tr')
row:addClass(imageArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-image')
:addClass(imageArgs.class)
:cssText(imageArgs.datastyle)
:wikitext(fixChildBoxes(imageArgs.data, 'td'))
else
table.insert(empty_row_categories, imageArgs.data or '')
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:addClass('infobox-caption')
-- @deprecated next; target .infobox-<name> .infobox-caption
:cssText(args.captionstyle)
:wikitext(caption)
end
addImageRow({
data = tostring(data),
-- @deprecated next; target .infobox-<name> .infobox-image
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
-- When autoheaders are turned on, preprocesses the rows
local function preprocessRows()
if not args.autoheaders then return end
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
local lastheader
for k, num in ipairs(rownums) do
if args['header' .. tostring(num)] then
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
lastheader = num
elseif args['data' .. tostring(num)] and
args['data' .. tostring(num)]:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
local data = args['data' .. tostring(num)]
if data:gsub(category_in_empty_row_pattern, ''):match('%S') then
lastheader = nil
end
end
end
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
end
-- Gets the union of the header and data argument numbers,
-- and renders them all in order
local function renderRows()
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
-- @deprecated next; target .infobox-<name> rowclass
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
has_rows = true
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-navbar')
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(require('Module:Italic title')._main({}))
end
end
-- Categories in otherwise empty rows are collected in empty_row_categories.
-- This function adds them to the module output. It is not affected by
-- args.decat because this module should not prevent module-external categories
-- from rendering.
local function renderEmptyRowCategories()
for _, s in ipairs(empty_row_categories) do
root:wikitext(s)
end
end
-- Render tracking categories. args.decat == turns off tracking categories.
local function renderTrackingCategories()
if args.decat == 'yes' then return end
if args.child == 'yes' then
if args.title then
root:wikitext(
'[[Category:Pages using embedded infobox templates with the title parameter]]'
)
end
elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles using infobox templates with no data rows]]')
end
end
--[=[
Loads the templatestyles for the infobox.
TODO: FINISH loading base templatestyles here rather than in
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.
See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.
]=]
local function loadTemplateStyles()
local frame = mw.getCurrentFrame()
local hlist_templatestyles = ''
if lists.hlist_t.found then
hlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.hlist_t.styles }
}
end
local plainlist_templatestyles = ''
if lists.plainlist_t.found then
plainlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.plainlist_t.styles }
}
end
-- See function description
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
}
local templatestyles = ''
if args['templatestyles'] then
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] then
child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] then
grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
-- hlist -> plainlist -> base is best-effort to preserve old Common.css ordering.
-- this ordering is not a guarantee because the rows of interest invoking
-- each class may not be on a specific page
hlist_templatestyles,
plainlist_templatestyles,
base_templatestyles,
templatestyles,
child_templatestyles,
grandchild_templatestyles
})
end
-- common functions between the child and non child cases
local function structure_infobox_common()
renderSubheaders()
renderImages()
preprocessRows()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderEmptyRowCategories()
renderTrackingCategories()
cleanInfobox()
end
-- Specify the overall layout of the infobox, with special settings if the
-- infobox is used as a 'child' inside another infobox.
local function _infobox()
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass(args.subbox == 'yes' and 'infobox-subbox' or 'infobox')
:addClass(args.bodyclass)
-- @deprecated next; target .infobox-<name>
:cssText(args.bodystyle)
has_list_class({ args.bodyclass })
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
structure_infobox_common()
return loadTemplateStyles() .. root
end
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
local function preprocessSingleArg(argName)
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
-- Assign the parameters with the given prefixes to the args table, in order, in
-- batches of the step size specified. This is to prevent references etc. from
-- appearing in the wrong order. The prefixTable should be an array containing
-- tables, each of which has two possible fields, a "prefix" string and a
-- "depend" table. The function always parses parameters containing the "prefix"
-- string, but only parses parameters in the "depend" table if the prefix
-- parameter is present and non-blank.
local function preprocessArgs(prefixTable, step)
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or
(v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present
-- and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
-- Do another loop if any arguments are found, even blank ones.
moreArgumentsExist = true
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present
-- and not blank, or we are processing "prefix1" and "prefix" is
-- present and not blank, and if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so
-- that references etc. will display in the expected places. Parameters that
-- depend on another parameter are only processed if that parameter is present,
-- to avoid phantom references appearing in article reference lists.
local function parseDataParameters()
preprocessSingleArg('autoheaders')
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
-- different behaviour for italics if blank or absent
args['italic title'] = origArgs['italic title']
preprocessSingleArg('decat')
preprocessSingleArg('templatestyles')
preprocessSingleArg('child templatestyles')
preprocessSingleArg('grandchild templatestyles')
end
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
function p.infobox(frame)
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
parseDataParameters()
return _infobox()
end
-- For calling via #invoke within a template
function p.infoboxTemplate(frame)
origArgs = {}
for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
parseDataParameters()
return _infobox()
end
return p
0ddb7e5c8426d67cd589b710efb9912ddfb67fea
Module:InfoboxImage
828
124
257
256
2023-08-10T15:23:17Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:InfoboxImage]]
Scribunto
text/plain
-- Inputs:
-- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link
-- page - page to display for multipage images (DjVu)
-- size - size to display the image
-- maxsize - maximum size for image
-- sizedefault - default size to display the image if size param is blank
-- alt - alt text for image
-- title - title text for image
-- border - set to yes if border
-- center - set to yes, if the image has to be centered
-- upright - upright image param
-- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it
-- link - page to visit when clicking on image
-- class - HTML classes to add to the image
-- Outputs:
-- Formatted image.
-- More details available at the "Module:InfoboxImage/doc" page
local i = {};
local placeholder_image = {
"Blue - Replace this image female.svg",
"Blue - Replace this image male.svg",
"Female no free image yet.png",
"Flag of None (square).svg",
"Flag of None.svg",
"Flag of.svg",
"Green - Replace this image female.svg",
"Green - Replace this image male.svg",
"Image is needed female.svg",
"Image is needed male.svg",
"Location map of None.svg",
"Male no free image yet.png",
"Missing flag.png",
"No flag.svg",
"No free portrait.svg",
"No portrait (female).svg",
"No portrait (male).svg",
"Red - Replace this image female.svg",
"Red - Replace this image male.svg",
"Replace this image female (blue).svg",
"Replace this image female.svg",
"Replace this image male (blue).svg",
"Replace this image male.svg",
"Silver - Replace this image female.svg",
"Silver - Replace this image male.svg",
"Replace this image.svg",
"Cricket no pic.png",
"CarersLogo.gif",
"Diagram Needed.svg",
"Example.jpg",
"Image placeholder.png",
"No male portrait.svg",
"Nocover-upload.png",
"NoDVDcover copy.png",
"Noribbon.svg",
"No portrait-BFD-test.svg",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Sin bandera.svg",
"Sin escudo.svg",
"Replace this image - temple.png",
"Replace this image butterfly.png",
"Replace this image.svg",
"Replace this image1.svg",
"Resolution angle.png",
"Image-No portrait-text-BFD-test.svg",
"Insert image here.svg",
"No image available.png",
"NO IMAGE YET square.png",
"NO IMAGE YET.png",
"No Photo Available.svg",
"No Screenshot.svg",
"No-image-available.jpg",
"Null.png",
"PictureNeeded.gif",
"Place holder.jpg",
"Unbenannt.JPG",
"UploadACopyrightFreeImage.svg",
"UploadAnImage.gif",
"UploadAnImage.svg",
"UploadAnImageShort.svg",
"CarersLogo.gif",
"Diagram Needed.svg",
"No male portrait.svg",
"NoDVDcover copy.png",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Noimage.gif",
}
function i.IsPlaceholder(image)
-- change underscores to spaces
image = mw.ustring.gsub(image, "_", " ");
assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil')
-- if image starts with [[ then remove that and anything after |
if mw.ustring.sub(image,1,2) == "[[" then
image = mw.ustring.sub(image,3);
image = mw.ustring.gsub(image, "([^|]*)|.*", "%1");
assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil')
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil")
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
-- capitalise first letter
image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2);
for i,j in pairs(placeholder_image) do
if image == j then
return true
end
end
return false
end
function i.InfoboxImage(frame)
local image = frame.args["image"];
if image == "" or image == nil then
return "";
end
if image == " " then
return image;
end
if frame.args["suppressplaceholder"] ~= "no" then
if i.IsPlaceholder(image) == true then
return "";
end
end
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then
return "";
end
if mw.ustring.sub(image,1,2) == "[[" then
-- search for thumbnail images and add to tracking cat if found
local cat = "";
if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then
cat = "[[Category:Pages using infoboxes with thumbnail images]]";
end
return image .. cat;
elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then
return image;
elseif mw.ustring.sub(image,1,1) == "<" then
return image;
elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127).."UNIQ" then
-- Found strip marker at begining, so pass don't process at all
return image;
elseif mw.ustring.sub(image,4,9) == "`UNIQ-" then
-- Found strip marker at begining, so pass don't process at all
return image;
else
local result = "";
local page = frame.args["page"];
local size = frame.args["size"];
local maxsize = frame.args["maxsize"];
local sizedefault = frame.args["sizedefault"];
local alt = frame.args["alt"];
local link = frame.args["link"];
local title = frame.args["title"];
local border = frame.args["border"];
local upright = frame.args["upright"] or "";
local thumbtime = frame.args["thumbtime"] or "";
local center = frame.args["center"];
local class = frame.args["class"];
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
if maxsize ~= "" and maxsize ~= nil then
-- if no sizedefault then set to maxsize
if sizedefault == "" or sizedefault == nil then
sizedefault = maxsize
end
-- check to see if size bigger than maxsize
if size ~= "" and size ~= nil then
local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0;
local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0;
if sizenumber>maxsizenumber and maxsizenumber>0 then
size = maxsize;
end
end
end
-- add px to size if just a number
if (tonumber(size) or 0) > 0 then
size = size .. "px";
end
-- add px to sizedefault if just a number
if (tonumber(sizedefault) or 0) > 0 then
sizedefault = sizedefault .. "px";
end
result = "[[File:" .. image;
if page ~= "" and page ~= nil then
result = result .. "|page=" .. page;
end
if size ~= "" and size ~= nil then
result = result .. "|" .. size;
elseif sizedefault ~= "" and sizedefault ~= nil then
result = result .. "|" .. sizedefault;
else
result = result .. "|frameless";
end
if center == "yes" then
result = result .. "|center"
end
if alt ~= "" and alt ~= nil then
result = result .. "|alt=" .. alt;
end
if link ~= "" and link ~= nil then
result = result .. "|link=" .. link;
end
if border == "yes" then
result = result .. "|border";
end
if upright == "yes" then
result = result .. "|upright";
elseif upright ~= "" then
result = result .. "|upright=" .. upright;
end
if thumbtime ~= "" then
result = result .. "|thumbtime=" .. thumbtime;
end
if class ~= nil and class ~= "" then
result = result .. "|class=" .. class;
end
-- if alt value is a keyword then do not use as a description
if alt == "thumbnail" or alt == "thumb" or alt == "frameless" or alt == "left" or alt == "center" or alt == "right" or alt == "upright" or alt == "border" or mw.ustring.match(alt or "", '^[0-9]*px$', 1) ~= nil then
alt = nil;
end
if title ~= "" and title ~= nil then
-- does title param contain any templatestyles? If yes then set to blank.
if mw.ustring.match(frame:preprocess(title), 'UNIQ%-%-templatestyles', 1) ~= nil then
title = nil;
end
end
if title ~= "" and title ~= nil then
result = result .. "|" .. title;
end
result = result .. "]]";
return result;
end
end
return i;
0ee5fe75ba239fc5c9cedc81ca11bdc0be068542
Module:Infobox/styles.css
828
125
259
258
2023-08-10T15:23:18Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Infobox/styles.css]]
sanitized-css
text/css
/* {{pp|small=y}} */
/*
* This TemplateStyles sheet deliberately does NOT include the full set of
* infobox styles. We are still working to migrate all of the manual
* infoboxes. See [[MediaWiki talk:Common.css/to do#Infobox]]
* DO NOT ADD THEM HERE
*/
/*
* not strictly certain these styles are necessary since the modules now
* exclusively output infobox-subbox or infobox, not both
* just replicating the module faithfully
*/
.infobox-subbox {
padding: 0;
border: none;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
}
.infobox-3cols-child {
margin: auto;
}
.infobox .navbar {
font-size: 100%;
}
/* T281642 */
body.skin-minerva .infobox-header,
body.skin-minerva .infobox-subheader,
body.skin-minerva .infobox-above,
body.skin-minerva .infobox-title,
body.skin-minerva .infobox-image,
body.skin-minerva .infobox-full-data,
body.skin-minerva .infobox-below {
text-align: center;
}
e8de6d96f4fde53afc4a6b0fed534405ab59b0a7
Module:Separated entries
828
126
261
260
2023-08-10T15:23:19Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Separated_entries]]
Scribunto
text/plain
-- This module takes positional parameters as input and concatenates them with
-- an optional separator. The final separator (the "conjunction") can be
-- specified independently, enabling natural-language lists like
-- "foo, bar, baz and qux". The starting parameter can also be specified.
local compressSparseArray = require('Module:TableTools').compressSparseArray
local p = {}
function p._main(args)
local separator = args.separator
-- Decode (convert to Unicode) HTML escape sequences, such as " " for space.
and mw.text.decode(args.separator) or ''
local conjunction = args.conjunction and mw.text.decode(args.conjunction) or separator
-- Discard values before the starting parameter.
local start = tonumber(args.start)
if start then
for i = 1, start - 1 do args[i] = nil end
end
-- Discard named parameters.
local values = compressSparseArray(args)
return mw.text.listToText(values, separator, conjunction)
end
local function makeInvokeFunction(separator, conjunction, first)
return function (frame)
local args = require('Module:Arguments').getArgs(frame)
args.separator = separator or args.separator
args.conjunction = conjunction or args.conjunction
args.first = first or args.first
return p._main(args)
end
end
p.main = makeInvokeFunction()
p.br = makeInvokeFunction('<br />')
p.comma = makeInvokeFunction(mw.message.new('comma-separator'):plain())
return p
e80231ff3de01afd7f62a94e0a34dc1e67504085
Template:Cite web
10
127
263
262
2023-08-10T15:23:19Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Cite_web]]
wikitext
text/x-wiki
<includeonly>{{#invoke:citation/CS1|citation
|CitationClass=web
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
ea1b0f38afd9728a1cf9f2e3f540887a402fab8e
Module:Plain text
828
128
265
264
2023-08-10T15:23:19Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Plain_text]]
Scribunto
text/plain
--converts text with wikilinks to plain text, e.g "[[foo|gah]] is [[bar]]" to "gah is bar"
--removes anything enclosed in tags that isn't nested, mediawiki strip markers (references etc), files, italic and bold markup
require[[strict]]
local p = {}
function p.main(frame)
local text = frame.args[1]
local encode = require('Module:yesno')(frame.args.encode)
return p._main(text, encode)
end
function p._main(text, encode)
if not text then return end
text = mw.text.killMarkers(text)
:gsub(' ', ' ') --replace nbsp spaces with regular spaces
:gsub('<br ?/?>', ', ') --replace br with commas
:gsub('<span.->(.-)</span>', '%1') --remove spans while keeping text inside
:gsub('<i.->(.-)</i>', '%1') --remove italics while keeping text inside
:gsub('<b.->(.-)</b>', '%1') --remove bold while keeping text inside
:gsub('<em.->(.-)</em>', '%1') --remove emphasis while keeping text inside
:gsub('<strong.->(.-)</strong>', '%1') --remove strong while keeping text inside
:gsub('<sub.->(.-)</sub>', '%1') --remove subscript markup; retain contents
:gsub('<sup.->(.-)</sup>', '%1') --remove superscript markup; retain contents
:gsub('<u.->(.-)</u>', '%1') --remove underline markup; retain contents
:gsub('<.->.-<.->', '') --strip out remaining tags and the text inside
:gsub('<.->', '') --remove any other tag markup
:gsub('%[%[%s*[Ff][Ii][Ll][Ee]%s*:.-%]%]', '') --strip out files
:gsub('%[%[%s*[Ii][Mm][Aa][Gg][Ee]%s*:.-%]%]', '') --strip out use of image:
:gsub('%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:.-%]%]', '') --strip out categories
:gsub('%[%[[^%]]-|', '') --strip out piped link text
:gsub('([^%[])%[[^%[%]][^%]]-%s', '%1') --strip out external link text
:gsub('^%[[^%[%]][^%]]-%s', '') --strip out external link text
:gsub('[%[%]]', '') --then strip out remaining [ and ]
:gsub("'''''", "") --strip out bold italic markup
:gsub("'''?", "") --not stripping out '''' gives correct output for bolded text in quotes
:gsub('----+', '') --remove ---- lines
:gsub("^%s+", "") --strip leading
:gsub("%s+$", "") --and trailing spaces
:gsub("%s+", " ") --strip redundant spaces
if encode then
return mw.text.encode(text)
else
return text
end
end
return p
8d406c43e8cf1dadf34be7d3b395f44ba4c48b75
Template:Infobox
10
129
267
266
2023-08-10T15:23:20Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Infobox]]
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
</noinclude>
817a9f5b6524eced06a57bd1d5fd7179f9369bf2
Template:Clear
10
130
269
268
2023-08-10T15:23:21Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Clear]]
wikitext
text/x-wiki
<div style="clear:{{{1|both}}};"></div><noinclude>
{{documentation}}
</noinclude>
38bab3e3d7fbd3d6800d46556e60bc6bac494d72
Template:If empty
10
131
271
270
2023-08-10T15:23:22Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:If_empty]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:If empty|main}}<noinclude>{{Documentation}}</noinclude>
745940b7bdde8a1585c887ee4ee5ce81d98461a4
Module:If empty
828
132
273
272
2023-08-10T15:23:22Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:If_empty]]
Scribunto
text/plain
local p = {}
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})
for k,v in ipairs(args) do
if v ~= '' then
return v
end
end
end
return p
4790391408957dea3ff9f453834c05f6b379a45c
Module:Age
828
133
275
274
2023-08-10T15:23:23Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Age]]
Scribunto
text/plain
-- Implement various "age of" and other date-related templates.
local mtext = {
-- Message and other text that should be localized.
-- Also need to localize text in table names in function dateDifference.
['mt-bad-param1'] = 'Invalid parameter $1',
['mt-bad-param2'] = 'Parameter $1=$2 is invalid',
['mt-bad-show'] = 'Parameter show=$1 is not supported here',
['mt-cannot-add'] = 'Cannot add "$1"',
['mt-conflicting-show'] = 'Parameter show=$1 conflicts with round=$2',
['mt-date-wrong-order'] = 'The second date must be later in time than the first date',
['mt-dd-future'] = 'Death date (first date) must not be in the future',
['mt-dd-wrong-order'] = 'Death date (first date) must be later in time than the birth date (second date)',
['mt-invalid-bd-age'] = 'Invalid birth date for calculating age',
['mt-invalid-dates-age'] = 'Invalid dates for calculating age',
['mt-invalid-end'] = 'Invalid end date in second parameter',
['mt-invalid-start'] = 'Invalid start date in first parameter',
['mt-need-jdn'] = 'Need valid Julian date number',
['mt-need-valid-bd'] = 'Need valid birth date: year, month, day',
['mt-need-valid-bd2'] = 'Need valid birth date (second date): year, month, day',
['mt-need-valid-date'] = 'Need valid date',
['mt-need-valid-dd'] = 'Need valid death date (first date): year, month, day',
['mt-need-valid-ymd'] = 'Need valid year, month, day',
['mt-need-valid-ymd-current'] = 'Need valid year|month|day or "currentdate"',
['mt-need-valid-ymd2'] = 'Second date should be year, month, day',
['mt-template-bad-name'] = 'The specified template name is not valid',
['mt-template-x'] = 'The template invoking this must have "|template=x" where x is the wanted operation',
['txt-and'] = ' and ',
['txt-or'] = ' or ',
['txt-category'] = 'Category:Age error',
['txt-comma-and'] = ', and ',
['txt-error'] = 'Error: ',
['txt-format-default'] = 'mf', -- 'df' (day first = dmy) or 'mf' (month first = mdy)
['txt-module-convertnumeric'] = 'Module:ConvertNumeric',
['txt-module-date'] = 'Module:Date',
['txt-sandbox'] = 'sandbox',
['txt-bda'] = '<span style="display:none"> (<span class="bday">$1</span>) </span>$2<span class="noprint ForceAgeToShow"> (age $3)</span>',
['txt-dda'] = '$2<span style="display:none">($1)</span> (aged $3)',
['txt-bda-disp'] = 'disp_raw', -- disp_raw → age is a number only; disp_age → age is a number and unit (normally years but months or days if very young)
['txt-dda-disp'] = 'disp_raw',
['txt-dmy'] = '%-d %B %-Y',
['txt-mdy'] = '%B %-d, %-Y',
}
local isWarning = {
['mt-bad-param1'] = true,
}
local translate, from_en, to_en, isZero
if translate then
-- Functions to translate from en to local language and reverse go here.
-- See example at [[:bn:Module:বয়স]].
else
from_en = function (text)
return text
end
isZero = function (text)
return tonumber(text) == 0
end
end
local _Date, _currentDate
local function getExports(frame)
-- Return objects exported from the date module or its sandbox.
if not _Date then
local sandbox = frame:getTitle():find(mtext['txt-sandbox'], 1, true) and ('/' .. mtext['txt-sandbox']) or ''
local datemod = require(mtext['txt-module-date'] .. sandbox)
local realDate = datemod._Date
_currentDate = datemod._current
if to_en then
_Date = function (...)
local args = {}
for i, v in ipairs({...}) do
args[i] = to_en(v)
end
return realDate(unpack(args))
end
else
_Date = realDate
end
end
return _Date, _currentDate
end
local Collection -- a table to hold items
Collection = {
add = function (self, item)
if item ~= nil then
self.n = self.n + 1
self[self.n] = item
end
end,
join = function (self, sep)
return table.concat(self, sep)
end,
remove = function (self, pos)
if self.n > 0 and (pos == nil or (0 < pos and pos <= self.n)) then
self.n = self.n - 1
return table.remove(self, pos)
end
end,
sort = function (self, comp)
table.sort(self, comp)
end,
new = function ()
return setmetatable({n = 0}, Collection)
end
}
Collection.__index = Collection
local function stripToNil(text)
-- If text is a string, return its trimmed content, or nil if empty.
-- Otherwise return text (which may, for example, be nil).
if type(text) == 'string' then
text = text:match('(%S.-)%s*$')
end
return text
end
local function dateFormat(args)
-- Return string for wanted date format.
local default = mtext['txt-format-default']
local other = default == 'df' and 'mf' or 'df'
local wanted = stripToNil(args[other]) and other or default
return wanted == 'df' and mtext['txt-dmy'] or mtext['txt-mdy']
end
local function substituteParameters(text, ...)
-- Return text after substituting any given parameters for $1, $2, etc.
return mw.message.newRawMessage(text, ...):plain()
end
local function yes(parameter)
-- Return true if parameter should be interpreted as "yes".
-- Do not want to accept mixed upper/lowercase unless done by current templates.
-- Need to accept "on" because "round=on" is wanted.
return ({ y = true, yes = true, on = true })[parameter]
end
local function message(msg, ...)
-- Return formatted message text for an error or warning.
local function getText(msg)
return mtext[msg] or error('Bug: message "' .. tostring(msg) .. '" not defined')
end
local categories = {
error = mtext['txt-category'],
warning = mtext['txt-category'],
}
local a, b, k, category
local text = substituteParameters(getText(msg), ...)
if isWarning[msg] then
a = '<sup>[<i>'
b = '</i>]</sup>'
k = 'warning'
else
a = '<strong class="error">' .. getText('txt-error')
b = '</strong>'
k = 'error'
end
if mw.title.getCurrentTitle():inNamespaces(0) then
-- Category only in namespaces: 0=article.
category = '[[' .. categories[k] .. ']]'
end
return
a ..
mw.text.nowiki(text) ..
b ..
(category or '')
end
local function formatNumber(number)
-- Return the given number formatted with commas as group separators,
-- given that the number is an integer.
local numstr = tostring(number)
local length = #numstr
local places = Collection.new()
local pos = 0
repeat
places:add(pos)
pos = pos + 3
until pos >= length
places:add(length)
local groups = Collection.new()
for i = places.n, 2, -1 do
local p1 = length - places[i] + 1
local p2 = length - places[i - 1]
groups:add(numstr:sub(p1, p2))
end
return groups:join(',')
end
local function spellNumber(number, options, i)
-- Return result of spelling number, or
-- return number (as a string) if cannot spell it.
-- i == 1 for the first number which can optionally start with an uppercase letter.
number = tostring(number)
return require(mtext['txt-module-convertnumeric']).spell_number(
number,
nil, -- fraction numerator
nil, -- fraction denominator
i == 1 and options.upper, -- true: 'One' instead of 'one'
not options.us, -- true: use 'and' between tens/ones etc
options.adj, -- true: hyphenated
options.ordinal -- true: 'first' instead of 'one'
) or number
end
local function makeExtra(args, flagCurrent)
-- Return extra text that will be inserted before the visible result
-- but after any sort key.
local extra = args.prefix or ''
if mw.ustring.len(extra) > 1 then
-- Parameter "~" gives "~3" whereas "over" gives "over 3".
if extra:sub(-6, -1) ~= ' ' then
extra = extra .. ' '
end
end
if flagCurrent then
extra = '<span class="currentage"></span>' .. extra
end
return extra
end
local function makeSort(value, sortable)
-- Return a sort key if requested.
-- Assume value is a valid number which has not overflowed.
if sortable == 'sortable_table' or sortable == 'sortable_on' or sortable == 'sortable_debug' then
local sortKey
if value == 0 then
sortKey = '5000000000000000000'
else
local mag = math.floor(math.log10(math.abs(value)) + 1e-14)
if value > 0 then
sortKey = 7000 + mag
else
sortKey = 2999 - mag
value = value + 10^(mag+1)
end
sortKey = string.format('%d', sortKey) .. string.format('%015.0f', math.floor(value * 10^(14-mag)))
end
local result
if sortable == 'sortable_table' then
result = 'data-sort-value="_SORTKEY_"|'
elseif sortable == 'sortable_debug' then
result = '<span data-sort-value="_SORTKEY_♠"><span style="border:1px solid">_SORTKEY_♠</span></span>'
else
result = '<span data-sort-value="_SORTKEY_♠"></span>'
end
return (result:gsub('_SORTKEY_', sortKey))
end
end
local translateParameters = {
abbr = {
off = 'abbr_off',
on = 'abbr_on',
},
disp = {
age = 'disp_age',
raw = 'disp_raw',
},
format = {
raw = 'format_raw',
commas = 'format_commas',
},
round = {
on = 'on',
yes = 'on',
months = 'ym',
weeks = 'ymw',
days = 'ymd',
hours = 'ymdh',
},
sep = {
comma = 'sep_comma',
[','] = 'sep_comma',
serialcomma = 'sep_serialcomma',
space = 'sep_space',
},
show = {
hide = { id = 'hide' },
y = { 'y', id = 'y' },
ym = { 'y', 'm', id = 'ym' },
ymd = { 'y', 'm', 'd', id = 'ymd' },
ymw = { 'y', 'm', 'w', id = 'ymw' },
ymwd = { 'y', 'm', 'w', 'd', id = 'ymwd' },
yd = { 'y', 'd', id = 'yd', keepZero = true },
m = { 'm', id = 'm' },
md = { 'm', 'd', id = 'md' },
w = { 'w', id = 'w' },
wd = { 'w', 'd', id = 'wd' },
h = { 'H', id = 'h' },
hm = { 'H', 'M', id = 'hm' },
hms = { 'H', 'M', 'S', id = 'hms' },
M = { 'M', id = 'M' },
s = { 'S', id = 's' },
d = { 'd', id = 'd' },
dh = { 'd', 'H', id = 'dh' },
dhm = { 'd', 'H', 'M', id = 'dhm' },
dhms = { 'd', 'H', 'M', 'S', id = 'dhms' },
ymdh = { 'y', 'm', 'd', 'H', id = 'ymdh' },
ymdhm = { 'y', 'm', 'd', 'H', 'M', id = 'ymdhm' },
ymwdh = { 'y', 'm', 'w', 'd', 'H', id = 'ymwdh' },
ymwdhm = { 'y', 'm', 'w', 'd', 'H', 'M', id = 'ymwdhm' },
},
sortable = {
off = false,
on = 'sortable_on',
table = 'sortable_table',
debug = 'sortable_debug',
},
}
local spellOptions = {
cardinal = {},
Cardinal = { upper = true },
cardinal_us = { us = true },
Cardinal_us = { us = true, upper = true },
ordinal = { ordinal = true },
Ordinal = { ordinal = true, upper = true },
ordinal_us = { ordinal = true, us = true },
Ordinal_us = { ordinal = true, us = true, upper = true },
}
local function dateExtract(frame)
-- Return part of a date after performing an optional operation.
local Date = getExports(frame)
local args = frame:getParent().args
local parms = {}
for i, v in ipairs(args) do
parms[i] = v
end
if yes(args.fix) then
table.insert(parms, 'fix')
end
if yes(args.partial) then
table.insert(parms, 'partial')
end
local show = stripToNil(args.show) or 'dmy'
local date = Date(unpack(parms))
if not date then
if show == 'format' then
return 'error'
end
return message('mt-need-valid-date')
end
local add = stripToNil(args.add)
if add then
for item in add:gmatch('%S+') do
date = date + item
if not date then
return message('mt-cannot-add', item)
end
end
end
local sortKey, result
local sortable = translateParameters.sortable[args.sortable]
if sortable then
local value = (date.partial and date.partial.first or date).jdz
sortKey = makeSort(value, sortable)
end
if show ~= 'hide' then
result = date[show]
if result == nil then
result = from_en(date:text(show))
elseif type(result) == 'boolean' then
result = result and '1' or '0'
else
result = from_en(tostring(result))
end
end
return (sortKey or '') .. makeExtra(args) .. (result or '')
end
local function rangeJoin(range)
-- Return text to be used between a range of ages.
return range == 'dash' and '–' or mtext['txt-or']
end
local function makeText(values, components, names, options, noUpper)
-- Return wikitext representing an age or duration.
local text = Collection.new()
local count = #values
local sep = names.sep or ''
for i, v in ipairs(values) do
-- v is a number (say 4 for 4 years), or a table ({4,5} for 4 or 5 years).
local islist = type(v) == 'table'
if (islist or v > 0) or (text.n == 0 and i == count) or (text.n > 0 and components.keepZero) then
local fmt, vstr
if options.spell then
fmt = function(number)
return spellNumber(number, options.spell, noUpper or i)
end
elseif i == 1 and options.format == 'format_commas' then
-- Numbers after the first should be small and not need formatting.
fmt = formatNumber
else
fmt = tostring
end
if islist then
vstr = fmt(v[1]) .. rangeJoin(options.range)
noUpper = true
vstr = vstr .. fmt(v[2])
else
vstr = fmt(v)
end
local name = names[components[i]]
if name then
if type(name) == 'table' then
name = mw.getContentLanguage():plural(islist and v[2] or v, name)
end
text:add(vstr .. sep .. name)
else
text:add(vstr)
end
end
end
local first, last
if options.join == 'sep_space' then
first = ' '
last = ' '
elseif options.join == 'sep_comma' then
first = ', '
last = ', '
elseif options.join == 'sep_serialcomma' and text.n > 2 then
first = ', '
last = mtext['txt-comma-and']
else
first = ', '
last = mtext['txt-and']
end
for i, v in ipairs(text) do
if i < text.n then
text[i] = v .. (i + 1 < text.n and first or last)
end
end
local sign = ''
if options.isnegative then
-- Do not display negative zero.
if text.n > 1 or (text.n == 1 and text[1]:sub(1, 1) ~= '0' ) then
if options.format == 'format_raw' then
sign = '-' -- plain hyphen so result can be used in a calculation
else
sign = '−' -- Unicode U+2212 MINUS SIGN
end
end
end
return
(options.sortKey or '') ..
(options.extra or '') ..
sign ..
text:join() ..
(options.suffix or '')
end
local function dateDifference(parms)
-- Return a formatted date difference using the given parameters
-- which have been validated.
local names = {
-- Each name is:
-- * a string if no plural form of the name is used; or
-- * a table of strings, one of which is selected using the rules at
-- https://translatewiki.net/wiki/Plural/Mediawiki_plural_rules
abbr_off = {
sep = ' ',
y = {'year', 'years'},
m = {'month', 'months'},
w = {'week', 'weeks'},
d = {'day', 'days'},
H = {'hour', 'hours'},
M = {'minute', 'minutes'},
S = {'second', 'seconds'},
},
abbr_on = {
y = 'y',
m = 'm',
w = 'w',
d = 'd',
H = 'h',
M = 'm',
S = 's',
},
abbr_infant = { -- for {{age for infant}}
sep = ' ',
y = {'yr', 'yrs'},
m = {'mo', 'mos'},
w = {'wk', 'wks'},
d = {'day', 'days'},
H = {'hr', 'hrs'},
M = {'min', 'mins'},
S = {'sec', 'secs'},
},
abbr_raw = {},
}
local diff = parms.diff -- must be a valid date difference
local show = parms.show -- may be nil; default is set below
local abbr = parms.abbr or 'abbr_off'
local defaultJoin
if abbr ~= 'abbr_off' then
defaultJoin = 'sep_space'
end
if not show then
show = 'ymd'
if parms.disp == 'disp_age' then
if diff.years < 3 then
defaultJoin = 'sep_space'
if diff.years >= 1 then
show = 'ym'
else
show = 'md'
end
else
show = 'y'
end
end
end
if type(show) ~= 'table' then
show = translateParameters.show[show]
end
if parms.disp == 'disp_raw' then
defaultJoin = 'sep_space'
abbr = 'abbr_raw'
elseif parms.wantSc then
defaultJoin = 'sep_serialcomma'
end
local diffOptions = {
round = parms.round,
duration = parms.wantDuration,
range = parms.range and true or nil,
}
local sortKey
if parms.sortable then
local value = diff.age_days + (parms.wantDuration and 1 or 0) -- days and fraction of a day
if diff.isnegative then
value = -value
end
sortKey = makeSort(value, parms.sortable)
end
local textOptions = {
extra = parms.extra,
format = parms.format,
join = parms.sep or defaultJoin,
isnegative = diff.isnegative,
range = parms.range,
sortKey = sortKey,
spell = parms.spell,
suffix = parms.suffix, -- not currently used
}
if show.id == 'hide' then
return sortKey or ''
end
local values = { diff:age(show.id, diffOptions) }
if values[1] then
return makeText(values, show, names[abbr], textOptions)
end
if diff.partial then
-- Handle a more complex range such as
-- {{age_yd|20 Dec 2001|2003|range=yes}} → 1 year, 12 days or 2 years, 11 days
local opt = {
format = textOptions.format,
join = textOptions.join,
isnegative = textOptions.isnegative,
spell = textOptions.spell,
}
return
(textOptions.sortKey or '') ..
makeText({ diff.partial.mindiff:age(show.id, diffOptions) }, show, names[abbr], opt) ..
rangeJoin(textOptions.range) ..
makeText({ diff.partial.maxdiff:age(show.id, diffOptions) }, show, names[abbr], opt, true) ..
(textOptions.suffix or '')
end
return message('mt-bad-show', show.id)
end
local function getDates(frame, getopt)
-- Parse template parameters and return one of:
-- * date (a date table, if single)
-- * date1, date2 (two date tables, if not single)
-- * text (a string error message)
-- A missing date is optionally replaced with the current date.
-- If wantMixture is true, a missing date component is replaced
-- from the current date, so can get a bizarre mixture of
-- specified/current y/m/d as has been done by some "age" templates.
-- Some results may be placed in table getopt.
local Date, currentDate = getExports(frame)
getopt = getopt or {}
local function flagCurrent(text)
-- This allows the calling template to detect if the current date has been used,
-- that is, whether both dates have been entered in a template expecting two.
-- For example, an infobox may want the age when an event occurred, not the current age.
-- Don't bother detecting if wantMixture is used because not needed and it is a poor option.
if not text then
if getopt.noMissing then
return nil -- this gives a nil date which gives an error
end
text = 'currentdate'
if getopt.flag == 'usesCurrent' then
getopt.usesCurrent = true
end
end
return text
end
local args = frame:getParent().args
local fields = {}
local isNamed = args.year or args.year1 or args.year2 or
args.month or args.month1 or args.month2 or
args.day or args.day1 or args.day2
if isNamed then
fields[1] = args.year1 or args.year
fields[2] = args.month1 or args.month
fields[3] = args.day1 or args.day
fields[4] = args.year2
fields[5] = args.month2
fields[6] = args.day2
else
for i = 1, 6 do
fields[i] = args[i]
end
end
local imax = 0
for i = 1, 6 do
fields[i] = stripToNil(fields[i])
if fields[i] then
imax = i
end
if getopt.omitZero and i % 3 ~= 1 then -- omit zero months and days as unknown values but keep year 0 which is 1 BCE
if isZero(fields[i]) then
fields[i] = nil
getopt.partial = true
end
end
end
local fix = getopt.fix and 'fix' or ''
local partialText = getopt.partial and 'partial' or ''
local dates = {}
if isNamed or imax >= 3 then
local nrDates = getopt.single and 1 or 2
if getopt.wantMixture then
-- Cannot be partial since empty fields are set from current.
local components = { 'year', 'month', 'day' }
for i = 1, nrDates * 3 do
fields[i] = fields[i] or currentDate[components[i > 3 and i - 3 or i]]
end
for i = 1, nrDates do
local index = i == 1 and 1 or 4
local y, m, d = fields[index], fields[index+1], fields[index+2]
if (m == 2 or m == '2') and (d == 29 or d == '29') then
-- Workaround error with following which attempt to use invalid date 2001-02-29.
-- {{age_ymwd|year1=2001|year2=2004|month2=2|day2=29}}
-- {{age_ymwd|year1=2001|month1=2|year2=2004|month2=1|day2=29}}
-- TODO Get rid of wantMixture because even this ugly code does not handle
-- 'Feb' or 'February' or 'feb' or 'february'.
if not ((y % 4 == 0 and y % 100 ~= 0) or y % 400 == 0) then
d = 28
end
end
dates[i] = Date(y, m, d)
end
else
-- If partial dates are allowed, accept
-- year only, or
-- year and month only
-- Do not accept year and day without a month because that makes no sense
-- (and because, for example, Date('partial', 2001, nil, 12) sets day = nil, not 12).
for i = 1, nrDates do
local index = i == 1 and 1 or 4
local y, m, d = fields[index], fields[index+1], fields[index+2]
if (getopt.partial and y and (m or not d)) or (y and m and d) then
dates[i] = Date(fix, partialText, y, m, d)
elseif not y and not m and not d then
dates[i] = Date(flagCurrent())
end
end
end
else
getopt.textdates = true -- have parsed each date from a single text field
dates[1] = Date(fix, partialText, flagCurrent(fields[1]))
if not getopt.single then
dates[2] = Date(fix, partialText, flagCurrent(fields[2]))
end
end
if not dates[1] then
return message(getopt.missing1 or 'mt-need-valid-ymd')
end
if getopt.single then
return dates[1]
end
if not dates[2] then
return message(getopt.missing2 or 'mt-need-valid-ymd2')
end
return dates[1], dates[2]
end
local function ageGeneric(frame)
-- Return the result required by the specified template.
-- Can use sortable=x where x = on/table/off/debug in any supported template.
-- Some templates default to sortable=on but can be overridden.
local name = frame.args.template
if not name then
return message('mt-template-x')
end
local args = frame:getParent().args
local specs = {
age_days = { -- {{age in days}}
show = 'd',
disp = 'disp_raw',
},
age_days_nts = { -- {{age in days nts}}
show = 'd',
disp = 'disp_raw',
format = 'format_commas',
sortable = 'on',
},
duration_days = { -- {{duration in days}}
show = 'd',
disp = 'disp_raw',
duration = true,
},
duration_days_nts = { -- {{duration in days nts}}
show = 'd',
disp = 'disp_raw',
format = 'format_commas',
sortable = 'on',
duration = true,
},
age_full_years = { -- {{age}}
show = 'y',
abbr = 'abbr_raw',
flag = 'usesCurrent',
omitZero = true,
range = 'dash',
},
age_full_years_nts = { -- {{age nts}}
show = 'y',
abbr = 'abbr_raw',
format = 'format_commas',
sortable = 'on',
},
age_in_years = { -- {{age in years}}
show = 'y',
abbr = 'abbr_raw',
negative = 'error',
range = 'dash',
},
age_in_years_nts = { -- {{age in years nts}}
show = 'y',
abbr = 'abbr_raw',
negative = 'error',
range = 'dash',
format = 'format_commas',
sortable = 'on',
},
age_infant = { -- {{age for infant}}
-- Do not set show because special processing is done later.
abbr = yes(args.abbr) and 'abbr_infant' or 'abbr_off',
disp = 'disp_age',
sep = 'sep_space',
sortable = 'on',
},
age_m = { -- {{age in months}}
show = 'm',
disp = 'disp_raw',
},
age_w = { -- {{age in weeks}}
show = 'w',
disp = 'disp_raw',
},
age_wd = { -- {{age in weeks and days}}
show = 'wd',
},
age_yd = { -- {{age in years and days}}
show = 'yd',
format = 'format_commas',
sep = args.sep ~= 'and' and 'sep_comma' or nil,
},
age_yd_nts = { -- {{age in years and days nts}}
show = 'yd',
format = 'format_commas',
sep = args.sep ~= 'and' and 'sep_comma' or nil,
sortable = 'on',
},
age_ym = { -- {{age in years and months}}
show = 'ym',
sep = 'sep_comma',
},
age_ymd = { -- {{age in years, months and days}}
show = 'ymd',
range = true,
},
age_ymwd = { -- {{age in years, months, weeks and days}}
show = 'ymwd',
wantMixture = true,
},
}
local spec = specs[name]
if not spec then
return message('mt-template-bad-name')
end
if name == 'age_days' then
local su = stripToNil(args['show unit'])
if su then
if su == 'abbr' or su == 'full' then
spec.disp = nil
spec.abbr = su == 'abbr' and 'abbr_on' or nil
end
end
end
local partial, autofill
local range = stripToNil(args.range) or spec.range
if range then
-- Suppose partial dates are used and age could be 11 or 12 years.
-- "|range=" (empty value) has no effect (spec is used).
-- "|range=yes" or spec.range == true sets range = true (gives "11 or 12")
-- "|range=dash" or spec.range == 'dash' sets range = 'dash' (gives "11–12").
-- "|range=no" or spec.range == 'no' sets range = nil and fills each date in the diff (gives "12").
-- ("on" is equivalent to "yes", and "off" is equivalent to "no").
-- "|range=OTHER" sets range = nil and rejects partial dates.
range = ({ dash = 'dash', off = 'no', no = 'no', [true] = true })[range] or yes(range)
if range then
partial = true -- accept partial dates with a possible age range for the result
if range == 'no' then
autofill = true -- missing month/day in first or second date are filled from other date or 1
range = nil
end
end
end
local getopt = {
fix = yes(args.fix),
flag = stripToNil(args.flag) or spec.flag,
omitZero = spec.omitZero,
partial = partial,
wantMixture = spec.wantMixture,
}
local date1, date2 = getDates(frame, getopt)
if type(date1) == 'string' then
return date1
end
local format = stripToNil(args.format)
local spell = spellOptions[format]
if format then
format = 'format_' .. format
elseif name == 'age_days' and getopt.textdates then
format = 'format_commas'
end
local parms = {
diff = date2:subtract(date1, { fill = autofill }),
wantDuration = spec.duration or yes(args.duration),
range = range,
wantSc = yes(args.sc),
show = args.show == 'hide' and 'hide' or spec.show,
abbr = spec.abbr,
disp = spec.disp,
extra = makeExtra(args, getopt.usesCurrent and format ~= 'format_raw'),
format = format or spec.format,
round = yes(args.round),
sep = spec.sep,
sortable = translateParameters.sortable[args.sortable or spec.sortable],
spell = spell,
}
if (spec.negative or frame.args.negative) == 'error' and parms.diff.isnegative then
return message('mt-date-wrong-order')
end
return from_en(dateDifference(parms))
end
local function bda(frame)
-- Implement [[Template:Birth date and age]].
local args = frame:getParent().args
local options = {
missing1 = 'mt-need-valid-bd',
noMissing = true,
single = true,
}
local date = getDates(frame, options)
if type(date) == 'string' then
return date -- error text
end
local Date = getExports(frame)
local diff = Date('currentdate') - date
if diff.isnegative or diff.years > 150 then
return message('mt-invalid-bd-age')
end
local disp = mtext['txt-bda-disp']
local show = 'y'
if diff.years < 2 then
disp = 'disp_age'
if diff.years == 0 and diff.months == 0 then
show = 'd'
else
show = 'm'
end
end
local result = substituteParameters(
mtext['txt-bda'],
date:text('%-Y-%m-%d'),
from_en(date:text(dateFormat(args))),
from_en(dateDifference({
diff = diff,
show = show,
abbr = 'abbr_off',
disp = disp,
sep = 'sep_space',
}))
)
local warnings = tonumber(frame.args.warnings)
if warnings and warnings > 0 then
local good = {
df = true,
mf = true,
day = true,
day1 = true,
month = true,
month1 = true,
year = true,
year1 = true,
}
local invalid
local imax = options.textdates and 1 or 3
for k, _ in pairs(args) do
if type(k) == 'number' then
if k > imax then
invalid = tostring(k)
break
end
else
if not good[k] then
invalid = k
break
end
end
end
if invalid then
result = result .. message('mt-bad-param1', invalid)
end
end
return result
end
local function dda(frame)
-- Implement [[Template:Death date and age]].
local args = frame:getParent().args
local options = {
missing1 = 'mt-need-valid-dd',
missing2 = 'mt-need-valid-bd2',
noMissing = true,
partial = true,
}
local date1, date2 = getDates(frame, options)
if type(date1) == 'string' then
return date1
end
local diff = date1 - date2
if diff.isnegative then
return message('mt-dd-wrong-order')
end
local Date = getExports(frame)
local today = Date('currentdate') + 1 -- one day in future allows for timezones
if date1 > today then
return message('mt-dd-future')
end
local years
if diff.partial then
years = diff.partial.years
years = type(years) == 'table' and years[2] or years
else
years = diff.years
end
if years > 150 then
return message('mt-invalid-dates-age')
end
local fmt_date, fmt_ymd
if date1.day then -- y, m, d known
fmt_date = dateFormat(args)
fmt_ymd = '%-Y-%m-%d'
elseif date1.month then -- y, m known; d unknown
fmt_date = '%B %-Y'
fmt_ymd = '%-Y-%m-00'
else -- y known; m, d unknown
fmt_date = '%-Y'
fmt_ymd = '%-Y-00-00'
end
local sortKey
local sortable = translateParameters.sortable[args.sortable]
if sortable then
local value = (date1.partial and date1.partial.first or date1).jdz
sortKey = makeSort(value, sortable)
end
local result = (sortKey or '') .. substituteParameters(
mtext['txt-dda'],
date1:text(fmt_ymd),
from_en(date1:text(fmt_date)),
from_en(dateDifference({
diff = diff,
show = 'y',
abbr = 'abbr_off',
disp = mtext['txt-dda-disp'],
range = 'dash',
sep = 'sep_space',
}))
)
local warnings = tonumber(frame.args.warnings)
if warnings and warnings > 0 then
local good = {
df = true,
mf = true,
}
local invalid
local imax = options.textdates and 2 or 6
for k, _ in pairs(args) do
if type(k) == 'number' then
if k > imax then
invalid = tostring(k)
break
end
else
if not good[k] then
invalid = k
break
end
end
end
if invalid then
result = result .. message('mt-bad-param1', invalid)
end
end
return result
end
local function dateToGsd(frame)
-- Implement [[Template:Gregorian serial date]].
-- Return Gregorian serial date of the given date, or the current date.
-- The returned value is negative for dates before 1 January 1 AD
-- despite the fact that GSD is not defined for such dates.
local date = getDates(frame, { wantMixture=true, single=true })
if type(date) == 'string' then
return date
end
return tostring(date.gsd)
end
local function jdToDate(frame)
-- Return formatted date from a Julian date.
-- The result includes a time if the input includes a fraction.
-- The word 'Julian' is accepted for the Julian calendar.
local Date = getExports(frame)
local args = frame:getParent().args
local date = Date('juliandate', args[1], args[2])
if date then
return from_en(date:text())
end
return message('mt-need-jdn')
end
local function dateToJd(frame)
-- Return Julian date (a number) from a date which may include a time,
-- or the current date ('currentdate') or current date and time ('currentdatetime').
-- The word 'Julian' is accepted for the Julian calendar.
local Date = getExports(frame)
local args = frame:getParent().args
local date = Date(args[1], args[2], args[3], args[4], args[5], args[6], args[7])
if date then
return tostring(date.jd)
end
return message('mt-need-valid-ymd-current')
end
local function timeInterval(frame)
-- Implement [[Template:Time interval]].
-- There are two positional arguments: date1, date2.
-- The default for each is the current date and time.
-- Result is date2 - date1 formatted.
local Date = getExports(frame)
local args = frame:getParent().args
local parms = {
extra = makeExtra(args),
wantDuration = yes(args.duration),
range = yes(args.range) or (args.range == 'dash' and 'dash' or nil),
wantSc = yes(args.sc),
}
local fix = yes(args.fix) and 'fix' or ''
local date1 = Date(fix, 'partial', stripToNil(args[1]) or 'currentdatetime')
if not date1 then
return message('mt-invalid-start')
end
local date2 = Date(fix, 'partial', stripToNil(args[2]) or 'currentdatetime')
if not date2 then
return message('mt-invalid-end')
end
parms.diff = date2 - date1
for argname, translate in pairs(translateParameters) do
local parm = stripToNil(args[argname])
if parm then
parm = translate[parm]
if parm == nil then -- test for nil because false is a valid setting
return message('mt-bad-param2', argname, args[argname])
end
parms[argname] = parm
end
end
if parms.round then
local round = parms.round
local show = parms.show
if round ~= 'on' then
if show then
if show.id ~= round then
return message('mt-conflicting-show', args.show, args.round)
end
else
parms.show = translateParameters.show[round]
end
end
parms.round = true
end
return from_en(dateDifference(parms))
end
return {
age_generic = ageGeneric, -- can emulate several age templates
birth_date_and_age = bda, -- Template:Birth_date_and_age
death_date_and_age = dda, -- Template:Death_date_and_age
gsd = dateToGsd, -- Template:Gregorian_serial_date
extract = dateExtract, -- Template:Extract
jd_to_date = jdToDate, -- Template:?
JULIANDAY = dateToJd, -- Template:JULIANDAY
time_interval = timeInterval, -- Template:Time_interval
}
094ef43a81ac2366c838b6ad889ed0ffe5a1eec4
Module:Date
828
134
277
276
2023-08-10T15:23:24Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Date]]
Scribunto
text/plain
-- Date functions for use by other modules.
-- I18N and time zones are not supported.
local MINUS = '−' -- Unicode U+2212 MINUS SIGN
local floor = math.floor
local Date, DateDiff, diffmt -- forward declarations
local uniq = { 'unique identifier' }
local function is_date(t)
-- The system used to make a date read-only means there is no unique
-- metatable that is conveniently accessible to check.
return type(t) == 'table' and t._id == uniq
end
local function is_diff(t)
return type(t) == 'table' and getmetatable(t) == diffmt
end
local function _list_join(list, sep)
return table.concat(list, sep)
end
local function collection()
-- Return a table to hold items.
return {
n = 0,
add = function (self, item)
self.n = self.n + 1
self[self.n] = item
end,
join = _list_join,
}
end
local function strip_to_nil(text)
-- If text is a string, return its trimmed content, or nil if empty.
-- Otherwise return text (convenient when Date fields are provided from
-- another module which may pass a string, a number, or another type).
if type(text) == 'string' then
text = text:match('(%S.-)%s*$')
end
return text
end
local function is_leap_year(year, calname)
-- Return true if year is a leap year.
if calname == 'Julian' then
return year % 4 == 0
end
return (year % 4 == 0 and year % 100 ~= 0) or year % 400 == 0
end
local function days_in_month(year, month, calname)
-- Return number of days (1..31) in given month (1..12).
if month == 2 and is_leap_year(year, calname) then
return 29
end
return ({ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 })[month]
end
local function h_m_s(time)
-- Return hour, minute, second extracted from fraction of a day.
time = floor(time * 24 * 3600 + 0.5) -- number of seconds
local second = time % 60
time = floor(time / 60)
return floor(time / 60), time % 60, second
end
local function hms(date)
-- Return fraction of a day from date's time, where (0 <= fraction < 1)
-- if the values are valid, but could be anything if outside range.
return (date.hour + (date.minute + date.second / 60) / 60) / 24
end
local function julian_date(date)
-- Return jd, jdz from a Julian or Gregorian calendar date where
-- jd = Julian date and its fractional part is zero at noon
-- jdz = same, but assume time is 00:00:00 if no time given
-- http://www.tondering.dk/claus/cal/julperiod.php#formula
-- Testing shows this works for all dates from year -9999 to 9999!
-- JDN 0 is the 24-hour period starting at noon UTC on Monday
-- 1 January 4713 BC = (-4712, 1, 1) Julian calendar
-- 24 November 4714 BC = (-4713, 11, 24) Gregorian calendar
local offset
local a = floor((14 - date.month)/12)
local y = date.year + 4800 - a
if date.calendar == 'Julian' then
offset = floor(y/4) - 32083
else
offset = floor(y/4) - floor(y/100) + floor(y/400) - 32045
end
local m = date.month + 12*a - 3
local jd = date.day + floor((153*m + 2)/5) + 365*y + offset
if date.hastime then
jd = jd + hms(date) - 0.5
return jd, jd
end
return jd, jd - 0.5
end
local function set_date_from_jd(date)
-- Set the fields of table date from its Julian date field.
-- Return true if date is valid.
-- http://www.tondering.dk/claus/cal/julperiod.php#formula
-- This handles the proleptic Julian and Gregorian calendars.
-- Negative Julian dates are not defined but they work.
local calname = date.calendar
local low, high -- min/max limits for date ranges −9999-01-01 to 9999-12-31
if calname == 'Gregorian' then
low, high = -1930999.5, 5373484.49999
elseif calname == 'Julian' then
low, high = -1931076.5, 5373557.49999
else
return
end
local jd = date.jd
if not (type(jd) == 'number' and low <= jd and jd <= high) then
return
end
local jdn = floor(jd)
if date.hastime then
local time = jd - jdn -- 0 <= time < 1
if time >= 0.5 then -- if at or after midnight of next day
jdn = jdn + 1
time = time - 0.5
else
time = time + 0.5
end
date.hour, date.minute, date.second = h_m_s(time)
else
date.second = 0
date.minute = 0
date.hour = 0
end
local b, c
if calname == 'Julian' then
b = 0
c = jdn + 32082
else -- Gregorian
local a = jdn + 32044
b = floor((4*a + 3)/146097)
c = a - floor(146097*b/4)
end
local d = floor((4*c + 3)/1461)
local e = c - floor(1461*d/4)
local m = floor((5*e + 2)/153)
date.day = e - floor((153*m + 2)/5) + 1
date.month = m + 3 - 12*floor(m/10)
date.year = 100*b + d - 4800 + floor(m/10)
return true
end
local function fix_numbers(numbers, y, m, d, H, M, S, partial, hastime, calendar)
-- Put the result of normalizing the given values in table numbers.
-- The result will have valid m, d values if y is valid; caller checks y.
-- The logic of PHP mktime is followed where m or d can be zero to mean
-- the previous unit, and -1 is the one before that, etc.
-- Positive values carry forward.
local date
if not (1 <= m and m <= 12) then
date = Date(y, 1, 1)
if not date then return end
date = date + ((m - 1) .. 'm')
y, m = date.year, date.month
end
local days_hms
if not partial then
if hastime and H and M and S then
if not (0 <= H and H <= 23 and
0 <= M and M <= 59 and
0 <= S and S <= 59) then
days_hms = hms({ hour = H, minute = M, second = S })
end
end
if days_hms or not (1 <= d and d <= days_in_month(y, m, calendar)) then
date = date or Date(y, m, 1)
if not date then return end
date = date + (d - 1 + (days_hms or 0))
y, m, d = date.year, date.month, date.day
if days_hms then
H, M, S = date.hour, date.minute, date.second
end
end
end
numbers.year = y
numbers.month = m
numbers.day = d
if days_hms then
-- Don't set H unless it was valid because a valid H will set hastime.
numbers.hour = H
numbers.minute = M
numbers.second = S
end
end
local function set_date_from_numbers(date, numbers, options)
-- Set the fields of table date from numeric values.
-- Return true if date is valid.
if type(numbers) ~= 'table' then
return
end
local y = numbers.year or date.year
local m = numbers.month or date.month
local d = numbers.day or date.day
local H = numbers.hour
local M = numbers.minute or date.minute or 0
local S = numbers.second or date.second or 0
local need_fix
if y and m and d then
date.partial = nil
if not (-9999 <= y and y <= 9999 and
1 <= m and m <= 12 and
1 <= d and d <= days_in_month(y, m, date.calendar)) then
if not date.want_fix then
return
end
need_fix = true
end
elseif y and date.partial then
if d or not (-9999 <= y and y <= 9999) then
return
end
if m and not (1 <= m and m <= 12) then
if not date.want_fix then
return
end
need_fix = true
end
else
return
end
if date.partial then
H = nil -- ignore any time
M = nil
S = nil
else
if H then
-- It is not possible to set M or S without also setting H.
date.hastime = true
else
H = 0
end
if not (0 <= H and H <= 23 and
0 <= M and M <= 59 and
0 <= S and S <= 59) then
if date.want_fix then
need_fix = true
else
return
end
end
end
date.want_fix = nil
if need_fix then
fix_numbers(numbers, y, m, d, H, M, S, date.partial, date.hastime, date.calendar)
return set_date_from_numbers(date, numbers, options)
end
date.year = y -- -9999 to 9999 ('n BC' → year = 1 - n)
date.month = m -- 1 to 12 (may be nil if partial)
date.day = d -- 1 to 31 (* = nil if partial)
date.hour = H -- 0 to 59 (*)
date.minute = M -- 0 to 59 (*)
date.second = S -- 0 to 59 (*)
if type(options) == 'table' then
for _, k in ipairs({ 'am', 'era', 'format' }) do
if options[k] then
date.options[k] = options[k]
end
end
end
return true
end
local function make_option_table(options1, options2)
-- If options1 is a string, return a table with its settings, or
-- if it is a table, use its settings.
-- Missing options are set from table options2 or defaults.
-- If a default is used, a flag is set so caller knows the value was not intentionally set.
-- Valid option settings are:
-- am: 'am', 'a.m.', 'AM', 'A.M.'
-- 'pm', 'p.m.', 'PM', 'P.M.' (each has same meaning as corresponding item above)
-- era: 'BCMINUS', 'BCNEGATIVE', 'BC', 'B.C.', 'BCE', 'B.C.E.', 'AD', 'A.D.', 'CE', 'C.E.'
-- Option am = 'am' does not mean the hour is AM; it means 'am' or 'pm' is used, depending on the hour,
-- and am = 'pm' has the same meaning.
-- Similarly, era = 'BC' means 'BC' is used if year <= 0.
-- BCMINUS displays a MINUS if year < 0 and the display format does not include %{era}.
-- BCNEGATIVE is similar but displays a hyphen.
local result = { bydefault = {} }
if type(options1) == 'table' then
result.am = options1.am
result.era = options1.era
elseif type(options1) == 'string' then
-- Example: 'am:AM era:BC' or 'am=AM era=BC'.
for item in options1:gmatch('%S+') do
local lhs, rhs = item:match('^(%w+)[:=](.+)$')
if lhs then
result[lhs] = rhs
end
end
end
options2 = type(options2) == 'table' and options2 or {}
local defaults = { am = 'am', era = 'BC' }
for k, v in pairs(defaults) do
if not result[k] then
if options2[k] then
result[k] = options2[k]
else
result[k] = v
result.bydefault[k] = true
end
end
end
return result
end
local ampm_options = {
-- lhs = input text accepted as an am/pm option
-- rhs = code used internally
['am'] = 'am',
['AM'] = 'AM',
['a.m.'] = 'a.m.',
['A.M.'] = 'A.M.',
['pm'] = 'am', -- same as am
['PM'] = 'AM',
['p.m.'] = 'a.m.',
['P.M.'] = 'A.M.',
}
local era_text = {
-- Text for displaying an era with a positive year (after adjusting
-- by replacing year with 1 - year if date.year <= 0).
-- options.era = { year<=0 , year>0 }
['BCMINUS'] = { 'BC' , '' , isbc = true, sign = MINUS },
['BCNEGATIVE'] = { 'BC' , '' , isbc = true, sign = '-' },
['BC'] = { 'BC' , '' , isbc = true },
['B.C.'] = { 'B.C.' , '' , isbc = true },
['BCE'] = { 'BCE' , '' , isbc = true },
['B.C.E.'] = { 'B.C.E.', '' , isbc = true },
['AD'] = { 'BC' , 'AD' },
['A.D.'] = { 'B.C.' , 'A.D.' },
['CE'] = { 'BCE' , 'CE' },
['C.E.'] = { 'B.C.E.', 'C.E.' },
}
local function get_era_for_year(era, year)
return (era_text[era] or era_text['BC'])[year > 0 and 2 or 1] or ''
end
local function strftime(date, format, options)
-- Return date formatted as a string using codes similar to those
-- in the C strftime library function.
local sformat = string.format
local shortcuts = {
['%c'] = '%-I:%M %p %-d %B %-Y %{era}', -- date and time: 2:30 pm 1 April 2016
['%x'] = '%-d %B %-Y %{era}', -- date: 1 April 2016
['%X'] = '%-I:%M %p', -- time: 2:30 pm
}
if shortcuts[format] then
format = shortcuts[format]
end
local codes = {
a = { field = 'dayabbr' },
A = { field = 'dayname' },
b = { field = 'monthabbr' },
B = { field = 'monthname' },
u = { fmt = '%d' , field = 'dowiso' },
w = { fmt = '%d' , field = 'dow' },
d = { fmt = '%02d', fmt2 = '%d', field = 'day' },
m = { fmt = '%02d', fmt2 = '%d', field = 'month' },
Y = { fmt = '%04d', fmt2 = '%d', field = 'year' },
H = { fmt = '%02d', fmt2 = '%d', field = 'hour' },
M = { fmt = '%02d', fmt2 = '%d', field = 'minute' },
S = { fmt = '%02d', fmt2 = '%d', field = 'second' },
j = { fmt = '%03d', fmt2 = '%d', field = 'dayofyear' },
I = { fmt = '%02d', fmt2 = '%d', field = 'hour', special = 'hour12' },
p = { field = 'hour', special = 'am' },
}
options = make_option_table(options, date.options)
local amopt = options.am
local eraopt = options.era
local function replace_code(spaces, modifier, id)
local code = codes[id]
if code then
local fmt = code.fmt
if modifier == '-' and code.fmt2 then
fmt = code.fmt2
end
local value = date[code.field]
if not value then
return nil -- an undefined field in a partial date
end
local special = code.special
if special then
if special == 'hour12' then
value = value % 12
value = value == 0 and 12 or value
elseif special == 'am' then
local ap = ({
['a.m.'] = { 'a.m.', 'p.m.' },
['AM'] = { 'AM', 'PM' },
['A.M.'] = { 'A.M.', 'P.M.' },
})[ampm_options[amopt]] or { 'am', 'pm' }
return (spaces == '' and '' or ' ') .. (value < 12 and ap[1] or ap[2])
end
end
if code.field == 'year' then
local sign = (era_text[eraopt] or {}).sign
if not sign or format:find('%{era}', 1, true) then
sign = ''
if value <= 0 then
value = 1 - value
end
else
if value >= 0 then
sign = ''
else
value = -value
end
end
return spaces .. sign .. sformat(fmt, value)
end
return spaces .. (fmt and sformat(fmt, value) or value)
end
end
local function replace_property(spaces, id)
if id == 'era' then
-- Special case so can use local era option.
local result = get_era_for_year(eraopt, date.year)
if result == '' then
return ''
end
return (spaces == '' and '' or ' ') .. result
end
local result = date[id]
if type(result) == 'string' then
return spaces .. result
end
if type(result) == 'number' then
return spaces .. tostring(result)
end
if type(result) == 'boolean' then
return spaces .. (result and '1' or '0')
end
-- This occurs if id is an undefined field in a partial date, or is the name of a function.
return nil
end
local PERCENT = '\127PERCENT\127'
return (format
:gsub('%%%%', PERCENT)
:gsub('(%s*)%%{(%w+)}', replace_property)
:gsub('(%s*)%%(%-?)(%a)', replace_code)
:gsub(PERCENT, '%%')
)
end
local function _date_text(date, fmt, options)
-- Return a formatted string representing the given date.
if not is_date(date) then
error('date:text: need a date (use "date:text()" with a colon)', 2)
end
if type(fmt) == 'string' and fmt:match('%S') then
if fmt:find('%', 1, true) then
return strftime(date, fmt, options)
end
elseif date.partial then
fmt = date.month and 'my' or 'y'
else
fmt = 'dmy'
if date.hastime then
fmt = (date.second > 0 and 'hms ' or 'hm ') .. fmt
end
end
local function bad_format()
-- For consistency with other format processing, return given format
-- (or cleaned format if original was not a string) if invalid.
return mw.text.nowiki(fmt)
end
if date.partial then
-- Ignore days in standard formats like 'ymd'.
if fmt == 'ym' or fmt == 'ymd' then
fmt = date.month and '%Y-%m %{era}' or '%Y %{era}'
elseif fmt == 'my' or fmt == 'dmy' or fmt == 'mdy' then
fmt = date.month and '%B %-Y %{era}' or '%-Y %{era}'
elseif fmt == 'y' then
fmt = date.month and '%-Y %{era}' or '%-Y %{era}'
else
return bad_format()
end
return strftime(date, fmt, options)
end
local function hm_fmt()
local plain = make_option_table(options, date.options).bydefault.am
return plain and '%H:%M' or '%-I:%M %p'
end
local need_time = date.hastime
local t = collection()
for item in fmt:gmatch('%S+') do
local f
if item == 'hm' then
f = hm_fmt()
need_time = false
elseif item == 'hms' then
f = '%H:%M:%S'
need_time = false
elseif item == 'ymd' then
f = '%Y-%m-%d %{era}'
elseif item == 'mdy' then
f = '%B %-d, %-Y %{era}'
elseif item == 'dmy' then
f = '%-d %B %-Y %{era}'
else
return bad_format()
end
t:add(f)
end
fmt = t:join(' ')
if need_time then
fmt = hm_fmt() .. ' ' .. fmt
end
return strftime(date, fmt, options)
end
local day_info = {
-- 0=Sun to 6=Sat
[0] = { 'Sun', 'Sunday' },
{ 'Mon', 'Monday' },
{ 'Tue', 'Tuesday' },
{ 'Wed', 'Wednesday' },
{ 'Thu', 'Thursday' },
{ 'Fri', 'Friday' },
{ 'Sat', 'Saturday' },
}
local month_info = {
-- 1=Jan to 12=Dec
{ 'Jan', 'January' },
{ 'Feb', 'February' },
{ 'Mar', 'March' },
{ 'Apr', 'April' },
{ 'May', 'May' },
{ 'Jun', 'June' },
{ 'Jul', 'July' },
{ 'Aug', 'August' },
{ 'Sep', 'September' },
{ 'Oct', 'October' },
{ 'Nov', 'November' },
{ 'Dec', 'December' },
}
local function name_to_number(text, translate)
if type(text) == 'string' then
return translate[text:lower()]
end
end
local function day_number(text)
return name_to_number(text, {
sun = 0, sunday = 0,
mon = 1, monday = 1,
tue = 2, tuesday = 2,
wed = 3, wednesday = 3,
thu = 4, thursday = 4,
fri = 5, friday = 5,
sat = 6, saturday = 6,
})
end
local function month_number(text)
return name_to_number(text, {
jan = 1, january = 1,
feb = 2, february = 2,
mar = 3, march = 3,
apr = 4, april = 4,
may = 5,
jun = 6, june = 6,
jul = 7, july = 7,
aug = 8, august = 8,
sep = 9, september = 9, sept = 9,
oct = 10, october = 10,
nov = 11, november = 11,
dec = 12, december = 12,
})
end
local function _list_text(list, fmt)
-- Return a list of formatted strings from a list of dates.
if not type(list) == 'table' then
error('date:list:text: need "list:text()" with a colon', 2)
end
local result = { join = _list_join }
for i, date in ipairs(list) do
result[i] = date:text(fmt)
end
return result
end
local function _date_list(date, spec)
-- Return a possibly empty numbered table of dates meeting the specification.
-- Dates in the list are in ascending order (oldest date first).
-- The spec should be a string of form "<count> <day> <op>"
-- where each item is optional and
-- count = number of items wanted in list
-- day = abbreviation or name such as Mon or Monday
-- op = >, >=, <, <= (default is > meaning after date)
-- If no count is given, the list is for the specified days in date's month.
-- The default day is date's day.
-- The spec can also be a positive or negative number:
-- -5 is equivalent to '5 <'
-- 5 is equivalent to '5' which is '5 >'
if not is_date(date) then
error('date:list: need a date (use "date:list()" with a colon)', 2)
end
local list = { text = _list_text }
if date.partial then
return list
end
local count, offset, operation
local ops = {
['>='] = { before = false, include = true },
['>'] = { before = false, include = false },
['<='] = { before = true , include = true },
['<'] = { before = true , include = false },
}
if spec then
if type(spec) == 'number' then
count = floor(spec + 0.5)
if count < 0 then
count = -count
operation = ops['<']
end
elseif type(spec) == 'string' then
local num, day, op = spec:match('^%s*(%d*)%s*(%a*)%s*([<>=]*)%s*$')
if not num then
return list
end
if num ~= '' then
count = tonumber(num)
end
if day ~= '' then
local dow = day_number(day:gsub('[sS]$', '')) -- accept plural days
if not dow then
return list
end
offset = dow - date.dow
end
operation = ops[op]
else
return list
end
end
offset = offset or 0
operation = operation or ops['>']
local datefrom, dayfirst, daylast
if operation.before then
if offset > 0 or (offset == 0 and not operation.include) then
offset = offset - 7
end
if count then
if count > 1 then
offset = offset - 7*(count - 1)
end
datefrom = date + offset
else
daylast = date.day + offset
dayfirst = daylast % 7
if dayfirst == 0 then
dayfirst = 7
end
end
else
if offset < 0 or (offset == 0 and not operation.include) then
offset = offset + 7
end
if count then
datefrom = date + offset
else
dayfirst = date.day + offset
daylast = date.monthdays
end
end
if not count then
if daylast < dayfirst then
return list
end
count = floor((daylast - dayfirst)/7) + 1
datefrom = Date(date, {day = dayfirst})
end
for i = 1, count do
if not datefrom then break end -- exceeds date limits
list[i] = datefrom
datefrom = datefrom + 7
end
return list
end
-- A table to get the current date/time (UTC), but only if needed.
local current = setmetatable({}, {
__index = function (self, key)
local d = os.date('!*t')
self.year = d.year
self.month = d.month
self.day = d.day
self.hour = d.hour
self.minute = d.min
self.second = d.sec
return rawget(self, key)
end })
local function extract_date(newdate, text)
-- Parse the date/time in text and return n, o where
-- n = table of numbers with date/time fields
-- o = table of options for AM/PM or AD/BC or format, if any
-- or return nothing if date is known to be invalid.
-- Caller determines if the values in n are valid.
-- A year must be positive ('1' to '9999'); use 'BC' for BC.
-- In a y-m-d string, the year must be four digits to avoid ambiguity
-- ('0001' to '9999'). The only way to enter year <= 0 is by specifying
-- the date as three numeric parameters like ymd Date(-1, 1, 1).
-- Dates of form d/m/y, m/d/y, y/m/d are rejected as potentially ambiguous.
local date, options = {}, {}
if text:sub(-1) == 'Z' then
-- Extract date/time from a Wikidata timestamp.
-- The year can be 1 to 16 digits but this module handles 1 to 4 digits only.
-- Examples: '+2016-06-21T14:30:00Z', '-0000000180-00-00T00:00:00Z'.
local sign, y, m, d, H, M, S = text:match('^([+%-])(%d+)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)Z$')
if sign then
y = tonumber(y)
if sign == '-' and y > 0 then
y = -y
end
if y <= 0 then
options.era = 'BCE'
end
date.year = y
m = tonumber(m)
d = tonumber(d)
H = tonumber(H)
M = tonumber(M)
S = tonumber(S)
if m == 0 then
newdate.partial = true
return date, options
end
date.month = m
if d == 0 then
newdate.partial = true
return date, options
end
date.day = d
if H > 0 or M > 0 or S > 0 then
date.hour = H
date.minute = M
date.second = S
end
return date, options
end
return
end
local function extract_ymd(item)
-- Called when no day or month has been set.
local y, m, d = item:match('^(%d%d%d%d)%-(%w+)%-(%d%d?)$')
if y then
if date.year then
return
end
if m:match('^%d%d?$') then
m = tonumber(m)
else
m = month_number(m)
end
if m then
date.year = tonumber(y)
date.month = m
date.day = tonumber(d)
return true
end
end
end
local function extract_day_or_year(item)
-- Called when a day would be valid, or
-- when a year would be valid if no year has been set and partial is set.
local number, suffix = item:match('^(%d%d?%d?%d?)(.*)$')
if number then
local n = tonumber(number)
if #number <= 2 and n <= 31 then
suffix = suffix:lower()
if suffix == '' or suffix == 'st' or suffix == 'nd' or suffix == 'rd' or suffix == 'th' then
date.day = n
return true
end
elseif suffix == '' and newdate.partial and not date.year then
date.year = n
return true
end
end
end
local function extract_month(item)
-- A month must be given as a name or abbreviation; a number could be ambiguous.
local m = month_number(item)
if m then
date.month = m
return true
end
end
local function extract_time(item)
local h, m, s = item:match('^(%d%d?):(%d%d)(:?%d*)$')
if date.hour or not h then
return
end
if s ~= '' then
s = s:match('^:(%d%d)$')
if not s then
return
end
end
date.hour = tonumber(h)
date.minute = tonumber(m)
date.second = tonumber(s) -- nil if empty string
return true
end
local item_count = 0
local index_time
local function set_ampm(item)
local H = date.hour
if H and not options.am and index_time + 1 == item_count then
options.am = ampm_options[item] -- caller checked this is not nil
if item:match('^[Aa]') then
if not (1 <= H and H <= 12) then
return
end
if H == 12 then
date.hour = 0
end
else
if not (1 <= H and H <= 23) then
return
end
if H <= 11 then
date.hour = H + 12
end
end
return true
end
end
for item in text:gsub(',', ' '):gsub(' ', ' '):gmatch('%S+') do
item_count = item_count + 1
if era_text[item] then
-- Era is accepted in peculiar places.
if options.era then
return
end
options.era = item
elseif ampm_options[item] then
if not set_ampm(item) then
return
end
elseif item:find(':', 1, true) then
if not extract_time(item) then
return
end
index_time = item_count
elseif date.day and date.month then
if date.year then
return -- should be nothing more so item is invalid
end
if not item:match('^(%d%d?%d?%d?)$') then
return
end
date.year = tonumber(item)
elseif date.day then
if not extract_month(item) then
return
end
elseif date.month then
if not extract_day_or_year(item) then
return
end
elseif extract_month(item) then
options.format = 'mdy'
elseif extract_ymd(item) then
options.format = 'ymd'
elseif extract_day_or_year(item) then
if date.day then
options.format = 'dmy'
end
else
return
end
end
if not date.year or date.year == 0 then
return
end
local era = era_text[options.era]
if era and era.isbc then
date.year = 1 - date.year
end
return date, options
end
local function autofill(date1, date2)
-- Fill any missing month or day in each date using the
-- corresponding component from the other date, if present,
-- or with 1 if both dates are missing the month or day.
-- This gives a good result for calculating the difference
-- between two partial dates when no range is wanted.
-- Return filled date1, date2 (two full dates).
local function filled(a, b)
-- Return date a filled, if necessary, with month and/or day from date b.
-- The filled day is truncated to fit the number of days in the month.
local fillmonth, fillday
if not a.month then
fillmonth = b.month or 1
end
if not a.day then
fillday = b.day or 1
end
if fillmonth or fillday then -- need to create a new date
a = Date(a, {
month = fillmonth,
day = math.min(fillday or a.day, days_in_month(a.year, fillmonth or a.month, a.calendar))
})
end
return a
end
return filled(date1, date2), filled(date2, date1)
end
local function date_add_sub(lhs, rhs, is_sub)
-- Return a new date from calculating (lhs + rhs) or (lhs - rhs),
-- or return nothing if invalid.
-- The result is nil if the calculated date exceeds allowable limits.
-- Caller ensures that lhs is a date; its properties are copied for the new date.
if lhs.partial then
-- Adding to a partial is not supported.
-- Can subtract a date or partial from a partial, but this is not called for that.
return
end
local function is_prefix(text, word, minlen)
local n = #text
return (minlen or 1) <= n and n <= #word and text == word:sub(1, n)
end
local function do_days(n)
local forcetime, jd
if floor(n) == n then
jd = lhs.jd
else
forcetime = not lhs.hastime
jd = lhs.jdz
end
jd = jd + (is_sub and -n or n)
if forcetime then
jd = tostring(jd)
if not jd:find('.', 1, true) then
jd = jd .. '.0'
end
end
return Date(lhs, 'juliandate', jd)
end
if type(rhs) == 'number' then
-- Add/subtract days, including fractional days.
return do_days(rhs)
end
if type(rhs) == 'string' then
-- rhs is a single component like '26m' or '26 months' (with optional sign).
-- Fractions like '3.25d' are accepted for the units which are handled as days.
local sign, numstr, id = rhs:match('^%s*([+-]?)([%d%.]+)%s*(%a+)$')
if sign then
if sign == '-' then
is_sub = not (is_sub and true or false)
end
local y, m, days
local num = tonumber(numstr)
if not num then
return
end
id = id:lower()
if is_prefix(id, 'years') then
y = num
m = 0
elseif is_prefix(id, 'months') then
y = floor(num / 12)
m = num % 12
elseif is_prefix(id, 'weeks') then
days = num * 7
elseif is_prefix(id, 'days') then
days = num
elseif is_prefix(id, 'hours') then
days = num / 24
elseif is_prefix(id, 'minutes', 3) then
days = num / (24 * 60)
elseif is_prefix(id, 'seconds') then
days = num / (24 * 3600)
else
return
end
if days then
return do_days(days)
end
if numstr:find('.', 1, true) then
return
end
if is_sub then
y = -y
m = -m
end
assert(-11 <= m and m <= 11)
y = lhs.year + y
m = lhs.month + m
if m > 12 then
y = y + 1
m = m - 12
elseif m < 1 then
y = y - 1
m = m + 12
end
local d = math.min(lhs.day, days_in_month(y, m, lhs.calendar))
return Date(lhs, y, m, d)
end
end
if is_diff(rhs) then
local days = rhs.age_days
if (is_sub or false) ~= (rhs.isnegative or false) then
days = -days
end
return lhs + days
end
end
local full_date_only = {
dayabbr = true,
dayname = true,
dow = true,
dayofweek = true,
dowiso = true,
dayofweekiso = true,
dayofyear = true,
gsd = true,
juliandate = true,
jd = true,
jdz = true,
jdnoon = true,
}
-- Metatable for a date's calculated fields.
local datemt = {
__index = function (self, key)
if rawget(self, 'partial') then
if full_date_only[key] then return end
if key == 'monthabbr' or key == 'monthdays' or key == 'monthname' then
if not self.month then return end
end
end
local value
if key == 'dayabbr' then
value = day_info[self.dow][1]
elseif key == 'dayname' then
value = day_info[self.dow][2]
elseif key == 'dow' then
value = (self.jdnoon + 1) % 7 -- day-of-week 0=Sun to 6=Sat
elseif key == 'dayofweek' then
value = self.dow
elseif key == 'dowiso' then
value = (self.jdnoon % 7) + 1 -- ISO day-of-week 1=Mon to 7=Sun
elseif key == 'dayofweekiso' then
value = self.dowiso
elseif key == 'dayofyear' then
local first = Date(self.year, 1, 1, self.calendar).jdnoon
value = self.jdnoon - first + 1 -- day-of-year 1 to 366
elseif key == 'era' then
-- Era text (never a negative sign) from year and options.
value = get_era_for_year(self.options.era, self.year)
elseif key == 'format' then
value = self.options.format or 'dmy'
elseif key == 'gsd' then
-- GSD = 1 from 00:00:00 to 23:59:59 on 1 January 1 AD Gregorian calendar,
-- which is from jd 1721425.5 to 1721426.49999.
value = floor(self.jd - 1721424.5)
elseif key == 'juliandate' or key == 'jd' or key == 'jdz' then
local jd, jdz = julian_date(self)
rawset(self, 'juliandate', jd)
rawset(self, 'jd', jd)
rawset(self, 'jdz', jdz)
return key == 'jdz' and jdz or jd
elseif key == 'jdnoon' then
-- Julian date at noon (an integer) on the calendar day when jd occurs.
value = floor(self.jd + 0.5)
elseif key == 'isleapyear' then
value = is_leap_year(self.year, self.calendar)
elseif key == 'monthabbr' then
value = month_info[self.month][1]
elseif key == 'monthdays' then
value = days_in_month(self.year, self.month, self.calendar)
elseif key == 'monthname' then
value = month_info[self.month][2]
end
if value ~= nil then
rawset(self, key, value)
return value
end
end,
}
-- Date operators.
local function mt_date_add(lhs, rhs)
if not is_date(lhs) then
lhs, rhs = rhs, lhs -- put date on left (it must be a date for this to have been called)
end
return date_add_sub(lhs, rhs)
end
local function mt_date_sub(lhs, rhs)
if is_date(lhs) then
if is_date(rhs) then
return DateDiff(lhs, rhs)
end
return date_add_sub(lhs, rhs, true)
end
end
local function mt_date_concat(lhs, rhs)
return tostring(lhs) .. tostring(rhs)
end
local function mt_date_tostring(self)
return self:text()
end
local function mt_date_eq(lhs, rhs)
-- Return true if dates identify same date/time where, for example,
-- Date(-4712, 1, 1, 'Julian') == Date(-4713, 11, 24, 'Gregorian') is true.
-- This is called only if lhs and rhs have the same type and the same metamethod.
if lhs.partial or rhs.partial then
-- One date is partial; the other is a partial or a full date.
-- The months may both be nil, but must be the same.
return lhs.year == rhs.year and lhs.month == rhs.month and lhs.calendar == rhs.calendar
end
return lhs.jdz == rhs.jdz
end
local function mt_date_lt(lhs, rhs)
-- Return true if lhs < rhs, for example,
-- Date('1 Jan 2016') < Date('06:00 1 Jan 2016') is true.
-- This is called only if lhs and rhs have the same type and the same metamethod.
if lhs.partial or rhs.partial then
-- One date is partial; the other is a partial or a full date.
if lhs.calendar ~= rhs.calendar then
return lhs.calendar == 'Julian'
end
if lhs.partial then
lhs = lhs.partial.first
end
if rhs.partial then
rhs = rhs.partial.first
end
end
return lhs.jdz < rhs.jdz
end
--[[ Examples of syntax to construct a date:
Date(y, m, d, 'julian') default calendar is 'gregorian'
Date(y, m, d, H, M, S, 'julian')
Date('juliandate', jd, 'julian') if jd contains "." text output includes H:M:S
Date('currentdate')
Date('currentdatetime')
Date('1 April 1995', 'julian') parse date from text
Date('1 April 1995 AD', 'julian') using an era sets a flag to do the same for output
Date('04:30:59 1 April 1995', 'julian')
Date(date) copy of an existing date
Date(date, t) same, updated with y,m,d,H,M,S fields from table t
Date(t) date with y,m,d,H,M,S fields from table t
]]
function Date(...) -- for forward declaration above
-- Return a table holding a date assuming a uniform calendar always applies
-- (proleptic Gregorian calendar or proleptic Julian calendar), or
-- return nothing if date is invalid.
-- A partial date has a valid year, however its month may be nil, and
-- its day and time fields are nil.
-- Field partial is set to false (if a full date) or a table (if a partial date).
local calendars = { julian = 'Julian', gregorian = 'Gregorian' }
local newdate = {
_id = uniq,
calendar = 'Gregorian', -- default is Gregorian calendar
hastime = false, -- true if input sets a time
hour = 0, -- always set hour/minute/second so don't have to handle nil
minute = 0,
second = 0,
options = {},
list = _date_list,
subtract = function (self, rhs, options)
return DateDiff(self, rhs, options)
end,
text = _date_text,
}
local argtype, datetext, is_copy, jd_number, tnums
local numindex = 0
local numfields = { 'year', 'month', 'day', 'hour', 'minute', 'second' }
local numbers = {}
for _, v in ipairs({...}) do
v = strip_to_nil(v)
local vlower = type(v) == 'string' and v:lower() or nil
if v == nil then
-- Ignore empty arguments after stripping so modules can directly pass template parameters.
elseif calendars[vlower] then
newdate.calendar = calendars[vlower]
elseif vlower == 'partial' then
newdate.partial = true
elseif vlower == 'fix' then
newdate.want_fix = true
elseif is_date(v) then
-- Copy existing date (items can be overridden by other arguments).
if is_copy or tnums then
return
end
is_copy = true
newdate.calendar = v.calendar
newdate.partial = v.partial
newdate.hastime = v.hastime
newdate.options = v.options
newdate.year = v.year
newdate.month = v.month
newdate.day = v.day
newdate.hour = v.hour
newdate.minute = v.minute
newdate.second = v.second
elseif type(v) == 'table' then
if tnums then
return
end
tnums = {}
local tfields = { year=1, month=1, day=1, hour=2, minute=2, second=2 }
for tk, tv in pairs(v) do
if tfields[tk] then
tnums[tk] = tonumber(tv)
end
if tfields[tk] == 2 then
newdate.hastime = true
end
end
else
local num = tonumber(v)
if not num and argtype == 'setdate' and numindex == 1 then
num = month_number(v)
end
if num then
if not argtype then
argtype = 'setdate'
end
if argtype == 'setdate' and numindex < 6 then
numindex = numindex + 1
numbers[numfields[numindex]] = num
elseif argtype == 'juliandate' and not jd_number then
jd_number = num
if type(v) == 'string' then
if v:find('.', 1, true) then
newdate.hastime = true
end
elseif num ~= floor(num) then
-- The given value was a number. The time will be used
-- if the fractional part is nonzero.
newdate.hastime = true
end
else
return
end
elseif argtype then
return
elseif type(v) == 'string' then
if v == 'currentdate' or v == 'currentdatetime' or v == 'juliandate' then
argtype = v
else
argtype = 'datetext'
datetext = v
end
else
return
end
end
end
if argtype == 'datetext' then
if tnums or not set_date_from_numbers(newdate, extract_date(newdate, datetext)) then
return
end
elseif argtype == 'juliandate' then
newdate.partial = nil
newdate.jd = jd_number
if not set_date_from_jd(newdate) then
return
end
elseif argtype == 'currentdate' or argtype == 'currentdatetime' then
newdate.partial = nil
newdate.year = current.year
newdate.month = current.month
newdate.day = current.day
if argtype == 'currentdatetime' then
newdate.hour = current.hour
newdate.minute = current.minute
newdate.second = current.second
newdate.hastime = true
end
newdate.calendar = 'Gregorian' -- ignore any given calendar name
elseif argtype == 'setdate' then
if tnums or not set_date_from_numbers(newdate, numbers) then
return
end
elseif not (is_copy or tnums) then
return
end
if tnums then
newdate.jd = nil -- force recalculation in case jd was set before changes from tnums
if not set_date_from_numbers(newdate, tnums) then
return
end
end
if newdate.partial then
local year = newdate.year
local month = newdate.month
local first = Date(year, month or 1, 1, newdate.calendar)
month = month or 12
local last = Date(year, month, days_in_month(year, month), newdate.calendar)
newdate.partial = { first = first, last = last }
else
newdate.partial = false -- avoid index lookup
end
setmetatable(newdate, datemt)
local readonly = {}
local mt = {
__index = newdate,
__newindex = function(t, k, v) error('date.' .. tostring(k) .. ' is read-only', 2) end,
__add = mt_date_add,
__sub = mt_date_sub,
__concat = mt_date_concat,
__tostring = mt_date_tostring,
__eq = mt_date_eq,
__lt = mt_date_lt,
}
return setmetatable(readonly, mt)
end
local function _diff_age(diff, code, options)
-- Return a tuple of integer values from diff as specified by code, except that
-- each integer may be a list of two integers for a diff with a partial date, or
-- return nil if the code is not supported.
-- If want round, the least significant unit is rounded to nearest whole unit.
-- For a duration, an extra day is added.
local wantround, wantduration, wantrange
if type(options) == 'table' then
wantround = options.round
wantduration = options.duration
wantrange = options.range
else
wantround = options
end
if not is_diff(diff) then
local f = wantduration and 'duration' or 'age'
error(f .. ': need a date difference (use "diff:' .. f .. '()" with a colon)', 2)
end
if diff.partial then
-- Ignore wantround, wantduration.
local function choose(v)
if type(v) == 'table' then
if not wantrange or v[1] == v[2] then
-- Example: Date('partial', 2005) - Date('partial', 2001) gives
-- diff.years = { 3, 4 } to show the range of possible results.
-- If do not want a range, choose the second value as more expected.
return v[2]
end
end
return v
end
if code == 'ym' or code == 'ymd' then
if not wantrange and diff.iszero then
-- This avoids an unexpected result such as
-- Date('partial', 2001) - Date('partial', 2001)
-- giving diff = { years = 0, months = { 0, 11 } }
-- which would be reported as 0 years and 11 months.
return 0, 0
end
return choose(diff.partial.years), choose(diff.partial.months)
end
if code == 'y' then
return choose(diff.partial.years)
end
if code == 'm' or code == 'w' or code == 'd' then
return choose({ diff.partial.mindiff:age(code), diff.partial.maxdiff:age(code) })
end
return nil
end
local extra_days = wantduration and 1 or 0
if code == 'wd' or code == 'w' or code == 'd' then
local offset = wantround and 0.5 or 0
local days = diff.age_days + extra_days
if code == 'wd' or code == 'd' then
days = floor(days + offset)
if code == 'd' then
return days
end
return floor(days/7), days % 7
end
return floor(days/7 + offset)
end
local H, M, S = diff.hours, diff.minutes, diff.seconds
if code == 'dh' or code == 'dhm' or code == 'dhms' or code == 'h' or code == 'hm' or code == 'hms' or code == 'M' or code == 's' then
local days = floor(diff.age_days + extra_days)
local inc_hour
if wantround then
if code == 'dh' or code == 'h' then
if M >= 30 then
inc_hour = true
end
elseif code == 'dhm' or code == 'hm' then
if S >= 30 then
M = M + 1
if M >= 60 then
M = 0
inc_hour = true
end
end
elseif code == 'M' then
if S >= 30 then
M = M + 1
end
else
-- Nothing needed because S is an integer.
end
if inc_hour then
H = H + 1
if H >= 24 then
H = 0
days = days + 1
end
end
end
if code == 'dh' or code == 'dhm' or code == 'dhms' then
if code == 'dh' then
return days, H
elseif code == 'dhm' then
return days, H, M
else
return days, H, M, S
end
end
local hours = days * 24 + H
if code == 'h' then
return hours
elseif code == 'hm' then
return hours, M
elseif code == 'M' or code == 's' then
M = hours * 60 + M
if code == 'M' then
return M
end
return M * 60 + S
end
return hours, M, S
end
if wantround then
local inc_hour
if code == 'ymdh' or code == 'ymwdh' then
if M >= 30 then
inc_hour = true
end
elseif code == 'ymdhm' or code == 'ymwdhm' then
if S >= 30 then
M = M + 1
if M >= 60 then
M = 0
inc_hour = true
end
end
elseif code == 'ymd' or code == 'ymwd' or code == 'yd' or code == 'md' then
if H >= 12 then
extra_days = extra_days + 1
end
end
if inc_hour then
H = H + 1
if H >= 24 then
H = 0
extra_days = extra_days + 1
end
end
end
local y, m, d = diff.years, diff.months, diff.days
if extra_days > 0 then
d = d + extra_days
if d > 28 or code == 'yd' then
-- Recalculate in case have passed a month.
diff = diff.date1 + extra_days - diff.date2
y, m, d = diff.years, diff.months, diff.days
end
end
if code == 'ymd' then
return y, m, d
elseif code == 'yd' then
if y > 0 then
-- It is known that diff.date1 > diff.date2.
diff = diff.date1 - (diff.date2 + (y .. 'y'))
end
return y, floor(diff.age_days)
elseif code == 'md' then
return y * 12 + m, d
elseif code == 'ym' or code == 'm' then
if wantround then
if d >= 16 then
m = m + 1
if m >= 12 then
m = 0
y = y + 1
end
end
end
if code == 'ym' then
return y, m
end
return y * 12 + m
elseif code == 'ymw' then
local weeks = floor(d/7)
if wantround then
local days = d % 7
if days > 3 or (days == 3 and H >= 12) then
weeks = weeks + 1
end
end
return y, m, weeks
elseif code == 'ymwd' then
return y, m, floor(d/7), d % 7
elseif code == 'ymdh' then
return y, m, d, H
elseif code == 'ymwdh' then
return y, m, floor(d/7), d % 7, H
elseif code == 'ymdhm' then
return y, m, d, H, M
elseif code == 'ymwdhm' then
return y, m, floor(d/7), d % 7, H, M
end
if code == 'y' then
if wantround and m >= 6 then
y = y + 1
end
return y
end
return nil
end
local function _diff_duration(diff, code, options)
if type(options) ~= 'table' then
options = { round = options }
end
options.duration = true
return _diff_age(diff, code, options)
end
-- Metatable for some operations on date differences.
diffmt = { -- for forward declaration above
__concat = function (lhs, rhs)
return tostring(lhs) .. tostring(rhs)
end,
__tostring = function (self)
return tostring(self.age_days)
end,
__index = function (self, key)
local value
if key == 'age_days' then
if rawget(self, 'partial') then
local function jdz(date)
return (date.partial and date.partial.first or date).jdz
end
value = jdz(self.date1) - jdz(self.date2)
else
value = self.date1.jdz - self.date2.jdz
end
end
if value ~= nil then
rawset(self, key, value)
return value
end
end,
}
function DateDiff(date1, date2, options) -- for forward declaration above
-- Return a table with the difference between two dates (date1 - date2).
-- The difference is negative if date1 is older than date2.
-- Return nothing if invalid.
-- If d = date1 - date2 then
-- date1 = date2 + d
-- If date1 >= date2 and the dates have no H:M:S time specified then
-- date1 = date2 + (d.years..'y') + (d.months..'m') + d.days
-- where the larger time units are added first.
-- The result of Date(2015,1,x) + '1m' is Date(2015,2,28) for
-- x = 28, 29, 30, 31. That means, for example,
-- d = Date(2015,3,3) - Date(2015,1,31)
-- gives d.years, d.months, d.days = 0, 1, 3 (excluding date1).
if not (is_date(date1) and is_date(date2) and date1.calendar == date2.calendar) then
return
end
local wantfill
if type(options) == 'table' then
wantfill = options.fill
end
local isnegative = false
local iszero = false
if date1 < date2 then
isnegative = true
date1, date2 = date2, date1
elseif date1 == date2 then
iszero = true
end
-- It is known that date1 >= date2 (period is from date2 to date1).
if date1.partial or date2.partial then
-- Two partial dates might have timelines:
---------------------A=================B--- date1 is from A to B inclusive
--------C=======D-------------------------- date2 is from C to D inclusive
-- date1 > date2 iff A > C (date1.partial.first > date2.partial.first)
-- The periods can overlap ('April 2001' - '2001'):
-------------A===B------------------------- A=2001-04-01 B=2001-04-30
--------C=====================D------------ C=2001-01-01 D=2001-12-31
if wantfill then
date1, date2 = autofill(date1, date2)
else
local function zdiff(date1, date2)
local diff = date1 - date2
if diff.isnegative then
return date1 - date1 -- a valid diff in case we call its methods
end
return diff
end
local function getdate(date, which)
return date.partial and date.partial[which] or date
end
local maxdiff = zdiff(getdate(date1, 'last'), getdate(date2, 'first'))
local mindiff = zdiff(getdate(date1, 'first'), getdate(date2, 'last'))
local years, months
if maxdiff.years == mindiff.years then
years = maxdiff.years
if maxdiff.months == mindiff.months then
months = maxdiff.months
else
months = { mindiff.months, maxdiff.months }
end
else
years = { mindiff.years, maxdiff.years }
end
return setmetatable({
date1 = date1,
date2 = date2,
partial = {
years = years,
months = months,
maxdiff = maxdiff,
mindiff = mindiff,
},
isnegative = isnegative,
iszero = iszero,
age = _diff_age,
duration = _diff_duration,
}, diffmt)
end
end
local y1, m1 = date1.year, date1.month
local y2, m2 = date2.year, date2.month
local years = y1 - y2
local months = m1 - m2
local d1 = date1.day + hms(date1)
local d2 = date2.day + hms(date2)
local days, time
if d1 >= d2 then
days = d1 - d2
else
months = months - 1
-- Get days in previous month (before the "to" date) given December has 31 days.
local dpm = m1 > 1 and days_in_month(y1, m1 - 1, date1.calendar) or 31
if d2 >= dpm then
days = d1 - hms(date2)
else
days = dpm - d2 + d1
end
end
if months < 0 then
years = years - 1
months = months + 12
end
days, time = math.modf(days)
local H, M, S = h_m_s(time)
return setmetatable({
date1 = date1,
date2 = date2,
partial = false, -- avoid index lookup
years = years,
months = months,
days = days,
hours = H,
minutes = M,
seconds = S,
isnegative = isnegative,
iszero = iszero,
age = _diff_age,
duration = _diff_duration,
}, diffmt)
end
return {
_current = current,
_Date = Date,
_days_in_month = days_in_month,
}
48b9402c32798b1e9f91f2ab44283ebda7b53ed9
Template:Pluralize from text
10
135
279
278
2023-08-10T15:23:26Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Pluralize_from_text]]
wikitext
text/x-wiki
{{#invoke:Detect singular|pluralize}}<noinclude>{{documentation}}</noinclude>
305f4b531ea5639895c83cecd0fd809f7f5cf845
Template:URL
10
136
281
280
2023-08-10T15:23:26Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:URL]]
wikitext
text/x-wiki
<includeonly>{{#invoke:URL|url}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using URL template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:URL]] with unknown parameter "_VALUE_"|ignoreblank=y | 1 | 2 }}<noinclude>{{documentation}}</noinclude>
5671474ce4656f07c5bdc47292d1dcbe9c70317e
Module:Detect singular
828
137
283
282
2023-08-10T15:23:26Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Detect_singular]]
Scribunto
text/plain
local p = {}
local getArgs = require('Module:Arguments').getArgs
local yesNo = require('Module:Yesno')
local getPlain = require('Module:Text').Text().getPlain
-- function to determine whether "sub" occurs in "s"
local function plainFind(s, sub)
return mw.ustring.find(s, sub, 1, true)
end
-- function to count the number of times "pattern" (a regex) occurs in "s"
local function countMatches(s, pattern)
local _, count = mw.ustring.gsub(s, pattern, '')
return count
end
local singular = 1
local likelyPlural = 2
local plural = 3
-- Determine whether a string is singular or plural (i.e., it represents one
-- item or many)
-- Arguments:
-- origArgs[1]: string to process
-- origArgs.no_comma: if false, use commas to detect plural (default false)
-- origArgs.parse_links: if false, treat wikilinks as opaque singular objects (default false)
-- Returns:
-- singular, likelyPlural, or plural (see constants above), or nil for completely unknown
function p._main(origArgs)
origArgs = type(origArgs) == 'table' and origArgs or {}
local args = {}
-- canonicalize boolean arguments
for key, default in pairs({no_comma=false,parse_links=false,any_comma=false,no_and=false}) do
if origArgs[key] == nil then
args[key] = default
else
args[key] = yesNo(origArgs[key],default)
end
end
local checkComma = not args.no_comma
local checkAnd = not args.no_and
local rewriteLinks = not args.parse_links
local anyComma = args.any_comma
local s = origArgs[1] -- the input string
if not s then
return nil -- empty input returns nil
end
s = tostring(s)
s = mw.text.decode(s,true) --- replace HTML entities (to avoid spurious semicolons)
if plainFind(s,'data-plural="0"') then -- magic data string to return true
return singular
end
if plainFind(s,'data-plural="1"') then -- magic data string to return false
return plural
end
-- count number of list items
local numListItems = countMatches(s,'<%s*li')
-- if exactly one, then singular, if more than one, then plural
if numListItems == 1 then
return singular
end
if numListItems > 1 then
return plural
end
-- if "list of" occurs inside of wlink, then it's plural
if mw.ustring.find(s:lower(), '%[%[[^%]]*list of[^%]]+%]%]') then
return plural
end
-- fix for trailing br tags passed through [[template:marriage]]
s = mw.ustring.gsub(s, '<%s*br[^>]*>%s*(</div>)', '%1')
-- replace all wikilinks with fixed string
if rewriteLinks then
s = mw.ustring.gsub(s,'%b[]','WIKILINK')
end
-- Five conditions: any one of them can make the string a likely plural or plural
local hasBreak = mw.ustring.find(s,'<%s*br')
-- For the last 4, evaluate on string stripped of wikimarkup
s = getPlain(s)
local hasBullets = countMatches(s,'%*+') > 1
local multipleQids = mw.ustring.find(s,'Q%d+[%p%s]+Q%d+') -- has multiple QIDs in a row
if hasBullets or multipleQids then
return plural
end
local commaPattern = anyComma and '[,;]' or '%D[,;]%D' -- semi-colon similar to comma
local hasComma = checkComma and mw.ustring.find(s, commaPattern)
local hasAnd = checkAnd and mw.ustring.find(s,'[,%s]and%s')
if hasBreak or hasComma or hasAnd then
return likelyPlural
end
return singular
end
function p._pluralize(args)
args = type(args) == 'table' and args or {}
local singularForm = args[3] or args.singular or ""
local pluralForm = args[4] or args.plural or ""
local likelyForm = args.likely or pluralForm
local link = args[5] or args.link
if link then
link = tostring(link)
singularForm = '[['..link..'|'..singularForm..']]'
pluralForm = '[['..link..'|'..pluralForm..']]'
likelyForm = '[['..link..'|'..likelyForm..']]'
end
if args[2] then
return pluralForm
end
local detect = p._main(args)
if detect == nil then
return "" -- return blank on complete failure
end
if detect == singular then
return singularForm
elseif detect == likelyPlural then
return likelyForm
else
return pluralForm
end
end
function p.main(frame)
local args = getArgs(frame)
-- For template, return 1 if singular, blank if plural or empty
local result = p._main(args)
if result == nil then
return 1
end
return result == singular and 1 or ""
end
function p.pluralize(frame)
local args = getArgs(frame)
return p._pluralize(args)
end
return p
6afb2e8c0bd8ddff094e2861b836521ee4a5a779
Module:Math
828
138
285
284
2023-08-10T15:23:27Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Math]]
Scribunto
text/plain
--[[
This module provides a number of basic mathematical operations.
]]
local yesno, getArgs -- lazily initialized
local p = {} -- Holds functions to be returned from #invoke, and functions to make available to other Lua modules.
local wrap = {} -- Holds wrapper functions that process arguments from #invoke. These act as intemediary between functions meant for #invoke and functions meant for Lua.
--[[
Helper functions used to avoid redundant code.
]]
local function err(msg)
-- Generates wikitext error messages.
return mw.ustring.format('<strong class="error">Formatting error: %s</strong>', msg)
end
local function unpackNumberArgs(args)
-- Returns an unpacked list of arguments specified with numerical keys.
local ret = {}
for k, v in pairs(args) do
if type(k) == 'number' then
table.insert(ret, v)
end
end
return unpack(ret)
end
local function makeArgArray(...)
-- Makes an array of arguments from a list of arguments that might include nils.
local args = {...} -- Table of arguments. It might contain nils or non-number values, so we can't use ipairs.
local nums = {} -- Stores the numbers of valid numerical arguments.
local ret = {}
for k, v in pairs(args) do
v = p._cleanNumber(v)
if v then
nums[#nums + 1] = k
args[k] = v
end
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[#ret + 1] = args[num]
end
return ret
end
local function fold(func, ...)
-- Use a function on all supplied arguments, and return the result. The function must accept two numbers as parameters,
-- and must return a number as an output. This number is then supplied as input to the next function call.
local vals = makeArgArray(...)
local count = #vals -- The number of valid arguments
if count == 0 then return
-- Exit if we have no valid args, otherwise removing the first arg would cause an error.
nil, 0
end
local ret = table.remove(vals, 1)
for _, val in ipairs(vals) do
ret = func(ret, val)
end
return ret, count
end
--[[
Fold arguments by selectively choosing values (func should return when to choose the current "dominant" value).
]]
local function binary_fold(func, ...)
local value = fold((function(a, b) if func(a, b) then return a else return b end end), ...)
return value
end
--[[
random
Generate a random number
Usage:
{{#invoke: Math | random }}
{{#invoke: Math | random | maximum value }}
{{#invoke: Math | random | minimum value | maximum value }}
]]
function wrap.random(args)
local first = p._cleanNumber(args[1])
local second = p._cleanNumber(args[2])
return p._random(first, second)
end
function p._random(first, second)
math.randomseed(mw.site.stats.edits + mw.site.stats.pages + os.time() + math.floor(os.clock() * 1000000000))
-- math.random will throw an error if given an explicit nil parameter, so we need to use if statements to check the params.
if first and second then
if first <= second then -- math.random doesn't allow the first number to be greater than the second.
return math.random(first, second)
end
elseif first then
return math.random(first)
else
return math.random()
end
end
--[[
order
Determine order of magnitude of a number
Usage:
{{#invoke: Math | order | value }}
]]
function wrap.order(args)
local input_string = (args[1] or args.x or '0');
local input_number = p._cleanNumber(input_string);
if input_number == nil then
return err('order of magnitude input appears non-numeric')
else
return p._order(input_number)
end
end
function p._order(x)
if x == 0 then return 0 end
return math.floor(math.log10(math.abs(x)))
end
--[[
precision
Detemines the precision of a number using the string representation
Usage:
{{ #invoke: Math | precision | value }}
]]
function wrap.precision(args)
local input_string = (args[1] or args.x or '0');
local trap_fraction = args.check_fraction;
local input_number;
if not yesno then
yesno = require('Module:Yesno')
end
if yesno(trap_fraction, true) then -- Returns true for all input except nil, false, "no", "n", "0" and a few others. See [[Module:Yesno]].
local pos = string.find(input_string, '/', 1, true);
if pos ~= nil then
if string.find(input_string, '/', pos + 1, true) == nil then
local denominator = string.sub(input_string, pos+1, -1);
local denom_value = tonumber(denominator);
if denom_value ~= nil then
return math.log10(denom_value);
end
end
end
end
input_number, input_string = p._cleanNumber(input_string);
if input_string == nil then
return err('precision input appears non-numeric')
else
return p._precision(input_string)
end
end
function p._precision(x)
if type(x) == 'number' then
x = tostring(x)
end
x = string.upper(x)
local decimal = x:find('%.')
local exponent_pos = x:find('E')
local result = 0;
if exponent_pos ~= nil then
local exponent = string.sub(x, exponent_pos + 1)
x = string.sub(x, 1, exponent_pos - 1)
result = result - tonumber(exponent)
end
if decimal ~= nil then
result = result + string.len(x) - decimal
return result
end
local pos = string.len(x);
while x:byte(pos) == string.byte('0') do
pos = pos - 1
result = result - 1
if pos <= 0 then
return 0
end
end
return result
end
--[[
max
Finds the maximum argument
Usage:
{{#invoke:Math| max | value1 | value2 | ... }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.max(args)
return p._max(unpackNumberArgs(args))
end
function p._max(...)
local max_value = binary_fold((function(a, b) return a > b end), ...)
if max_value then
return max_value
end
end
--[[
median
Find the median of set of numbers
Usage:
{{#invoke:Math | median | number1 | number2 | ...}}
OR
{{#invoke:Math | median }}
]]
function wrap.median(args)
return p._median(unpackNumberArgs(args))
end
function p._median(...)
local vals = makeArgArray(...)
local count = #vals
table.sort(vals)
if count == 0 then
return 0
end
if p._mod(count, 2) == 0 then
return (vals[count/2] + vals[count/2+1])/2
else
return vals[math.ceil(count/2)]
end
end
--[[
min
Finds the minimum argument
Usage:
{{#invoke:Math| min | value1 | value2 | ... }}
OR
{{#invoke:Math| min }}
When used with no arguments, it takes its input from the parent
frame. Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.min(args)
return p._min(unpackNumberArgs(args))
end
function p._min(...)
local min_value = binary_fold((function(a, b) return a < b end), ...)
if min_value then
return min_value
end
end
--[[
sum
Finds the sum
Usage:
{{#invoke:Math| sum | value1 | value2 | ... }}
OR
{{#invoke:Math| sum }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.sum(args)
return p._sum(unpackNumberArgs(args))
end
function p._sum(...)
local sums, count = fold((function(a, b) return a + b end), ...)
if not sums then
return 0
else
return sums
end
end
--[[
average
Finds the average
Usage:
{{#invoke:Math| average | value1 | value2 | ... }}
OR
{{#invoke:Math| average }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.average(args)
return p._average(unpackNumberArgs(args))
end
function p._average(...)
local sum, count = fold((function(a, b) return a + b end), ...)
if not sum then
return 0
else
return sum / count
end
end
--[[
round
Rounds a number to specified precision
Usage:
{{#invoke:Math | round | value | precision }}
--]]
function wrap.round(args)
local value = p._cleanNumber(args[1] or args.value or 0)
local precision = p._cleanNumber(args[2] or args.precision or 0)
if value == nil or precision == nil then
return err('round input appears non-numeric')
else
return p._round(value, precision)
end
end
function p._round(value, precision)
local rescale = math.pow(10, precision or 0);
return math.floor(value * rescale + 0.5) / rescale;
end
--[[
log10
returns the log (base 10) of a number
Usage:
{{#invoke:Math | log10 | x }}
]]
function wrap.log10(args)
return math.log10(args[1])
end
--[[
mod
Implements the modulo operator
Usage:
{{#invoke:Math | mod | x | y }}
--]]
function wrap.mod(args)
local x = p._cleanNumber(args[1])
local y = p._cleanNumber(args[2])
if not x then
return err('first argument to mod appears non-numeric')
elseif not y then
return err('second argument to mod appears non-numeric')
else
return p._mod(x, y)
end
end
function p._mod(x, y)
local ret = x % y
if not (0 <= ret and ret < y) then
ret = 0
end
return ret
end
--[[
gcd
Calculates the greatest common divisor of multiple numbers
Usage:
{{#invoke:Math | gcd | value 1 | value 2 | value 3 | ... }}
--]]
function wrap.gcd(args)
return p._gcd(unpackNumberArgs(args))
end
function p._gcd(...)
local function findGcd(a, b)
local r = b
local oldr = a
while r ~= 0 do
local quotient = math.floor(oldr / r)
oldr, r = r, oldr - quotient * r
end
if oldr < 0 then
oldr = oldr * -1
end
return oldr
end
local result, count = fold(findGcd, ...)
return result
end
--[[
precision_format
Rounds a number to the specified precision and formats according to rules
originally used for {{template:Rnd}}. Output is a string.
Usage:
{{#invoke: Math | precision_format | number | precision }}
]]
function wrap.precision_format(args)
local value_string = args[1] or 0
local precision = args[2] or 0
return p._precision_format(value_string, precision)
end
function p._precision_format(value_string, precision)
-- For access to Mediawiki built-in formatter.
local lang = mw.getContentLanguage();
local value
value, value_string = p._cleanNumber(value_string)
precision = p._cleanNumber(precision)
-- Check for non-numeric input
if value == nil or precision == nil then
return err('invalid input when rounding')
end
local current_precision = p._precision(value)
local order = p._order(value)
-- Due to round-off effects it is neccesary to limit the returned precision under
-- some circumstances because the terminal digits will be inaccurately reported.
if order + precision >= 14 then
if order + p._precision(value_string) >= 14 then
precision = 13 - order;
end
end
-- If rounding off, truncate extra digits
if precision < current_precision then
value = p._round(value, precision)
current_precision = p._precision(value)
end
local formatted_num = lang:formatNum(math.abs(value))
local sign
-- Use proper unary minus sign rather than ASCII default
if value < 0 then
sign = '−'
else
sign = ''
end
-- Handle cases requiring scientific notation
if string.find(formatted_num, 'E', 1, true) ~= nil or math.abs(order) >= 9 then
value = value * math.pow(10, -order)
current_precision = current_precision + order
precision = precision + order
formatted_num = lang:formatNum(math.abs(value))
else
order = 0;
end
formatted_num = sign .. formatted_num
-- Pad with zeros, if needed
if current_precision < precision then
local padding
if current_precision <= 0 then
if precision > 0 then
local zero_sep = lang:formatNum(1.1)
formatted_num = formatted_num .. zero_sep:sub(2,2)
padding = precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
else
padding = precision - current_precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
end
-- Add exponential notation, if necessary.
if order ~= 0 then
-- Use proper unary minus sign rather than ASCII default
if order < 0 then
order = '−' .. lang:formatNum(math.abs(order))
else
order = lang:formatNum(order)
end
formatted_num = formatted_num .. '<span style="margin:0 .15em 0 .25em">×</span>10<sup>' .. order .. '</sup>'
end
return formatted_num
end
--[[
divide
Implements the division operator
Usage:
{{#invoke:Math | divide | x | y | round= | precision= }}
--]]
function wrap.divide(args)
local x = args[1]
local y = args[2]
local round = args.round
local precision = args.precision
if not yesno then
yesno = require('Module:Yesno')
end
return p._divide(x, y, yesno(round), precision)
end
function p._divide(x, y, round, precision)
if y == nil or y == "" then
return err("Empty divisor")
elseif not tonumber(y) then
if type(y) == 'string' and string.sub(y, 1, 1) == '<' then
return y
else
return err("Not a number: " .. y)
end
elseif x == nil or x == "" then
return err("Empty dividend")
elseif not tonumber(x) then
if type(x) == 'string' and string.sub(x, 1, 1) == '<' then
return x
else
return err("Not a number: " .. x)
end
else
local z = x / y
if round then
return p._round(z, 0)
elseif precision then
return p._round(z, precision)
else
return z
end
end
end
--[[
Helper function that interprets the input numerically. If the
input does not appear to be a number, attempts evaluating it as
a parser functions expression.
]]
function p._cleanNumber(number_string)
if type(number_string) == 'number' then
-- We were passed a number, so we don't need to do any processing.
return number_string, tostring(number_string)
elseif type(number_string) ~= 'string' or not number_string:find('%S') then
-- We were passed a non-string or a blank string, so exit.
return nil, nil;
end
-- Attempt basic conversion
local number = tonumber(number_string)
-- If failed, attempt to evaluate input as an expression
if number == nil then
local success, result = pcall(mw.ext.ParserFunctions.expr, number_string)
if success then
number = tonumber(result)
number_string = tostring(number)
else
number = nil
number_string = nil
end
else
number_string = number_string:match("^%s*(.-)%s*$") -- String is valid but may contain padding, clean it.
number_string = number_string:match("^%+(.*)$") or number_string -- Trim any leading + signs.
if number_string:find('^%-?0[xX]') then
-- Number is using 0xnnn notation to indicate base 16; use the number that Lua detected instead.
number_string = tostring(number)
end
end
return number, number_string
end
--[[
Wrapper function that does basic argument processing. This ensures that all functions from #invoke can use either the current
frame or the parent frame, and it also trims whitespace for all arguments and removes blank arguments.
]]
local mt = { __index = function(t, k)
return function(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return wrap[k](getArgs(frame)) -- Argument processing is left to Module:Arguments. Whitespace is trimmed and blank arguments are removed.
end
end }
return setmetatable(p, mt)
2bbe734d898299f65412963a3c1782e9fcc4d9ca
Module:Text
828
139
287
286
2023-08-10T15:23:27Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Text]]
Scribunto
text/plain
local yesNo = require("Module:Yesno")
local Text = { serial = "2022-07-21",
suite = "Text" }
--[=[
Text utilities
]=]
-- local globals
local PatternCJK = false
local PatternCombined = false
local PatternLatin = false
local PatternTerminated = false
local QuoteLang = false
local QuoteType = false
local RangesLatin = false
local SeekQuote = false
local function initLatinData()
if not RangesLatin then
RangesLatin = { { 7, 687 },
{ 7531, 7578 },
{ 7680, 7935 },
{ 8194, 8250 } }
end
if not PatternLatin then
local range
PatternLatin = "^["
for i = 1, #RangesLatin do
range = RangesLatin[ i ]
PatternLatin = PatternLatin ..
mw.ustring.char( range[ 1 ], 45, range[ 2 ] )
end -- for i
PatternLatin = PatternLatin .. "]*$"
end
end
local function initQuoteData()
-- Create quote definitions
if not QuoteLang then
QuoteLang =
{ af = "bd",
ar = "la",
be = "labd",
bg = "bd",
ca = "la",
cs = "bd",
da = "bd",
de = "bd",
dsb = "bd",
et = "bd",
el = "lald",
en = "ld",
es = "la",
eu = "la",
-- fa = "la",
fi = "rd",
fr = "laSPC",
ga = "ld",
he = "ldla",
hr = "bd",
hsb = "bd",
hu = "bd",
hy = "labd",
id = "rd",
is = "bd",
it = "ld",
ja = "x300C",
ka = "bd",
ko = "ld",
lt = "bd",
lv = "bd",
nl = "ld",
nn = "la",
no = "la",
pl = "bdla",
pt = "lald",
ro = "bdla",
ru = "labd",
sk = "bd",
sl = "bd",
sq = "la",
sr = "bx",
sv = "rd",
th = "ld",
tr = "ld",
uk = "la",
zh = "ld",
["de-ch"] = "la",
["en-gb"] = "lsld",
["en-us"] = "ld",
["fr-ch"] = "la",
["it-ch"] = "la",
["pt-br"] = "ldla",
["zh-tw"] = "x300C",
["zh-cn"] = "ld" }
end
if not QuoteType then
QuoteType =
{ bd = { { 8222, 8220 }, { 8218, 8217 } },
bdla = { { 8222, 8220 }, { 171, 187 } },
bx = { { 8222, 8221 }, { 8218, 8217 } },
la = { { 171, 187 }, { 8249, 8250 } },
laSPC = { { 171, 187 }, { 8249, 8250 }, true },
labd = { { 171, 187 }, { 8222, 8220 } },
lald = { { 171, 187 }, { 8220, 8221 } },
ld = { { 8220, 8221 }, { 8216, 8217 } },
ldla = { { 8220, 8221 }, { 171, 187 } },
lsld = { { 8216, 8217 }, { 8220, 8221 } },
rd = { { 8221, 8221 }, { 8217, 8217 } },
x300C = { { 0x300C, 0x300D },
{ 0x300E, 0x300F } } }
end
end -- initQuoteData()
local function fiatQuote( apply, alien, advance )
-- Quote text
-- Parameter:
-- apply -- string, with text
-- alien -- string, with language code
-- advance -- number, with level 1 or 2
local r = apply and tostring(apply) or ""
alien = alien or "en"
advance = tonumber(advance) or 0
local suite
initQuoteData()
local slang = alien:match( "^(%l+)-" )
suite = QuoteLang[alien] or slang and QuoteLang[slang] or QuoteLang["en"]
if suite then
local quotes = QuoteType[ suite ]
if quotes then
local space
if quotes[ 3 ] then
space = " "
else
space = ""
end
quotes = quotes[ advance ]
if quotes then
r = mw.ustring.format( "%s%s%s%s%s",
mw.ustring.char( quotes[ 1 ] ),
space,
apply,
space,
mw.ustring.char( quotes[ 2 ] ) )
end
else
mw.log( "fiatQuote() " .. suite )
end
end
return r
end -- fiatQuote()
Text.char = function ( apply, again, accept )
-- Create string from codepoints
-- Parameter:
-- apply -- table (sequence) with numerical codepoints, or nil
-- again -- number of repetitions, or nil
-- accept -- true, if no error messages to be appended
-- Returns: string
local r = ""
apply = type(apply) == "table" and apply or {}
again = math.floor(tonumber(again) or 1)
if again < 1 then
return ""
end
local bad = { }
local codes = { }
for _, v in ipairs( apply ) do
local n = tonumber(v)
if not n or (n < 32 and n ~= 9 and n ~= 10) then
table.insert(bad, tostring(v))
else
table.insert(codes, math.floor(n))
end
end
if #bad > 0 then
if not accept then
r = tostring( mw.html.create( "span" )
:addClass( "error" )
:wikitext( "bad codepoints: " .. table.concat( bad, " " )) )
end
return r
end
if #codes > 0 then
r = mw.ustring.char( unpack( codes ) )
if again > 1 then
r = r:rep(again)
end
end
return r
end -- Text.char()
local function trimAndFormat(args, fmt)
local result = {}
if type(args) ~= 'table' then
args = {args}
end
for _, v in ipairs(args) do
v = mw.text.trim(tostring(v))
if v ~= "" then
table.insert(result,fmt and mw.ustring.format(fmt, v) or v)
end
end
return result
end
Text.concatParams = function ( args, apply, adapt )
-- Concat list items into one string
-- Parameter:
-- args -- table (sequence) with numKey=string
-- apply -- string (optional); separator (default: "|")
-- adapt -- string (optional); format including "%s"
-- Returns: string
local collect = { }
return table.concat(trimAndFormat(args,adapt), apply or "|")
end -- Text.concatParams()
Text.containsCJK = function ( s )
-- Is any CJK code within?
-- Parameter:
-- s -- string
-- Returns: true, if CJK detected
s = s and tostring(s) or ""
if not patternCJK then
patternCJK = mw.ustring.char( 91,
4352, 45, 4607,
11904, 45, 42191,
43072, 45, 43135,
44032, 45, 55215,
63744, 45, 64255,
65072, 45, 65103,
65381, 45, 65500,
131072, 45, 196607,
93 )
end
return mw.ustring.find( s, patternCJK ) ~= nil
end -- Text.containsCJK()
Text.removeDelimited = function (s, prefix, suffix)
-- Remove all text in s delimited by prefix and suffix (inclusive)
-- Arguments:
-- s = string to process
-- prefix = initial delimiter
-- suffix = ending delimiter
-- Returns: stripped string
s = s and tostring(s) or ""
prefix = prefix and tostring(prefix) or ""
suffix = suffix and tostring(suffix) or ""
local prefixLen = mw.ustring.len(prefix)
local suffixLen = mw.ustring.len(suffix)
if prefixLen == 0 or suffixLen == 0 then
return s
end
local i = s:find(prefix, 1, true)
local r = s
local j
while i do
j = r:find(suffix, i + prefixLen)
if j then
r = r:sub(1, i - 1)..r:sub(j+suffixLen)
else
r = r:sub(1, i - 1)
end
i = r:find(prefix, 1, true)
end
return r
end
Text.getPlain = function ( adjust )
-- Remove wikisyntax from string, except templates
-- Parameter:
-- adjust -- string
-- Returns: string
local r = Text.removeDelimited(adjust,"<!--","-->")
r = r:gsub( "(</?%l[^>]*>)", "" )
:gsub( "'''", "" )
:gsub( "''", "" )
:gsub( " ", " " )
return r
end -- Text.getPlain()
Text.isLatinRange = function (s)
-- Are characters expected to be latin or symbols within latin texts?
-- Arguments:
-- s = string to analyze
-- Returns: true, if valid for latin only
s = s and tostring(s) or "" --- ensure input is always string
initLatinData()
return mw.ustring.match(s, PatternLatin) ~= nil
end -- Text.isLatinRange()
Text.isQuote = function ( s )
-- Is this character any quotation mark?
-- Parameter:
-- s = single character to analyze
-- Returns: true, if s is quotation mark
s = s and tostring(s) or ""
if s == "" then
return false
end
if not SeekQuote then
SeekQuote = mw.ustring.char( 34, -- "
39, -- '
171, -- laquo
187, -- raquo
8216, -- lsquo
8217, -- rsquo
8218, -- sbquo
8220, -- ldquo
8221, -- rdquo
8222, -- bdquo
8249, -- lsaquo
8250, -- rsaquo
0x300C, -- CJK
0x300D, -- CJK
0x300E, -- CJK
0x300F ) -- CJK
end
return mw.ustring.find( SeekQuote, s, 1, true ) ~= nil
end -- Text.isQuote()
Text.listToText = function ( args, adapt )
-- Format list items similar to mw.text.listToText()
-- Parameter:
-- args -- table (sequence) with numKey=string
-- adapt -- string (optional); format including "%s"
-- Returns: string
return mw.text.listToText(trimAndFormat(args, adapt))
end -- Text.listToText()
Text.quote = function ( apply, alien, advance )
-- Quote text
-- Parameter:
-- apply -- string, with text
-- alien -- string, with language code, or nil
-- advance -- number, with level 1 or 2, or nil
-- Returns: quoted string
apply = apply and tostring(apply) or ""
local mode, slang
if type( alien ) == "string" then
slang = mw.text.trim( alien ):lower()
else
slang = mw.title.getCurrentTitle().pageLanguage
if not slang then
-- TODO FIXME: Introduction expected 2017-04
slang = mw.language.getContentLanguage():getCode()
end
end
if advance == 2 then
mode = 2
else
mode = 1
end
return fiatQuote( mw.text.trim( apply ), slang, mode )
end -- Text.quote()
Text.quoteUnquoted = function ( apply, alien, advance )
-- Quote text, if not yet quoted and not empty
-- Parameter:
-- apply -- string, with text
-- alien -- string, with language code, or nil
-- advance -- number, with level 1 or 2, or nil
-- Returns: string; possibly quoted
local r = mw.text.trim( apply and tostring(apply) or "" )
local s = mw.ustring.sub( r, 1, 1 )
if s ~= "" and not Text.isQuote( s, advance ) then
s = mw.ustring.sub( r, -1, 1 )
if not Text.isQuote( s ) then
r = Text.quote( r, alien, advance )
end
end
return r
end -- Text.quoteUnquoted()
Text.removeDiacritics = function ( adjust )
-- Remove all diacritics
-- Parameter:
-- adjust -- string
-- Returns: string; all latin letters should be ASCII
-- or basic greek or cyrillic or symbols etc.
local cleanup, decomposed
if not PatternCombined then
PatternCombined = mw.ustring.char( 91,
0x0300, 45, 0x036F,
0x1AB0, 45, 0x1AFF,
0x1DC0, 45, 0x1DFF,
0xFE20, 45, 0xFE2F,
93 )
end
decomposed = mw.ustring.toNFD( adjust and tostring(adjust) or "" )
cleanup = mw.ustring.gsub( decomposed, PatternCombined, "" )
return mw.ustring.toNFC( cleanup )
end -- Text.removeDiacritics()
Text.sentenceTerminated = function ( analyse )
-- Is string terminated by dot, question or exclamation mark?
-- Quotation, link termination and so on granted
-- Parameter:
-- analyse -- string
-- Returns: true, if sentence terminated
local r
if not PatternTerminated then
PatternTerminated = mw.ustring.char( 91,
12290,
65281,
65294,
65311 )
.. "!%.%?…][\"'%]‹›«»‘’“”]*$"
end
if mw.ustring.find( analyse, PatternTerminated ) then
r = true
else
r = false
end
return r
end -- Text.sentenceTerminated()
Text.ucfirstAll = function ( adjust)
-- Capitalize all words
-- Arguments:
-- adjust = string to adjust
-- Returns: string with all first letters in upper case
adjust = adjust and tostring(adjust) or ""
local r = mw.text.decode(adjust,true)
local i = 1
local c, j, m
m = (r ~= adjust)
r = " "..r
while i do
i = mw.ustring.find( r, "%W%l", i )
if i then
j = i + 1
c = mw.ustring.upper( mw.ustring.sub( r, j, j ) )
r = string.format( "%s%s%s",
mw.ustring.sub( r, 1, i ),
c,
mw.ustring.sub( r, i + 2 ) )
i = j
end
end -- while i
r = r:sub( 2 )
if m then
r = mw.text.encode(r)
end
return r
end -- Text.ucfirstAll()
Text.uprightNonlatin = function ( adjust )
-- Ensure non-italics for non-latin text parts
-- One single greek letter might be granted
-- Precondition:
-- adjust -- string
-- Returns: string with non-latin parts enclosed in <span>
local r
initLatinData()
if mw.ustring.match( adjust, PatternLatin ) then
-- latin only, horizontal dashes, quotes
r = adjust
else
local c
local j = false
local k = 1
local m = false
local n = mw.ustring.len( adjust )
local span = "%s%s<span dir='auto' style='font-style:normal'>%s</span>"
local flat = function ( a )
-- isLatin
local range
for i = 1, #RangesLatin do
range = RangesLatin[ i ]
if a >= range[ 1 ] and a <= range[ 2 ] then
return true
end
end -- for i
end -- flat()
local focus = function ( a )
-- char is not ambivalent
local r = ( a > 64 )
if r then
r = ( a < 8192 or a > 8212 )
else
r = ( a == 38 or a == 60 ) -- '&' '<'
end
return r
end -- focus()
local form = function ( a )
return string.format( span,
r,
mw.ustring.sub( adjust, k, j - 1 ),
mw.ustring.sub( adjust, j, a ) )
end -- form()
r = ""
for i = 1, n do
c = mw.ustring.codepoint( adjust, i, i )
if focus( c ) then
if flat( c ) then
if j then
if m then
if i == m then
-- single greek letter.
j = false
end
m = false
end
if j then
local nx = i - 1
local s = ""
for ix = nx, 1, -1 do
c = mw.ustring.sub( adjust, ix, ix )
if c == " " or c == "(" then
nx = nx - 1
s = c .. s
else
break -- for ix
end
end -- for ix
r = form( nx ) .. s
j = false
k = i
end
end
elseif not j then
j = i
if c >= 880 and c <= 1023 then
-- single greek letter?
m = i + 1
else
m = false
end
end
elseif m then
m = m + 1
end
end -- for i
if j and ( not m or m < n ) then
r = form( n )
else
r = r .. mw.ustring.sub( adjust, k )
end
end
return r
end -- Text.uprightNonlatin()
Text.test = function ( about )
local r
if about == "quote" then
initQuoteData()
r = { }
r.QuoteLang = QuoteLang
r.QuoteType = QuoteType
end
return r
end -- Text.test()
-- Export
local p = { }
for _, func in ipairs({'containsCJK','isLatinRange','isQuote','sentenceTerminated'}) do
p[func] = function (frame)
return Text[func]( frame.args[ 1 ] or "" ) and "1" or ""
end
end
for _, func in ipairs({'getPlain','removeDiacritics','ucfirstAll','uprightNonlatin'}) do
p[func] = function (frame)
return Text[func]( frame.args[ 1 ] or "" )
end
end
function p.char( frame )
local params = frame:getParent().args
local story = params[ 1 ]
local codes, lenient, multiple
if not story then
params = frame.args
story = params[ 1 ]
end
if story then
local items = mw.text.split( mw.text.trim(story), "%s+" )
if #items > 0 then
local j
lenient = (yesNo(params.errors) == false)
codes = { }
multiple = tonumber( params[ "*" ] )
for _, v in ipairs( items ) do
j = tonumber((v:sub( 1, 1 ) == "x" and "0" or "") .. v)
table.insert( codes, j or v )
end
end
end
return Text.char( codes, multiple, lenient )
end
function p.concatParams( frame )
local args
local template = frame.args.template
if type( template ) == "string" then
template = mw.text.trim( template )
template = ( template == "1" )
end
if template then
args = frame:getParent().args
else
args = frame.args
end
return Text.concatParams( args,
frame.args.separator,
frame.args.format )
end
function p.listToFormat(frame)
local lists = {}
local pformat = frame.args["format"]
local sep = frame.args["sep"] or ";"
-- Parameter parsen: Listen
for k, v in pairs(frame.args) do
local knum = tonumber(k)
if knum then lists[knum] = v end
end
-- Listen splitten
local maxListLen = 0
for i = 1, #lists do
lists[i] = mw.text.split(lists[i], sep)
if #lists[i] > maxListLen then maxListLen = #lists[i] end
end
-- Ergebnisstring generieren
local result = ""
local result_line = ""
for i = 1, maxListLen do
result_line = pformat
for j = 1, #lists do
result_line = mw.ustring.gsub(result_line, "%%s", lists[j][i], 1)
end
result = result .. result_line
end
return result
end
function p.listToText( frame )
local args
local template = frame.args.template
if type( template ) == "string" then
template = mw.text.trim( template )
template = ( template == "1" )
end
if template then
args = frame:getParent().args
else
args = frame.args
end
return Text.listToText( args, frame.args.format )
end
function p.quote( frame )
local slang = frame.args[2]
if type( slang ) == "string" then
slang = mw.text.trim( slang )
if slang == "" then
slang = false
end
end
return Text.quote( frame.args[ 1 ] or "",
slang,
tonumber( frame.args[3] ) )
end
function p.quoteUnquoted( frame )
local slang = frame.args[2]
if type( slang ) == "string" then
slang = mw.text.trim( slang )
if slang == "" then
slang = false
end
end
return Text.quoteUnquoted( frame.args[ 1 ] or "",
slang,
tonumber( frame.args[3] ) )
end
function p.zip(frame)
local lists = {}
local seps = {}
local defaultsep = frame.args["sep"] or ""
local innersep = frame.args["isep"] or ""
local outersep = frame.args["osep"] or ""
-- Parameter parsen
for k, v in pairs(frame.args) do
local knum = tonumber(k)
if knum then lists[knum] = v else
if string.sub(k, 1, 3) == "sep" then
local sepnum = tonumber(string.sub(k, 4))
if sepnum then seps[sepnum] = v end
end
end
end
-- sofern keine expliziten Separatoren angegeben sind, den Standardseparator verwenden
for i = 1, math.max(#seps, #lists) do
if not seps[i] then seps[i] = defaultsep end
end
-- Listen splitten
local maxListLen = 0
for i = 1, #lists do
lists[i] = mw.text.split(lists[i], seps[i])
if #lists[i] > maxListLen then maxListLen = #lists[i] end
end
local result = ""
for i = 1, maxListLen do
if i ~= 1 then result = result .. outersep end
for j = 1, #lists do
if j ~= 1 then result = result .. innersep end
result = result .. (lists[j][i] or "")
end
end
return result
end
function p.failsafe()
return Text.serial
end
p.Text = function ()
return Text
end -- p.Text
return p
07f1fc4d39342fd92bdae1c5463bbfede7eeda1a
Module:URL
828
140
289
288
2023-08-10T15:23:27Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:URL]]
Scribunto
text/plain
--
-- This module implements {{URL}}
--
-- See unit tests at [[Module:URL/testcases]]
local p = {}
local function safeUri(s)
local success, uri = pcall(function()
return mw.uri.new(s)
end)
if success then
return uri
end
end
local function extractUrl(args)
for name, val in pairs(args) do
if name ~= 2 and name ~= "msg" then
local url = name .. "=" .. val;
url = mw.ustring.gsub(url, '^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])', 'http%1://%3')
local uri = safeUri(url);
if uri and uri.host then
return url
end
end
end
end
function p._url(url, text, msg)
url = mw.text.trim(url or '')
text = mw.text.trim(text or '')
local nomsg = (msg or ''):sub(1,1):lower() == "n" or msg == 'false' -- boolean: true if msg is "false" or starts with n or N
if url == '' then
if text == '' then
if nomsg then
return nil
else
return mw.getCurrentFrame():expandTemplate{ title = 'tlx', args = { 'URL', "''example.com''", "''optional display text''" } }
end
else
return text
end
end
-- If the URL contains any unencoded spaces, encode them, because MediaWiki will otherwise interpret a space as the end of the URL.
url = mw.ustring.gsub(url, '%s', function(s) return mw.uri.encode(s, 'PATH') end)
-- If there is an empty query string or fragment id, remove it as it will cause mw.uri.new to throw an error
url = mw.ustring.gsub(url, '#$', '')
url = mw.ustring.gsub(url, '%?$', '')
-- If it's an HTTP[S] URL without the double slash, fix it.
url = mw.ustring.gsub(url, '^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])', 'http%1://%3')
local uri = safeUri(url)
-- Handle URL's without a protocol and URL's that are protocol-relative,
-- e.g. www.example.com/foo or www.example.com:8080/foo, and //www.example.com/foo
if uri and (not uri.protocol or (uri.protocol and not uri.host)) and url:sub(1, 2) ~= '//' then
url = 'http://' .. url
uri = safeUri(url)
end
if text == '' then
if uri then
if uri.path == '/' then uri.path = '' end
local port = ''
if uri.port then port = ':' .. uri.port end
text = mw.ustring.lower(uri.host or '') .. port .. (uri.relativePath or '')
-- Add <wbr> before _/.-# sequences
text = mw.ustring.gsub(text,"(/+)","<wbr/>%1") -- This entry MUST be the first. "<wbr/>" has a "/" in it, you know.
text = mw.ustring.gsub(text,"(%.+)","<wbr/>%1")
-- text = mw.ustring.gsub(text,"(%-+)","<wbr/>%1") -- DISABLED for now
text = mw.ustring.gsub(text,"(%#+)","<wbr/>%1")
text = mw.ustring.gsub(text,"(_+)","<wbr/>%1")
else -- URL is badly-formed, so just display whatever was passed in
text = url
end
end
return mw.ustring.format('<span class="url">[%s %s]</span>', url, text)
end
--[[
The main entry point for calling from Template:URL.
--]]
function p.url(frame)
local templateArgs = frame.args
local parentArgs = frame:getParent().args
local url = templateArgs[1] or parentArgs[1]
local text = templateArgs[2] or parentArgs[2] or ''
local msg = templateArgs.msg or parentArgs.msg or ''
url = url or extractUrl(templateArgs) or extractUrl(parentArgs) or ''
return p._url(url, text, msg)
end
--[[
The entry point for calling from the forked Template:URL2.
This function returns no message by default.
It strips out wiki-link markup, html tags, and everything after a space.
--]]
function p.url2(frame)
local templateArgs = frame.args
local parentArgs = frame:getParent().args
local url = templateArgs[1] or parentArgs[1]
local text = templateArgs[2] or parentArgs[2] or ''
-- default to no message
local msg = templateArgs.msg or parentArgs.msg or 'no'
url = url or extractUrl(templateArgs) or extractUrl(parentArgs) or ''
-- if the url came from a Wikidata call, it might have a pen icon appended
-- we want to keep that and add it back at the end.
local u1, penicon = mw.ustring.match( url, "(.*)( <span class='penicon.*)" )
if penicon then url = u1 end
-- strip out html tags and [ ] from url
url = (url or ''):gsub("<[^>]*>", ""):gsub("[%[%]]", "")
-- truncate anything after a space
url = url:gsub("%%20", " "):gsub(" .*", "")
return (p._url(url, text, msg) or "") .. (penicon or "")
end
return p
8d7a4c6fe04a01815e940475cf64b28e1ef48cfb
Template:Collapsible list
10
141
291
290
2023-08-10T15:23:28Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Collapsible_list]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:collapsible list|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
aff61df28bcc6c3457d6aa36ada4fffe68c409a9
Module:Collapsible list
828
142
293
292
2023-08-10T15:23:28Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Collapsible_list]]
Scribunto
text/plain
local p = {}
local function getListItem( data )
if not type( data ) == 'string' then
return ''
end
return mw.ustring.format( '<li style="line-height: inherit; margin: 0">%s</li>', data )
end
-- Returns an array containing the keys of all positional arguments
-- that contain data (i.e. non-whitespace values).
local function getArgNums( args )
local nums = {}
for k, v in pairs( args ) do
if type( k ) == 'number' and
k >= 1 and
math.floor( k ) == k and
type( v ) == 'string' and
mw.ustring.match( v, '%S' ) then
table.insert( nums, k )
end
end
table.sort( nums )
return nums
end
-- Formats a list of classes, styles or other attributes.
local function formatAttributes( attrType, ... )
local attributes = { ... }
local nums = getArgNums( attributes )
local t = {}
for i, num in ipairs( nums ) do
table.insert( t, attributes[ num ] )
end
if #t == 0 then
return '' -- Return the blank string so concatenation will work.
end
return mw.ustring.format( ' %s="%s"', attrType, table.concat( t, ' ' ) )
end
-- TODO: use Module:List. Since the update for this comment is routine,
-- this is blocked without a consensus discussion by
-- [[MediaWiki_talk:Common.css/Archive_15#plainlist_+_hlist_indentation]]
-- if we decide hlist in plainlist in this template isn't an issue, we can use
-- module:list directly
-- [https://en.wikipedia.org/w/index.php?title=Module:Collapsible_list/sandbox&oldid=1130172480]
-- is an implementation (that will code rot slightly I expect)
local function buildList( args )
-- Get the list items.
local listItems = {}
local argNums = getArgNums( args )
for i, num in ipairs( argNums ) do
table.insert( listItems, getListItem( args[ num ] ) )
end
if #listItems == 0 then
return ''
end
listItems = table.concat( listItems )
-- hack around mw-collapsible show/hide jumpiness by looking for text-alignment
-- by setting a margin if centered
local textAlignmentCentered = 'text%-align%s*:%s*center'
local centeredTitle = (args.title_style and args.title_style:lower():match(textAlignmentCentered)
or args.titlestyle and args.titlestyle:lower():match(textAlignmentCentered))
local centeredTitleSpacing
if centeredTitle then
centeredTitleSpacing = 'margin: 0 4em'
else
centeredTitleSpacing = ''
end
-- Get class, style and title data.
local collapsibleContainerClass = formatAttributes(
'class',
'collapsible-list',
'mw-collapsible',
not args.expand and 'mw-collapsed'
)
local collapsibleContainerStyle = formatAttributes(
'style',
-- mostly work around .infobox-full-data defaulting to centered
'text-align: left;',
args.frame_style,
args.framestyle
)
local collapsibleTitleStyle = formatAttributes(
'style',
'line-height: 1.6em; font-weight: bold;',
args.title_style,
args.titlestyle
)
local jumpyTitleStyle = formatAttributes(
'style',
centeredTitleSpacing
)
local title = args.title or 'List'
local ulclass = formatAttributes( 'class', 'mw-collapsible-content', args.hlist and 'hlist' )
local ulstyle = formatAttributes(
'style',
'margin-top: 0; margin-bottom: 0; line-height: inherit;',
not args.bullets and 'list-style: none; margin-left: 0;',
args.list_style,
args.liststyle
)
local hlist_templatestyles = ''
if args.hlist then
hlist_templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Hlist/styles.css' }
}
end
-- Build the list.
return mw.ustring.format(
'%s<div%s%s>\n<div%s><div%s>%s</div></div>\n<ul%s%s>%s</ul>\n</div>',
hlist_templatestyles, collapsibleContainerClass, collapsibleContainerStyle,
collapsibleTitleStyle, jumpyTitleStyle, title, ulclass, ulstyle, listItems
)
end
function p.main( frame )
local origArgs
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
for k, v in pairs( frame.args ) do
origArgs = frame.args
break
end
else
origArgs = frame
end
local args = {}
for k, v in pairs( origArgs ) do
if type( k ) == 'number' or v ~= '' then
args[ k ] = v
end
end
return buildList( args )
end
return p
5b7e779e7529bcb12a219726ef6c948ea98874fd
Template:Birth date and age
10
143
295
294
2023-08-10T15:23:29Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Birth_date_and_age]]
wikitext
text/x-wiki
<includeonly>{{{{{♥|safesubst:}}}#invoke:age|birth_date_and_age}}{{#invoke:Check for unknown parameters|check|ignoreblank=y|preview=Page using [[Template:Birth date and age]] with unknown parameter "_VALUE_"|unknown={{main other|[[Category:Pages using birth date and age template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|1|2|3|day|month|year|df|mf}}{{#ifeq: {{NAMESPACENUMBER}} | 0
| {{#if: {{#invoke:wd|label|raw}}
| {{#if: {{#invoke:String|match|{{#invoke:wd|properties|raw|P31}},|Q5,|1|1|true|}}
| {{#if: {{#invoke:wd|properties|raw|P569}}
|
| [[Category:Date of birth not in Wikidata]]
}}
}}
| [[Category:Articles without Wikidata item]]
}}
}}</includeonly><noinclude>{{documentation}}</noinclude>
55c7a1b79d4b09cf1b1c81565ac2bd7da422612e
Template:Hr
10
144
297
296
2023-08-10T15:23:29Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Hr]]
wikitext
text/x-wiki
<includeonly>{{#if:{{{1|}}}
|<hr style="height:{{{1}}}px" />
|<hr />
}}</includeonly><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage and interwikis to Wikidata. -->
</noinclude>
c603f73ed9385fb902bbaac80bd15ba89e91f37f
Template:Str left
10
145
299
298
2023-08-10T15:23:29Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Str_left]]
wikitext
text/x-wiki
<includeonly>{{safesubst:padleft:|{{{2|1}}}|{{{1}}}}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
2048b0d7b35e156528655b1d090e8b5ffab3f400
Module:TNT
828
146
301
300
2023-08-10T15:23:30Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:TNT]]
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
-- Forward declaration of the local functions
local sanitizeDataset, loadData, link, formatMessage
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
table.insert(params, mw.text.trim(v))
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Identical to p.msg() above, but used from other lua modules
-- Parameters: name of dataset, message key, optional arguments
-- Example with 2 params: format('I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.format(dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
return formatMessage(dataset, key, {...})
end
-- Identical to p.msg() above, but used from other lua modules with the language param
-- Parameters: language code, name of dataset, message key, optional arguments
-- Example with 2 params: formatInLanguage('es', I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.formatInLanguage(lang, dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('formatInLanguage', 1, lang, 'string')
checkType('formatInLanguage', 2, dataset, 'string')
checkType('formatInLanguage', 3, key, 'string')
return formatMessage(dataset, key, {...}, lang)
end
-- Obsolete function that adds a 'c:' prefix to the first param.
-- "Sandbox/Sample.tab" -> 'c:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
function p.doc(frame)
local dataset = 'Templatedata/' .. sanitizeDataset(frame.args[1])
return frame:extensionTag('templatedata', p.getTemplateData(dataset)) ..
formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(dataset)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in pairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in pairs(data.data) do
local newVal = {}
local name = nil
for pos, val in pairs(row) do
local columnName = names[pos]
if columnName == 'name' then
name = val
else
newVal[columnName] = val
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
-- Local functions
sanitizeDataset = function(dataset)
if not dataset then
return nil
end
dataset = mw.text.trim(dataset)
if dataset == '' then
return nil
elseif string.sub(dataset,-4) ~= '.tab' then
return dataset .. '.tab'
else
return dataset
end
end
loadData = function(dataset, lang)
dataset = sanitizeDataset(dataset)
if not dataset then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
end
-- Give helpful error to thirdparties who try and copy this module.
if not mw.ext or not mw.ext.data or not mw.ext.data.get then
error('Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:' .. dataset)
end
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(formatMessage(i18nDataset, 'error_bad_dataset', {link(dataset)}))
end
end
return data
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
return 'c:Data:' .. mw.text.trim(dataset or '')
end
formatMessage = function(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params or {}))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(formatMessage(i18nDataset, 'error_bad_msgkey', {key, link(dataset)}))
end
end
return p
9d0d10e54abd232c806dcabccaf03e52858634a1
Template:Remove first word
10
147
303
302
2023-08-10T15:23:30Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Remove_first_word]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:String|replace|source={{{1}}}|pattern=^[^{{{sep|%s}}}]*{{{sep|%s}}}*|replace=|plain=false}}<noinclude>{{Documentation}}</noinclude>
df7a9e692f68be1581be06af5f51eaed5483b4c8
Template:Url
10
148
305
304
2023-08-10T15:23:31Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Url]]
wikitext
text/x-wiki
#REDIRECT [[Template:URL]]
18785dfd06e0aad86a368375896bc1a4a5be1fc4
Template:Plain text
10
149
307
306
2023-08-10T15:23:31Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Plain_text]]
wikitext
text/x-wiki
<noinclude>{{pp-template|small=yes}}</noinclude>{{#invoke:Plain text|main|{{{1|}}}}}<noinclude>
{{documentation}}
</noinclude>
a314b48913b9772c90a2ace218da4d833852e757
Template:Rounddown
10
150
309
308
2023-08-10T15:23:33Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Rounddown]]
wikitext
text/x-wiki
<includeonly>{{SAFESUBST:<noinclude />#expr:floor(({{{1}}})*10^({{{2|0}}}))/10^({{{2|0}}})}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
b42fa12eaa65e5d614703a4bb3cee65cb2119aa2
Template:Sum
10
151
311
310
2023-08-10T15:23:34Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Sum]]
wikitext
text/x-wiki
<includeonly>{{#invoke:math|sum}}</includeonly><noinclude>
{{documentation}}
</noinclude>
163107e11b86304c79ebed4d9f51fda3611d3f75
Module:Parameter names example
828
152
313
312
2023-08-10T15:23:35Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Parameter_names_example]]
Scribunto
text/plain
-- This module implements {{parameter names example}}.
local p = {}
local function makeParam(s)
local lb = '{'
local rb = '}'
return lb:rep(3) .. s .. rb:rep(3)
end
local function italicize(s)
return "''" .. s .. "''"
end
local function plain(s)
return s
end
function p._main(args, frame)
-- Find how we want to format the arguments to the template.
local formatFunc
if args._display == 'italics' or args._display == 'italic' then
formatFunc = italicize
elseif args._display == 'plain' then
formatFunc = plain
else
formatFunc = makeParam
end
-- Build the table of template arguments.
local targs = {}
for k, v in pairs(args) do
if type(k) == 'number' then
targs[v] = formatFunc(v)
elseif not k:find('^_') then
targs[k] = v
end
end
--targs['nocat'] = 'yes';
--targs['categories'] = 'no';
--targs['demo'] = 'yes';
-- Find the template name.
local template
if args._template then
template = args._template
else
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.prefixedText:find('/sandbox$') then
template = currentTitle.prefixedText
else
template = currentTitle.basePageTitle.prefixedText
end
end
-- Call the template with the arguments.
frame = frame or mw.getCurrentFrame()
local success, result = pcall(
frame.expandTemplate,
frame,
{title = template, args = targs}
)
if success then
return result
else
return ''
end
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Parameter names example'
})
return p._main(args, frame)
end
return p
fdf94fb7a5dc1fabf118d60488a02f1e65b0df24
Template:Parameter names example
10
153
315
314
2023-08-10T15:23:36Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Parameter_names_example]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Parameter names example|main}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
de1e29d6ebc113e9d1649ea6a976625885db8a2f
Template:Template shortcut
10
154
317
316
2023-08-10T15:23:37Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Template_shortcut]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Shortcut|main|template=yes}}</includeonly><noinclude>{{Documentation}}</noinclude>
bfb2889c4c0ec36294b7b667f5e03350d2df680e
Template:Uses TemplateStyles
10
155
319
318
2023-08-10T15:23:37Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Uses_TemplateStyles]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Uses TemplateStyles|main}}</includeonly><noinclude>{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
60f2fc73c4d69b292455879f9fcb3c68f6c63c2a
Module:Uses TemplateStyles
828
156
321
320
2023-08-10T15:23:38Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Uses_TemplateStyles]]
Scribunto
text/plain
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local TNT = require('Module:TNT')
local p = {}
local function format(msg, ...)
return TNT.format('I18n/Uses TemplateStyles', msg, ...)
end
local function getConfig()
return mw.loadData('Module:Uses TemplateStyles/config')
end
local function renderBox(tStyles)
local boxArgs = {
type = 'notice',
small = true,
image = string.format('[[File:Farm-Fresh css add.svg|32px|alt=%s]]', format('logo-alt'))
}
if #tStyles < 1 then
boxArgs.text = string.format('<strong class="error">%s</strong>', format('error-emptylist'))
else
local cfg = getConfig()
local tStylesLinks = {}
for i, ts in ipairs(tStyles) do
local link = string.format('[[:%s]]', ts)
local sandboxLink = nil
local tsTitle = mw.title.new(ts)
if tsTitle and cfg['sandbox_title'] then
local tsSandboxTitle = mw.title.new(string.format(
'%s:%s/%s/%s', tsTitle.nsText, tsTitle.baseText, cfg['sandbox_title'], tsTitle.subpageText))
if tsSandboxTitle and tsSandboxTitle.exists then
sandboxLink = format('sandboxlink', link, ':' .. tsSandboxTitle.prefixedText)
end
end
tStylesLinks[i] = sandboxLink or link
end
local tStylesList = mList.makeList('bulleted', tStylesLinks)
boxArgs.text = format(
mw.title.getCurrentTitle():inNamespaces(828,829) and 'header-module' or 'header-template') ..
'\n' .. tStylesList
end
return mMessageBox.main('mbox', boxArgs)
end
local function renderTrackingCategories(args, tStyles, titleObj)
if yesno(args.nocat) then
return ''
end
local cfg = getConfig()
local cats = {}
-- Error category
if #tStyles < 1 and cfg['error_category'] then
cats[#cats + 1] = cfg['error_category']
end
-- TemplateStyles category
titleObj = titleObj or mw.title.getCurrentTitle()
if (titleObj.namespace == 10 or titleObj.namespace == 828)
and not cfg['subpage_blacklist'][titleObj.subpageText]
then
local category = args.category or cfg['default_category']
if category then
cats[#cats + 1] = category
end
if not yesno(args.noprotcat) and (cfg['protection_conflict_category'] or cfg['padlock_pattern']) then
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
local addedLevelCat = false
local addedPadlockCat = false
for i, ts in ipairs(tStyles) do
local tsTitleObj = mw.title.new(ts)
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
if cfg['padlock_pattern'] and tsProt and not addedPadlockCat then
local content = tsTitleObj:getContent()
if not content:find(cfg['padlock_pattern']) then
cats[#cats + 1] = cfg['missing_padlock_category']
addedPadlockCat = true
end
end
if cfg['protection_conflict_category'] and currentProt and tsProt ~= currentProt and not addedLevelCat then
currentProt = cfg['protection_hierarchy'][currentProt] or 0
tsProt = cfg['protection_hierarchy'][tsProt] or 0
if tsProt < currentProt then
addedLevelCat = true
cats[#cats + 1] = cfg['protection_conflict_category']
end
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
function p._main(args, cfg)
local tStyles = mTableTools.compressSparseArray(args)
local box = renderBox(tStyles)
local trackingCategories = renderTrackingCategories(args, tStyles)
return box .. trackingCategories
end
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
return p
71ca57c37849f38e3c5ee30061bdae730963e48e
Module:Uses TemplateStyles/config
828
157
323
322
2023-08-10T15:23:38Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:Uses_TemplateStyles/config]]
Scribunto
text/plain
local cfg = {} -- Don’t touch this line.
-- Subpage blacklist: these subpages will not be categorized (except for the
-- error category, which is always added if there is an error).
-- For example “Template:Foo/doc” matches the `doc = true` rule, so it will have
-- no categories. “Template:Foo” and “Template:Foo/documentation” match no rules,
-- so they *will* have categories. All rules should be in the
-- ['<subpage name>'] = true,
-- format.
cfg['subpage_blacklist'] = {
['doc'] = true,
['sandbox'] = true,
['sandbox2'] = true,
['testcases'] = true,
}
-- Sandbox title: if the stylesheet’s title is <template>/<stylesheet>.css, the
-- stylesheet’s sandbox is expected to be at <template>/<sandbox_title>/<stylesheet>.css
-- Set to nil to disable sandbox links.
cfg['sandbox_title'] = 'sandbox'
-- Error category: this category is added if the module call contains errors
-- (e.g. no stylesheet listed). A category name without namespace, or nil
-- to disable categorization (not recommended).
cfg['error_category'] = 'Uses TemplateStyles templates with errors'
-- Default category: this category is added if no custom category is specified
-- in module/template call. A category name without namespace, or nil
-- to disable categorization.
cfg['default_category'] = 'Templates using TemplateStyles'
-- Protection conflict category: this category is added if the protection level
-- of any stylesheet is lower than the protection level of the template. A category name
-- without namespace, or nil to disable categorization (not recommended).
cfg['protection_conflict_category'] = 'Templates using TemplateStyles with a different protection level'
-- Hierarchy of protection levels, used to determine whether one protection level is lower
-- than another and thus should populate protection_conflict_category. No protection is treated as zero
cfg['protection_hierarchy'] = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
-- Padlock pattern: Lua pattern to search on protected stylesheets for, or nil
-- to disable padlock check.
cfg['padlock_pattern'] = '{{pp-'
-- Missing padlock category: this category is added if a protected stylesheet
-- doesn’t contain any padlock template (specified by the above Lua pattern).
-- A category name without namespace (no nil allowed) if the pattern is not nil,
-- unused (and thus may be nil) otherwise.
cfg['missing_padlock_category'] = 'Templates using TemplateStyles without padlocks'
return cfg -- Don’t touch this line.
58e7a37c44f6ea3f6b8af54a559d696cc7256493
Template:Infobox Twitch streamer
10
158
325
324
2023-08-10T15:23:39Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Infobox_Twitch_streamer]]
wikitext
text/x-wiki
{{Infobox
| child = {{Yesno|{{{subbox|{{{embed|}}}}}}}}
| templatestyles = Template:Infobox Twitch streamer/styles.css
| bodyclass = ib-twitch biography vcard
| title = {{#if:{{Yesno|{{{subbox|{{{embed|}}}}}}}}|<div {{#if:{{Yesno|{{{subbox|}}}}}|class="ib-twitch-title"}}>'''Twitch information'''</div>}}
| aboveclass = ib-twitch-above
| above = {{#if:{{Yesno|{{{subbox|{{{embed|}}}}}}}}||{{br separated entries
|1={{#if:{{{honorific prefix|{{{honorific_prefix|}}}}}}|<span class="honorific-prefix">{{{honorific prefix|{{{honorific_prefix|}}}}}}</span>}}
|2=<span class="fn">{{{name|{{PAGENAMEBASE}}}}}</span>
|3={{#if:{{{honorific suffix|{{{honorific_suffix|}}}}}}|<span class="honorific-suffix">{{{honorific suffix|{{{honorific_suffix|}}}}}}</span>}}
}}
}}
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{logo|}}}|size={{{logo_size|}}}|sizedefault=250px|alt={{{logo_alt|}}}}}
| caption = {{{logo caption|{{{logo_caption|}}}}}}
| image2 = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image size|{{{image_size|{{{imagesize|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|{{{upright|1}}}}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
| caption2 = {{{image caption|{{{caption|{{{image_caption|}}}}}}}}}
| headerclass = ib-twitch-header
| header1 = {{#if:{{{birth_name|}}}{{{birth_date|}}}{{{birth_place|}}}{{{death_date|}}}{{{death_place|}}}{{{nationality|}}}{{{occupation|{{{occupations|}}}}}}|Personal information}}
| label2 = Born
| data2 = {{br separated entries|1={{#if:{{{birth_name|}}}|<div class="nickname">{{{birth_name}}}</div>}}|2={{{birth_date|}}}|3={{#if:{{{birth_place|}}}|<div class="birthplace">{{{birth_place}}}</div>}}}}
| label3 = Died
| data3 = {{br separated entries|1={{{death_date|}}}|2={{#if:{{{death_place|}}}|<div class="deathplace">{{{death_place}}}</div>}}}}
| label4 = Origin
| data4 = {{{origin|}}}
| label5 = Nationality
| data5 = {{{nationality|}}}
| class5 = category
| label6 = Other names
| data6 = {{{other_names|}}}
| class6 = nickname
| label7 = Education
| data7 = {{{education|}}}
| label8 = Occupation{{#if:{{{occupations|}}}|s|{{Pluralize from text|{{{occupation|}}}|likely=(s)|plural=s}}}}
| data8 = {{{occupation|{{{occupations|}}}}}}
| class8 = role
| label9 = Spouse{{#if:{{{spouses|}}}|s|{{Pluralize from text|{{{spouse|}}}|likely=(s)|plural=s}}}}
| data9 = {{{spouse|{{{spouses|}}}}}}
| label10 = Partner{{#if:{{{partners|}}}|s|{{Pluralize from text|{{{partner|}}}|likely=(s)|plural=s}}}}
| data10 = {{{partner|{{{partners|}}}}}}
| label11 = Children
| data11 = {{{children|}}}
| label12 = Parent{{if either|{{{parents|}}}|{{if both|{{{mother|}}}|{{{father|}}}|true}}|s|{{Pluralize from text|{{{parent|}}}|likely=(s)|plural=s}}}}
| data12 = {{#if:{{{parent|{{{parents|}}}}}}|{{{parent|{{{parents}}}}}}|{{Unbulleted list|{{#if:{{{father|}}}|{{{father}}} (father)}}|{{#if:{{{mother|}}}|{{{mother}}} (mother)}}}}}}
| label13 = Relatives
| data13 = {{{relatives|}}}
| label14 = Organi{{#if:{{{organisation|{{{organisations|}}}}}}|s|z}}ation{{#if:{{{organizations|{{{organisations|}}}}}}|s|{{pluralize from text|{{{organization|{{{organisation|{{{teams|}}}}}}}}}|likely=(s)|plural=s}}}}
| data14 = {{{organization|{{{organisation|{{{organizations|{{{organisations|{{{teams|}}}}}}}}}}}}}}}
| class14 = org
| label15 = Signature
| data15 = {{#if:{{{signature|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{signature|}}}|size={{{signature_size|}}}|sizedefault=150px|alt={{{signature alt|{{{signature_alt|}}}}}}}} }}
| label16 = Website
| data16 = {{{website|{{{homepage|{{{URL|}}}}}}}}}
| data17 = {{{module_personal|}}}
| header20 = {{#if:{{Yesno|{{{subbox|{{{embed|}}}}}}}}||{{#if:{{{pseudonym|}}}{{{channel_name|{{{channel_url|}}}}}}{{{channels|}}}{{{years active|{{{years_active|{{{yearsactive|}}}}}}}}}{{{genre|{{{genres|}}}}}}{{{game|{{{games|}}}}}}{{{followers|}}}|Twitch information}}}}
| label21 = {{Nowrap|Also known as}}
| data21 = {{{pseudonym|}}}
| class21 = nickname
| label22 = Channel{{#if:{{{channels|}}}{{{channel_name2|{{{channel_url2|}}}}}}|s}}
| data22 = {{#if:{{{channel_name|{{{channel_url|}}}}}}|{{flatlist|
* [https://www.twitch.tv/{{{channel_name|{{{channel_url|}}}}}} {{if empty|{{{channel_display_name|}}}|{{{channel_name|{{{channel_url}}}}}}}}]{{#if:{{{channel_name2|{{{channel_url2|}}}}}}|
* [https://www.twitch.tv/{{{channel_name2|{{{channel_url2}}}}}} {{if empty|{{{channel_display_name2|}}}|{{{channel_name2|{{{channel_url2}}}}}}}}]{{#if:{{{channel_name3|{{{channel_url3|}}}}}}|
* [https://www.twitch.tv/{{{channel_name3|{{{channel_url3}}}}}} {{if empty|{{{channel_display_name3|}}}|{{{channel_name3|{{{channel_url3}}}}}}}}]}} }} }}|{{{channels|}}} }}
| label23 = Created by
| data23 = {{{creator|{{{creators|{{{created_by|}}}}}}}}}
| label24 = Presented by
| data24 = {{{presenter|{{{presenters|{{{presented_by|}}}}}}}}}
| label25 = Location
| data25 = {{{location|}}}
| label26 = Years active
| data26 = {{{years active|{{{years_active|{{{yearsactive|}}}}}}}}}
| label27 = Genre{{#if:{{{genres|}}}|s|{{Pluralize from text|{{{genre|}}}|likely=(s)|plural=s}}}}
| data27 = {{{genre|{{{genres|}}}}}}
| label28 = Game{{#if:{{{games|}}}|s|{{Pluralize from text|{{{game|}}}|likely=(s)|plural=s}}}}
| data28 = {{{game|{{{games|}}}}}}
| label29 = Followers
| data29 = {{br separated entries|1={{{followers|}}}|2={{#if:{{{follower_date|}}}|({{{follower_date}}})}}}}
| label30 = Contents are in
| data30 = {{{language|}}}
| label31 = Associated acts
| data31 = {{{associated_acts|}}}
| label32 = Website
| data32 = {{{channel_website|}}}
| data50 = {{{module|{{{module1|}}}}}}
| data51 = {{{module2|}}}
| belowclass = ib-twitch-below
| below = {{#if:{{{stats_update|}}}|<hr>''Last updated:'' {{{stats_update}}}}}{{#if:{{{extra_information|}}}|{{hr}}{{{extra_information}}}}}
}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox Twitch streamer with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox Twitch streamer]] with unknown parameter "_VALUE_"|ignoreblank=y| alt | associated_acts | birth_date | birth_name | birth_place | caption | channel_name | channel_name2 | channel_name3 | channel_url | channel_url2 | channel_url3 | channel_display_name | channel_display_name2 | channel_display_name3 | channel_website | channels | children | created_by | creator | creators | death_date | death_place | education | embed | extra_information | father | follower_date | followers | game | games | genre | genres | homepage | honorific prefix | honorific suffix | honorific_prefix | honorific_suffix | image | image caption | image size | image_caption | image_size | image_upright | imagesize | language | location | logo | logo caption | logo_caption | logo_alt | logo_size | module | module_personal | module1 | module2 | mother | name | nationality | occupation | occupations | organisation | organisations | organization | organizations | origin | other_names | parent | parents | partner | partners | presented_by | presenter | presenters | pseudonym | subbox | signature | signature alt | signature_alt | signature_size | spouse | spouses | relatives | stats_update | teams | upright | URL | website | years active | years_active | yearsactive }}<noinclude>{{documentation}}</noinclude>
e269d60e41be2b6e1abd76da00d3b204c4645eba
Template:When on basepage
10
159
327
326
2023-08-10T15:23:40Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:When_on_basepage]]
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "page" parameter then detect
basepage/subpage/subsubpage-->
{{#if:{{{page|}}}
| {{#if:{{#titleparts:{{{page}}}|0|3}}
| subsubpage <!--Subsubpage or lower-->
| {{#if:{{#titleparts:{{{page}}}|0|2}}
| subpage
| basepage
}}
}}
| {{#if:{{#titleparts:{{FULLPAGENAME}}|0|3}}
| subsubpage <!--Subsubpage or lower-->
| {{#if:{{#titleparts:{{FULLPAGENAME}}|0|2}}
| subpage
| basepage
}}
}}
}}
| basepage = {{{1|}}}
| subpage = {{{2|}}}
| subsubpage = {{{3| {{{2|}}} }}} <!--Respecting empty parameter on purpose-->
}}<!--End switch--><noinclude>
{{Documentation}}
</noinclude>
cf4dc92df647a26ab0ce149772a1fe3ac6c3dfc0
Template:Basepage subpage
10
160
329
328
2023-08-10T15:23:40Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Basepage_subpage]]
wikitext
text/x-wiki
#REDIRECT [[Template:When on basepage]]
{{Redirect category shell|
{{R from move}}
{{R from template shortcut}}
}}
47118a1bed1942b7f143cdff1dec183002fc9f4b
Template:If either
10
161
331
330
2023-08-10T15:23:41Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:If_either]]
wikitext
text/x-wiki
{{#if:{{{1|}}}
|{{{then|{{{3|}}}}}}
|{{#if:{{{2|}}}
|{{{then|{{{3|}}}}}}
|{{{else|{{{4|}}}}}}
}}
}}<noinclude>
{{Documentation}}
</noinclude>
13d04801b797d6d74d49ef61d8700ad733d481ea
Template:Infobox YouTube personality/doc
10
162
333
332
2023-08-10T15:23:44Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Infobox_YouTube_personality/doc]]
wikitext
text/x-wiki
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AT THE BOTTOM OF THIS PAGE -->
{{WikiProject YouTube/Used Template}}
{{Template shortcut|Infobox YouTube|Infobox YouTuber|Infobox YouTube channel}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters|Module:YouTubeSubscribers}}
{{Uses TemplateStyles|Template:Infobox YouTube personality/styles.css}}
This infobox is intended to be used in articles about [[YouTube]] personalities, rather than using the generic {{tl|Infobox person}} template. The template may be used for individual YouTube personalities or collective YouTube channels run by more than one person.
== Usage ==
The infobox may be added by pasting the template as shown below into an article and then filling in the desired fields. Any parameters left blank or omitted will not be displayed.
=== Blank template with basic parameters ===
{{Parameter names example |name |image=Pessoa Neutra.svg |caption
|birth_name |birth_date |birth_place |death_date |death_place |nationality
|other_names |occupation |organization |website
|pseudonym |channel_name |years_active |genre |subscribers |views |network |associated_acts |language
|silver_year |gold_year |diamond_year |ruby_year |red_diamond_year |stats_update
}}
This blank template pattern shows some basic parameters needed to fill the infobox, with comments about many parameters. For actual examples, see the section "[[#Examples|Examples]]" below.
<syntaxhighlight lang="wikitext" style="overflow:auto; line-height:1.2em;">
{{Infobox YouTube personality
| name =
| image = <!-- filename only, no "File:" or "Image:" prefix, and no enclosing [[brackets]] -->
| caption =
| birth_name = <!-- use only if different from "name" -->
| birth_date = <!-- {{Birth date and age|YYYY|MM|DD}} -->
| birth_place =
| death_date = <!-- {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} (DEATH date then BIRTH date) -->
| death_place =
| nationality = <!-- use only when necessary per [[WP:INFONAT]] -->
| other_names =
| occupation =
| organization =
| website = <!-- official website of the personality. format: {{URL|example.com}} -->
| pseudonym =
<!-- THE FOLLOWING THREE PARAMETERS ARE INTERCHANGEABLE; USE ONLY ONE -->
| channel_name = <!-- primary channel, enter ONLY what comes after www.youtube.com/user/ -->
| channel_url = <!-- primary channel, enter ONLY what comes after www.youtube.com/channel/ -->
| channel_direct_url = <!-- primary channel, enter ONLY what comes after www.youtube.com/ -->
| channel_display_name = <!-- if the primary channel's display name differs from "channel_(name/url/direct_url)" -->
| years_active = <!-- year of channel's creation until its discontinuation or present day -->
| genre =
| subscribers =
| views =
| network =
| language = <!-- the channel's primary language(s) -->
| associated_acts =
| silver_year = <!-- year the channel reached 100,000 subscribers. if not known, use "silver_button=yes" instead -->
| gold_year = <!-- year the channel reached 1,000,000 subscribers. if not known, use "gold_button=yes" instead -->
| diamond_year = <!-- year the channel reached 10,000,000 subscribers. if not known, use "diamond_button=yes" instead -->
| ruby_year = <!-- year the channel reached 50,000,000 subscribers. if not known, use "ruby_button=yes" instead -->
| red_diamond_year = <!-- year the channel reached 100,000,000 subscribers. if not known, use "red_diamond_button=yes" instead -->
| stats_update = <!-- date of given channel statistics -->
}}
</syntaxhighlight>
{{Clear}}
=== Blank template with all parameters ===
{{Parameter names example|honorific_prefix|name|honorific_suffix|logo|logo_size|logo_alt|logo_caption|image|image_upright|alt|caption|birth_name|birth_date|birth_place|death_date|death_place|origin|nationality|other_names|education|occupation|spouse|partner|children|parents|relatives|organization|signature|signature_size|signature_alt|website|module_personal|pseudonym|channel_name|channel_display_name|creator|presenter|location|years_active|genre|subscribers|subscriber_date|views|view_date|network|language|associated_acts|channel_website|silver_year|gold_year|diamond_year|ruby_year|red_diamond_year|module|stats_update|extra_information}}
Only the most pertinent information should be included. Please remove unused parameters, and refrain from inserting dubious trivia in an attempt to fill all parameters.
<syntaxhighlight lang="wikitext" style="overflow:auto; line-height:1.2em;">
{{Infobox YouTube personality
| honorific_prefix =
| name =
| honorific_suffix =
| logo = <!-- filename only, no "File:" or "Image:" prefix, and no enclosing [[brackets]] -->
| logo_size =
| logo_alt =
| logo_caption =
| image = <!-- filename only, no "File:" or "Image:" prefix, and no enclosing [[brackets]] -->
| image_upright =
| alt =
| caption =
| birth_name = <!-- use only if different from "name" -->
| birth_date = <!-- {{Birth date and age|YYYY|MM|DD}} -->
| birth_place =
| death_date = <!-- {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} (DEATH date then BIRTH date) -->
| death_place =
| origin = <!-- use for groups or companies -->
| nationality = <!-- use only when necessary per [[WP:INFONAT]] -->
| other_names =
| education =
| occupation =
| spouse =
| partner = <!-- unmarried long-term partner -->
| children =
| parents =
| mother =
| father =
| relatives =
| organization =
| signature =
| signature_size =
| signature_alt =
| website = <!-- official website of the personality. format: {{URL|example.com}} -->
| module_personal =
| pseudonym =
<!-- THE FOLLOWING THREE PARAMETERS ARE INTERCHANGEABLE; USE ONLY ONE -->
| channel_name = <!-- primary channel, enter ONLY what comes after www.youtube.com/user/ -->
| channel_url = <!-- primary channel, enter ONLY what comes after www.youtube.com/channel/ -->
| channel_direct_url = <!-- primary channel, enter ONLY what comes after www.youtube.com/ -->
<!-- DO NOT LINK TO SECONDARY CHANNELS UNLESS COVERED BY RELIABLE SOURCES IN THE BODY OF THE ARTICLE. SEE WP:ELMIN, WP:RS -->
| channel_name2 = <!-- second channel, enter ONLY what comes after www.youtube.com/user/ -->
| channel_url2 = <!-- second channel, enter ONLY what comes after www.youtube.com/channel/ -->
| channel_direct_url2 = <!-- second channel, enter ONLY what comes after www.youtube.com/ -->
| channel_name3 = <!-- third channel, enter ONLY what comes after www.youtube.com/user/ -->
| channel_url3 = <!-- third channel, enter ONLY what comes after www.youtube.com/channel/ -->
| channel_direct_url3 = <!-- third channel, enter ONLY what comes after www.youtube.com/ -->
| channel_display_name = <!-- if the primary channel's display name differs from "channel_(name/url/direct_url)" -->
| channel_display_name2 = <!-- if the second channel's display name differs from "channel_(name2/url2/direct_url2)" -->
| channel_display_name3 = <!-- if the third channel's display name differs from "channel_(name3/url3/direct_url3)" -->
| channels =
| creator =
| presenter =
| location = <!-- use only when the channel's location is notable, not for mere residence -->
| years_active = <!-- year of channel's creation until its discontinuation or present day -->
| genre =
| subscribers =
| subscriber_date = <!-- date of given subscriber count -->
| views =
| view_date = <!-- date of given view count -->
| network =
| language = <!-- the channel's primary language(s) -->
| associated_acts =
| channel_website = <!-- official website of the channel. format: {{URL|example.com}} -->
| silver_year = <!-- year the channel reached 100,000 subscribers -->
| silver_button = <!-- yes; only if the year the channel reached 100,000 subscribers is not known -->
| gold_year = <!-- year the channel reached 1,000,000 subscribers -->
| gold_button = <!-- yes; only if the year the channel reached 1,000,000 subscribers is not known -->
| diamond_year = <!-- year the channel reached 10,000,000 subscribers -->
| diamond_button = <!-- yes; only if the year the channel reached 10,000,000 subscribers is not known -->
| ruby_year = <!-- year the channel reached 50,000,000 subscribers -->
| ruby_button = <!-- yes; only if the year the channel reached 50,000,000 subscribers is not known -->
| red_diamond_year = <!-- year the channel reached 100,000,000 subscribers -->
| red_diamond_button = <!-- yes; only if the year the channel reached 100,000,000 subscribers is not known -->
| module =
| stats_update = <!-- date of given channel statistics -->
| extra_information =
}}
</syntaxhighlight>
{{Clear}}
== Examples ==
=== Individual ===
{{Infobox YouTube personality
| name = Fuslie
| image = Fuslie TwitchCon 2022 (cropped).jpg
| caption = Fuslie in 2022
| birth_name = Leslie Ann Fu
| birth_date = {{birth date and age|1992|11|23}}
| birth_place = [[San Francisco Bay Area]], [[California]], U.S.
| education = [[University of California, Irvine]] ([[Bachelor of Science|BS]])
| occupation = {{flatlist|
* [[Live streamer]]
* [[YouTuber]]
}}
| organization = [[100 Thieves]]
| website = {{URL|fuslie.com}}
| years_active = 2015–present
| channel_direct_url = fuslie
| genre = {{flatlist|
* [[Video game|Gaming]]
* [[vlog]]
}}
| subscribers = 787,000
| views = 165.9 million
| associated_acts = {{flatlist|
* [[OfflineTV]]
* [[Valkyrae]]
* [[Sykkuno]]
}}
| silver_year = 2019
| module =
{{Infobox Twitch streamer | subbox=yes
| years_active = 2015–2022
| channel_name = fuslie
| genre = Gaming
}}
| stats_update = April 2, 2023
}}
<syntaxhighlight lang="wikitext" style="overflow: auto">
{{Infobox YouTube personality
| name = Fuslie
| image = Fuslie TwitchCon 2022 (cropped).jpg
| caption = Fuslie in 2022
| birth_name = Leslie Ann Fu
| birth_date = {{birth date and age|1992|11|23}}
| birth_place = [[San Francisco Bay Area]], [[California]], U.S.
| education = [[University of California, Irvine]] ([[Bachelor of Science|BS]])
| occupation = {{flatlist|
* [[Live streamer]]
* [[YouTuber]]
}}
| organization = [[100 Thieves]]
| website = {{URL|fuslie.com}}
| years_active = 2015–present
| channel_direct_url = fuslie
| genre = {{flatlist|
* [[Video game|Gaming]]
* [[vlog]]
}}
| subscribers = 787,000
| views = 165.9 million
| associated_acts = {{flatlist|
* [[OfflineTV]]
* [[Valkyrae]]
* [[Sykkuno]]
}}
| silver_year = 2019
| module =
{{Infobox Twitch streamer | subbox=yes
| years_active = 2015–2022
| channel_name = fuslie
| genre = Gaming
}}
| stats_update = April 2, 2023
}}
</syntaxhighlight>
{{Clear}}
=== Collective ===
{{Infobox YouTube personality
| name = Sidemen
| logo = Sidemen Logo.svg
| image = Sidemen collage 4.5.jpg
| caption = Top to bottom from left column: [[Vikkstar123|Barn]], [[TBJZL|Brown]]; [[KSI|Olatunji]], Minter, Lewis; [[Behzinga|Payne]], and [[Zerkaa|Bradley]].
| birth_date = {{Unbulleted list
|Olajide Olayinka Williams Olatunji ([[KSI]])|{{birth date and age|1993|6|19|df=yes}}
|<hr>Simon Minter (Miniminter)|{{birth date and age|1992|09|07|df=y}}
|<hr>Joshua Bradley ([[Zerkaa]])|{{birth date and age|1992|09|04|df=y}}
|<hr>Tobit John Brown ([[TBJZL]])|{{birth date and age|df=y|1993|4|8}}
|<hr>Ethan Payne ([[Behzinga]])|{{birth date and age|df=y|1995|6|20}}
|<hr>Vikram Singh Barn ([[Vikkstar123]])|{{birth date and age|df=y|1995|8|2}}
|<hr>Harry Lewis (W2S)|{{birth date and age|1996|11|24|df=y}}
}}
| occupation = [[YouTuber]]s
| website = {{url|https://sidemen.com}}
| origin = London, England
| channels = [https://www.youtube.com/channel/UCDogdKl7t7NHzQ95aEwkdMw Sidemen]<br />[https://www.youtube.com/channel/UCh5mLn90vUaB1PbRRx_AiaA MoreSidemen]<br />[https://www.youtube.com/channel/UCjRkTl_HP4zOh3UFaThgRZw SidemenReacts]<br />[https://www.youtube.com/channel/UCbAZH3nTxzyNmehmTUhuUsA SidemenShorts]<br />
{{Collapsible list
| framestyle = border:none; padding:0;
| title = Associated channels <!-- Only include the individual channels that were created before they transitioned their content to the first two group channels -->
| 1 = [https://www.youtube.com/channel/UCVtFOytbRpEvzLjvqGG5gxQ KSI]
| 2 = [https://www.youtube.com/channel/UCGmnsW623G1r-Chmo5RB4Yw JJ Olatunji]
| 3 = [https://www.youtube.com/channel/UCWZmCMB7mmKWcXJSIPRhzZw Miniminter]
| 4 = [https://www.youtube.com/channel/UCjB_adDAIxOL8GA4Y4OCt8g MM7Games]
| 5 = [https://www.youtube.com/user/ZerkaaHD Zerkaa]
| 6 = [https://www.youtube.com/user/ZerkaaPlays ZerkaaPlays]
| 7 = [https://www.youtube.com/user/TBJZL TBJZL]
| 8 = [https://www.youtube.com/user/EDITinGAMING TBJZLPlays]
| 9 = [https://www.youtube.com/user/Behzinga Behzinga]
| 10 = [https://www.youtube.com/channel/UCbzZFTHge5zk2yebSiWRZRg Beh2inga]
| 11 = [https://www.youtube.com/user/Vikkstar123 Vikkstar123]
| 12 = [https://www.youtube.com/user/VikkstarPlays VikkstarPlays]
| 13 = [https://www.youtube.com/user/Vikkstar123HD Vikkstar123HD]
| 14 = [https://www.youtube.com/user/wroetoshaw W2S]
| 15 = [https://www.youtube.com/channel/UC5_IT4-XpinnvNQwM1e15eQ W2S+]
}}
| years_active = 2013–present
| genre = {{flatlist|
* [[Entertainment]]
* [[Let's Play|gaming]]
* [[vlog]]
* reaction
}}
| subscribers = {{Rounddown|{{Sum|<!-- Sidemen -->16.9|7.00|4.81|1.82|<!-- JJ -->24.0|16.0|<!-- Simon -->10.1|5.21|<!-- Josh -->4.66|2.80|<!-- Tobi -->4.87|1.67|<!-- Ethan -->4.88|1.96|<!-- Vik -->7.58|1.10|3.29|<!-- Harry -->16.3|3.79}}|1}} million (combined)
| views = {{Rounddown|{{Sum|<!-- Sidemen -->4.45|2.85|1.72|1.08|<!-- JJ -->5.93|3.77|<!-- Simon -->3.54|2.68|<!-- Josh -->0.70|1.02|<!-- Tobi -->0.51|0.16|<!-- Ethan -->0.56|0.29|<!-- Vik -->2.10|0.14|1.10|<!-- Harry -->4.75|0.55}}|1}} billion (combined)
| stats_update = 14 October 2022
| network = {{flatlist|
* [[Omnia Media]]
* [[OP Talent]]
}}
| associated_acts = [[Jme (musician)|Jme]]
| silver_year = <abbr title="Sidemen">2016</abbr>, <abbr title="MoreSidemen">2018</abbr>, <abbr title="SidemenReacts">2020</abbr>, <abbr title="SidemenShorts">2021</abbr>
| gold_year = <abbr title="Sidemen">2016</abbr>, <abbr title="MoreSidemen">2018</abbr>, <abbr title="SidemenReacts">2020</abbr>, <abbr title="SidemenShorts">2021</abbr>
| diamond_year = <abbr title="Sidemen">2020</abbr>
}}
<syntaxhighlight lang="wikitext" style="overflow: auto">
{{Infobox YouTube personality
| name = Sidemen
| logo = Sidemen Logo.svg
| image = Sidemen collage 4.5.jpg
| caption = Top to bottom from left column: [[Vikkstar123|Barn]], [[TBJZL|Brown]]; [[KSI|Olatunji]], Minter, Lewis; [[Behzinga|Payne]], and [[Zerkaa|Bradley]].
| birth_date = {{Unbulleted list
|Olajide Olayinka Williams Olatunji ([[KSI]])|{{birth date and age|1993|6|19|df=yes}}
|<hr>Simon Minter (Miniminter)|{{birth date and age|1992|09|07|df=y}}
|<hr>Joshua Bradley ([[Zerkaa]])|{{birth date and age|1992|09|04|df=y}}
|<hr>Tobit John Brown ([[TBJZL]])|{{birth date and age|df=y|1993|4|8}}
|<hr>Ethan Payne ([[Behzinga]])|{{birth date and age|df=y|1995|6|20}}
|<hr>Vikram Singh Barn ([[Vikkstar123]])|{{birth date and age|df=y|1995|8|2}}
|<hr>Harry Lewis (W2S)|{{birth date and age|1996|11|24|df=y}}
}}
| occupation = [[YouTuber]]s
| website = {{url|https://sidemen.com}}
| origin = London, England
| channels = [https://www.youtube.com/channel/UCDogdKl7t7NHzQ95aEwkdMw Sidemen]<br />[https://www.youtube.com/channel/UCh5mLn90vUaB1PbRRx_AiaA MoreSidemen]<br />[https://www.youtube.com/channel/UCjRkTl_HP4zOh3UFaThgRZw SidemenReacts]<br />[https://www.youtube.com/channel/UCbAZH3nTxzyNmehmTUhuUsA SidemenShorts]<br />
{{Collapsible list
| framestyle = border:none; padding:0;
| title = Associated channels <!-- Only include the individual channels that were created before they transitioned their content to the first two group channels -->
| 1 = [https://www.youtube.com/channel/UCVtFOytbRpEvzLjvqGG5gxQ KSI]
| 2 = [https://www.youtube.com/channel/UCGmnsW623G1r-Chmo5RB4Yw JJ Olatunji]
| 3 = [https://www.youtube.com/channel/UCWZmCMB7mmKWcXJSIPRhzZw Miniminter]
| 4 = [https://www.youtube.com/channel/UCjB_adDAIxOL8GA4Y4OCt8g MM7Games]
| 5 = [https://www.youtube.com/user/ZerkaaHD Zerkaa]
| 6 = [https://www.youtube.com/user/ZerkaaPlays ZerkaaPlays]
| 7 = [https://www.youtube.com/user/TBJZL TBJZL]
| 8 = [https://www.youtube.com/user/EDITinGAMING TBJZLPlays]
| 9 = [https://www.youtube.com/user/Behzinga Behzinga]
| 10 = [https://www.youtube.com/channel/UCbzZFTHge5zk2yebSiWRZRg Beh2inga]
| 11 = [https://www.youtube.com/user/Vikkstar123 Vikkstar123]
| 12 = [https://www.youtube.com/user/VikkstarPlays VikkstarPlays]
| 13 = [https://www.youtube.com/user/Vikkstar123HD Vikkstar123HD]
| 14 = [https://www.youtube.com/user/wroetoshaw W2S]
| 15 = [https://www.youtube.com/channel/UC5_IT4-XpinnvNQwM1e15eQ W2S+]
}}
| years_active = 2013–present
| genre = {{flatlist|
* [[Entertainment]]
* [[Let's Play|gaming]]
* [[vlog]]
* reaction
}}
| subscribers = {{Rounddown|{{Sum|<!-- Sidemen -->16.9|7.00|4.81|1.82|<!-- JJ -->24.0|16.0|<!-- Simon -->10.1|5.21|<!-- Josh -->4.66|2.80|<!-- Tobi -->4.87|1.67|<!-- Ethan -->4.88|1.96|<!-- Vik -->7.58|1.10|3.29|<!-- Harry -->16.3|3.79}}|1}} million (combined)
| views = {{Rounddown|{{Sum|<!-- Sidemen -->4.45|2.85|1.72|1.08|<!-- JJ -->5.93|3.77|<!-- Simon -->3.54|2.68|<!-- Josh -->0.70|1.02|<!-- Tobi -->0.51|0.16|<!-- Ethan -->0.56|0.29|<!-- Vik -->2.10|0.14|1.10|<!-- Harry -->4.75|0.55}}|1}} billion (combined)
| stats_update = 14 October 2022
| network = {{flatlist|
* [[Omnia Media]]
* [[OP Talent]]
}}
| associated_acts = [[Jme (musician)|Jme]]
| silver_year = <abbr title="Sidemen">2016</abbr>, <abbr title="MoreSidemen">2018</abbr>, <abbr title="SidemenReacts">2020</abbr>, <abbr title="SidemenShorts">2021</abbr>
| gold_year = <abbr title="Sidemen">2016</abbr>, <abbr title="MoreSidemen">2018</abbr>, <abbr title="SidemenReacts">2020</abbr>, <abbr title="SidemenShorts">2021</abbr>
| diamond_year = <abbr title="Sidemen">2020</abbr>
}}
</syntaxhighlight>
{{Clear}}
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"description": "An infobox for a YouTube personality or channel.",
"format": "{{_\n| ____________________ = _\n}}\n",
"params": {
"honorific_prefix": {
"aliases": [
"honorific prefix"
],
"label": "Honorific prefix",
"description": "Honorific prefix(es), to appear above the YouTube personality's name.",
"example": "[[Sir]]",
"type": "line"
},
"name": {
"label": {
"en": "Name",
"ar": "الإسم"
},
"description": {
"en": "The name of the YouTube personality or channel.",
"ar": "اسم الشخصية"
},
"type": "string",
"suggested": true
},
"honorific_suffix": {
"aliases": [
"honorific suffix"
],
"label": "Honorific suffix",
"description": "Honorific suffix(es), to appear below the YouTube personality's name.",
"example": "[[PhD]]",
"type": "line"
},
"logo": {
"label": {
"en": "Logo"
},
"description": {
"en": "The logo of the YouTube channel, if applicable."
},
"example": "Dude Perfect logo.svg",
"type": "wiki-file-name"
},
"logo_size": {
"label": {
"en": "Logo size"
},
"description": {
"en": "The logo width in pixels (\"px\" is automatically added if omitted)."
},
"default": "250px",
"example": "120px"
},
"logo_alt": {
"label": {
"en": "Logo alt text"
},
"description": {
"en": "Alt text for the logo, for visually impaired readers. One word (such as \"photograph\") is rarely sufficient. See WP:ALT."
},
"type": "string"
},
"logo_caption": {
"aliases": [
"logo caption"
],
"label": "Logo caption",
"description": "A caption for the logo, if needed.",
"type": "string"
},
"image": {
"label": {
"en": "Image"
},
"description": {
"en": "An image of the YouTube personality."
},
"type": "wiki-file-name"
},
"image_upright": {
"aliases": [
"upright"
],
"label": {
"en": "Image upright"
},
"description": {
"en": "Scales the image thumbnail from its default size by the given factor. Values less than 1 scale the image down (0.9 = 90%) and values greater than 1 scale the image up (1.15 = 115%)."
},
"default": "1",
"example": "1.15",
"type": "line"
},
"image_size": {
"label": {
"en": "Image size"
},
"description": {
"en": "The image width in pixels (\"px\" is automatically added if omitted)."
},
"default": "220px",
"example": "120px",
"aliases": [
"image size",
"imagesize"
],
"deprecated": "Use of this parameter is discouraged as per WP:IMGSIZE. Use \"image_upright\" instead.",
"type": "line"
},
"alt": {
"label": "Image alt text",
"description": "Alt text for the image, for visually impaired readers. One word (such as \"photograph\") is rarely sufficient. See WP:ALT.",
"type": "string"
},
"caption": {
"aliases": [
"image_caption",
"image caption"
],
"label": "Image caption",
"description": "A caption for the image, if needed. Try to include year of photo.",
"type": "string"
},
"birth_name": {
"label": "Birth name",
"description": "The birth name of the YouTube personality. Only use if different from \"name\".",
"type": "string"
},
"birth_date": {
"label": "Birth date",
"description": "The birth date of the YouTube personality. Use Template:Birth date and age (for living people) or Template:Birth date (for people who have died). If only a year of birth is known, or age as of a certain date, consider using Template:Birth year and age or Template:Birth based on age as of date.",
"example": "{{Birth date and age|1990|01|26}}"
},
"birth_place": {
"label": "Birth place",
"description": "The birth place of the YouTube personality: city, administrative region, sovereign state. Use the name of the birth place at the time of birth.",
"example": "[[Los Angeles]], California, United States",
"type": "string"
},
"death_date": {
"label": "Death date",
"description": "The death date of the YouTube personality. Use Template:Death date and age (if birth date is known) or Template:Death date (if birth date unknown).",
"example": "{{Death date and age|2010|12|30|1990|01|26}}"
},
"death_place": {
"label": "Death place",
"description": "The death place of the YouTube personality: city, administrative region, sovereign state. Use the name of the death place at the time of death.",
"example": "[[Paris]], France",
"type": "string"
},
"origin": {
"label": "Origin",
"description": "The city from which the subject originated. Usually appropriate for groups or companies.",
"example": "[[Paris]], France",
"type": "string"
},
"nationality": {
"label": "Nationality",
"description": "The nationality of the YouTube personality. Only use if nationality cannot be inferred from the birthplace per WP:INFONAT.",
"example": "American",
"type": "string"
},
"other_names": {
"label": "Other names",
"description": "Notable aliases of the subject. Listed outside of the \"YouTube information\" section, contrary to the \"pseudonym\" parameter.",
"type": "string"
},
"education": {
"label": "Education",
"description": "The YouTube personality's institution of higher education and degree, if notable. It is usually not relevant to include for non-graduates.",
"example": "[[University of Oxford]]",
"type": "string"
},
"occupation": {
"aliases": [
"occupations"
],
"label": "Occupation(s)",
"description": "The occupation(s) of the YouTube personality, as given in the lead.",
"example": "[[YouTuber]]",
"type": "string"
},
"spouse": {
"aliases": [
"spouses"
],
"label": "Spouse(s)",
"description": "Name of spouse(s), followed by years of marriage. Use Template:Marriage."
},
"partner": {
"aliases": [
"partners"
],
"label": "Partner(s)",
"description": "Name of long-term unmarried partner(s), followed by years.",
"example": "[[Name]] (1980–present)"
},
"children": {
"label": "Children",
"description": "Number of children (e.g., 3), or list of independently notable names."
},
"parents": {
"aliases": [
"parent"
],
"label": "Parent(s)",
"description": "Names of notable parent(s). If subject has only one notable mother or father, \"mother\" and \"father\" parameters may be used instead."
},
"mother": {
"label": "Mother",
"description": "Name of mother; include only if subject has one mother who is independently notable or particularly relevant. Overridden by \"parents\" parameter."
},
"father": {
"label": "Father",
"description": "Name of father; include only if subject has one father who is independently notable or particularly relevant. Overridden by \"parents\" parameter."
},
"relatives": {
"label": "Relatives",
"description": "Notable relative(s) of the YouTube personality."
},
"organization": {
"aliases": [
"organisation",
"organisations",
"organizations"
],
"label": "Organization(s)",
"description": "Organization(s) the YouTube personality has been signed to. Omit dates.",
"example": "[[OfflineTV]]"
},
"signature": {
"label": "Signature",
"description": "An image of the YouTube personality's signature.",
"type": "wiki-file-name"
},
"signature_size": {
"label": "Signature size",
"description": "The signature width in pixels (\"px\" is automatically added if omitted).",
"default": "150px",
"example": "100px"
},
"signature_alt": {
"aliases": [
"signature alt"
],
"label": "Signature alt",
"description": "Alt text for the signature image."
},
"website": {
"aliases": [
"homepage",
"URL"
],
"label": "Website (personal)",
"description": "The official website of the YouTube personality.",
"example": "{{URL|example.com}}",
"type": "content"
},
"module_personal": {
"label": "Module personal",
"description": "Used for embedding other infoboxes into the \"Personal information\" section of this one."
},
"pseudonym": {
"label": "Also known as",
"description": "Notable aliases of the YouTube personality or channel. Listed in the \"YouTube information\" section, contrary to the \"other_names\" parameter.",
"type": "string"
},
"channel_name": {
"label": {
"en": "Channel name"
},
"description": {
"en": "The primary YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/user/\". Use only one of \"channel_name\", \"channel_url\" or \"channel_direct_url\"."
},
"type": "string"
},
"channel_url": {
"label": {
"en": "Channel URL"
},
"description": {
"en": "The primary YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/channel/\". Use only one of \"channel_name\", \"channel_url\" or \"channel_direct_url\"."
},
"type": "string"
},
"channel_direct_url": {
"label": {
"en": "Channel direct URL"
},
"description": {
"en": "The primary YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/\". Use only one of \"channel_name\", \"channel_url\" or \"channel_direct_url\"."
},
"type": "string"
},
"channel_display_name": {
"label": {
"en": "Channel display name"
},
"description": {
"en": "The primary YouTube channel's display name, if it differs from \"channel_name\", \"channel_url\" or \"channel_direct_url\"."
},
"type": "string"
},
"channel_name2": {
"label": {
"en": "Second channel name"
},
"description": {
"en": "The second YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/user/\". Use only one of \"channel_name2\", \"channel_url2\" or \"channel_direct_url2\". Do not include secondary channels unless they are covered by reliable sources in the body of the article."
},
"type": "string"
},
"channel_url2": {
"label": {
"en": "Second channel URL"
},
"description": {
"en": "The second YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/channel/\". Use only one of \"channel_name2\", \"channel_url2\" or \"channel_direct_url2\". Do not include secondary channels unless they are covered by reliable sources in the body of the article."
},
"type": "string"
},
"channel_direct_url2": {
"label": {
"en": "Second channel direct URL"
},
"description": {
"en": "The second YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/\". Use only one of \"channel_name2\", \"channel_url2\" or \"channel_direct_url2\". Do not include secondary channels unless they are covered by reliable sources in the body of the article."
},
"type": "string"
},
"channel_display_name2": {
"label": {
"en": "Second channel display name"
},
"description": {
"en": "The second YouTube channel's display name, if it differs from \"channel_name2\", \"channel_url2\" or \"channel_direct_url2\"."
},
"type": "string"
},
"channel_name3": {
"label": {
"en": "Third channel name"
},
"description": {
"en": "The third YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/user/\". Use only one of \"channel_name3\", \"channel_url3\" or \"channel_direct_url3\". Do not include secondary channels unless they are covered by reliable sources in the body of the article."
},
"type": "string"
},
"channel_url3": {
"label": {
"en": "Third channel URL"
},
"description": {
"en": "The third YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/channel/\". Use only one of \"channel_name3\", \"channel_url3\" or \"channel_direct_url3\". Do not include secondary channels unless they are covered by reliable sources in the body of the article."
},
"type": "string"
},
"channel_direct_url3": {
"label": {
"en": "Third channel direct URL"
},
"description": {
"en": "The third YouTube channel affiliated with the subject. Enter ONLY what comes after \"www.youtube.com/\". Use only one of \"channel_name3\", \"channel_url3\" or \"channel_direct_url3\". Do not include secondary channels unless they are covered by reliable sources in the body of the article."
},
"type": "string"
},
"channel_display_name3": {
"label": {
"en": "Third channel display name"
},
"description": {
"en": "The third YouTube channel's display name, if it differs from \"channel_name3\", \"channel_url3\" or \"channel_direct_url3\"."
},
"type": "string"
},
"channels": {
"label": "Channels",
"description": "Custom styling for the YouTube channels affiliated with the subject. Overridden by \"channel_name\", \"channel_url\" and \"channel_direct_url\".",
"type": "string"
},
"creator": {
"aliases": [
"creators",
"created_by"
],
"label": "Created by",
"description": "The creator(s) of the YouTube channel.",
"type": "string"
},
"presenter": {
"aliases": [
"presenters",
"presented_by"
],
"label": "Presented by",
"description": "The presenter(s) of the YouTube channel.",
"type": "string"
},
"location": {
"label": "Location",
"description": "The location of the YouTube channel, if notable. Not for mere residence.",
"example": "[[Los Angeles]], California, United States",
"type": "string"
},
"years_active": {
"aliases": [
"years active",
"yearsactive"
],
"label": "Years active",
"description": "Date range in years during which the YouTube channel was active. Use an en dash (–) to separate the years.",
"example": "2009–present",
"type": "string"
},
"genre": {
"label": "Genre",
"description": "The genre(s) of content produced by the YouTube channel.",
"example": "Comedy",
"type": "string",
"aliases": [
"genres"
]
},
"subscribers": {
"label": "Subscribers",
"description": "The number of subscribers the YouTube channel has.",
"example": "1.5 million",
"type": "string"
},
"subscriber_date": {
"description": "The month and year when the YouTube channel's subscriber count was last updated. The date is listed inline with the subscriber count. The all-encompassing \"stats_update\" parameter is generally recommended instead.",
"label": "Subscribers date",
"type": "string"
},
"views": {
"label": {
"en": "Total views"
},
"description": {
"en": "The number of views the YouTube channel has."
},
"example": "1.5 billion",
"type": "string"
},
"view_date": {
"label": {
"en": "Total views date"
},
"description": {
"en": "The month and year when the YouTube channel's view count was last updated. The date is listed inline with the view count. The all-encompassing \"stats_update\" parameter is generally recommended instead."
}
},
"network": {
"description": "The multi-channel network (MCN) that the YouTube channel has been a part of.",
"label": "Network",
"example": "[[Machinima Inc.]] (2013–2015)"
},
"language": {
"label": "Contents are in",
"description": "The primary language(s) of the YouTube channel. Use their English name.",
"type": "string",
"example": "Spanish"
},
"associated_acts": {
"label": "Associated acts",
"description": "Associated YouTube personalities or channels, such as those that collaborate with the subject.",
"type": "string"
},
"channel_website": {
"label": "Website (channel)",
"description": "The official website of the YouTube channel.",
"example": "{{URL|example.com}}"
},
"silver_year": {
"description": "The year the YouTube channel reached 100,000 subscribers. If the year is not known, use \"silver_button=yes\" instead.",
"label": "Silver Creator Award year",
"type": "string"
},
"silver_button": {
"description": "Enter \"yes\" if the YouTube channel has been awarded a Silver Creator Award for reaching 100,000 subscribers. Overriden by \"silver_year\".",
"label": "Silver Creator Award?",
"type": "line"
},
"gold_year": {
"description": "The year the YouTube channel reached 1,000,000 subscribers. If the year is not known, use \"gold_button=yes\" instead.",
"label": "Gold Creator Award year",
"type": "string"
},
"gold_button": {
"description": "Enter \"yes\" if the YouTube channel has been awarded a Gold Creator Award for reaching 1,000,000 subscribers. Overriden by \"gold_year\".",
"label": "Gold Creator Award?",
"type": "line"
},
"diamond_year": {
"description": "The year the YouTube channel reached 10,000,000 subscribers. If the year is not known, use \"diamond_button=yes\" instead.",
"label": "Diamond Creator Award year",
"type": "string"
},
"diamond_button": {
"description": "Enter \"yes\" if the YouTube channel has been awarded a Diamond Creator Award for reaching 10,000,000 subscribers. Overriden by \"diamond_year\".",
"label": "Diamond Creator Award?",
"type": "line"
},
"ruby_year": {
"description": "The year the YouTube channel reached 50,000,000 subscribers. If the year is not known, use \"ruby_button=yes\" instead.",
"label": "Custom Creator Award year",
"type": "string"
},
"ruby_button": {
"description": "Enter \"yes\" if the YouTube channel has been awarded a Custom Creator Award for reaching 50,000,000 subscribers. Overriden by \"ruby_year\".",
"label": "Custom Creator Award?",
"type": "line"
},
"red_diamond_year": {
"description": "The year the YouTube channel reached 100,000,000 subscribers. If the year is not known, use \"red_diamond_button=yes\" instead.",
"label": "Red Diamond Creator Award year",
"type": "string"
},
"red_diamond_button": {
"description": "Enter \"yes\" if the YouTube channel has been awarded a Red Diamond Creator Award for reaching 100,000,000 subscribers. Overridden by \"red_diamond_year\".",
"label": "Red Diamond Creator Award?",
"type": "line"
},
"expand": {
"label": "Expand",
"description": "Enter \"yes\" to expand the \"Creator Awards\" section by default."
},
"module": {
"label": "Module",
"description": "Used for embedding other infoboxes into this one."
},
"stats_update": {
"label": "Last updated",
"description": "The date when the YouTube channel's statistics were last updated. The date is listed at the bottom of the infobox."
},
"extra_information": {
"label": "Extra information",
"description": "If necessary, extra information can be added to the bottom of the infobox."
},
"subbox": {
"label": "Subbox",
"description": "Enter \"yes\" when embedding this infobox into another to retain the red-colored headings."
},
"embed": {
"label": "Embed",
"description": "Enter \"yes\" when embedding this infobox into another to remove the red-colored headings."
}
},
"paramOrder": [
"honorific_prefix",
"name",
"honorific_suffix",
"logo",
"logo_size",
"logo_alt",
"logo_caption",
"image",
"image_upright",
"image_size",
"alt",
"caption",
"birth_name",
"birth_date",
"birth_place",
"death_date",
"death_place",
"origin",
"nationality",
"other_names",
"education",
"occupation",
"spouse",
"partner",
"children",
"parents",
"mother",
"father",
"relatives",
"organization",
"signature",
"signature_size",
"signature_alt",
"website",
"module_personal",
"pseudonym",
"channel_name",
"channel_url",
"channel_direct_url",
"channel_display_name",
"channel_name2",
"channel_url2",
"channel_direct_url2",
"channel_display_name2",
"channel_name3",
"channel_url3",
"channel_direct_url3",
"channel_display_name3",
"channels",
"creator",
"presenter",
"location",
"years_active",
"genre",
"subscribers",
"subscriber_date",
"views",
"view_date",
"network",
"language",
"associated_acts",
"channel_website",
"silver_year",
"silver_button",
"gold_year",
"gold_button",
"diamond_year",
"diamond_button",
"ruby_year",
"ruby_button",
"red_diamond_year",
"red_diamond_button",
"expand",
"module",
"stats_update",
"extra_information",
"subbox",
"embed"
]
}
</templatedata>
== Tracking categories ==
* {{Category link with count|Pages using infobox YouTube personality with unknown parameters}}
* {{Category link with count|Pages with YouTubeSubscribers module errors}}
== See also ==
* [[Template:Infobox Twitch streamer]]
* [[Template:Infobox video game player]]
* [[Template:Infobox podcast]]
== References ==
<references />
<includeonly>{{Basepage subpage|
<!-- Categories go here and interwikis go in Wikidata. -->
[[Category:People and person infobox templates|YouTube personality]]
[[Category:Arts and culture infobox templates|YouTube personality]]
[[Category:Biographical templates usable as a module|YouTube personality]]
[[Category:Infobox templates with module parameter|YouTube personality]]
[[Category:Infobox templates with updated parameter]]
[[Category:Templates that add a tracking category]]
[[Category:Templates that generate named references]]
}}</includeonly>
49374506bdf6fc3f8dba26d2bba380f7daf59e48
Template:WikiProject YouTube/Used Template
10
163
335
334
2023-08-10T15:23:45Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:WikiProject_YouTube/Used_Template]]
wikitext
text/x-wiki
{{ mbox
| image = [[file:YouTube Logo 2017.svg|80x70px|alt=|link=]]
| text = If you plan to make [[backward compatibility|breaking changes]] to this template, move it, or nominate it for deletion, please notify [[Wikipedia:WikiProject YouTube|WikiProject YouTube]] members at [[Wikipedia talk:WikiProject YouTube]] as a courtesy, as this template is heavily used by this WikiProject. Thank you! {{#if:{{{1|}}}|<p>
{{{1}}}}}}}<noinclude>
{{Documentation}}<!-- Add categories and interwikis to the /doc subpage, not here! --></noinclude>
d42e3fd8e627050d08bd311414aec5000e00d9c9
Template:Hlist/styles.css
10
164
337
336
2023-08-10T15:23:46Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Hlist/styles.css]]
sanitized-css
text/css
/* {{pp-protected|reason=match parent|small=yes}} */
/*
* hlist styles are defined in core and Minerva and differ in Minerva. The
* current definitions here (2023-01-01) are sufficient to override Minerva
* without use of the hlist-separated class. The most problematic styles were
* related to margin, padding, and the bullet. Check files listed at
* [[MediaWiki talk:Common.css/to do#hlist-separated]]
*/
/*
* TODO: When the majority of readership supports it (or some beautiful world
* in which grade C support is above the minimum threshold), use :is()
*/
.hlist dl,
.hlist ol,
.hlist ul {
margin: 0;
padding: 0;
}
/* Display list items inline */
.hlist dd,
.hlist dt,
.hlist li {
/*
* don't trust the note that says margin doesn't work with inline
* removing margin: 0 makes dds have margins again
* We also want to reset margin-right in Minerva
*/
margin: 0;
display: inline;
}
/* Display requested top-level lists inline */
.hlist.inline,
.hlist.inline dl,
.hlist.inline ol,
.hlist.inline ul,
/* Display nested lists inline */
.hlist dl dl,
.hlist dl ol,
.hlist dl ul,
.hlist ol dl,
.hlist ol ol,
.hlist ol ul,
.hlist ul dl,
.hlist ul ol,
.hlist ul ul {
display: inline;
}
/* Hide empty list items */
.hlist .mw-empty-li {
display: none;
}
/* TODO: :not() can maybe be used here to remove the later rule. naive test
* seems to work. more testing needed. like so:
*.hlist dt:not(:last-child)::after {
* content: ": ";
*}
*.hlist dd:not(:last-child)::after,
*.hlist li:not(:last-child)::after {
* content: " · ";
* font-weight: bold;
*}
*/
/* Generate interpuncts */
.hlist dt::after {
content: ": ";
}
.hlist dd::after,
.hlist li::after {
content: " · ";
font-weight: bold;
}
.hlist dd:last-child::after,
.hlist dt:last-child::after,
.hlist li:last-child::after {
content: none;
}
/* Add parentheses around nested lists */
.hlist dd dd:first-child::before,
.hlist dd dt:first-child::before,
.hlist dd li:first-child::before,
.hlist dt dd:first-child::before,
.hlist dt dt:first-child::before,
.hlist dt li:first-child::before,
.hlist li dd:first-child::before,
.hlist li dt:first-child::before,
.hlist li li:first-child::before {
content: " (";
font-weight: normal;
}
.hlist dd dd:last-child::after,
.hlist dd dt:last-child::after,
.hlist dd li:last-child::after,
.hlist dt dd:last-child::after,
.hlist dt dt:last-child::after,
.hlist dt li:last-child::after,
.hlist li dd:last-child::after,
.hlist li dt:last-child::after,
.hlist li li:last-child::after {
content: ")";
font-weight: normal;
}
/* Put ordinals in front of ordered list items */
.hlist ol {
counter-reset: listitem;
}
.hlist ol > li {
counter-increment: listitem;
}
.hlist ol > li::before {
content: " " counter(listitem) "\a0";
}
.hlist dd ol > li:first-child::before,
.hlist dt ol > li:first-child::before,
.hlist li ol > li:first-child::before {
content: " (" counter(listitem) "\a0";
}
8c9dd9c9c00f30eead17fe10f51d183333e81f33
Module:YouTubeSubscribers
828
165
339
338
2023-08-10T15:23:46Z
InsaneX
2
1 revision imported from [[:wikipedia:Module:YouTubeSubscribers]]
Scribunto
text/plain
POINT_IN_TIME_PID = "P585"
YT_CHAN_ID_PID= "P2397"
SUB_COUNT_PID = "P8687"
local p = {}
-- taken from https://en.wikipedia.org/wiki/Module:Wd
function parseDate(dateStr, precision)
precision = precision or "d"
local i, j, index, ptr
local parts = {nil, nil, nil}
if dateStr == nil then
return parts[1], parts[2], parts[3] -- year, month, day
end
-- 'T' for snak values, '/' for outputs with '/Julian' attached
i, j = dateStr:find("[T/]")
if i then
dateStr = dateStr:sub(1, i-1)
end
local from = 1
if dateStr:sub(1,1) == "-" then
-- this is a negative number, look further ahead
from = 2
end
index = 1
ptr = 1
i, j = dateStr:find("-", from)
if i then
-- year
parts[index] = tonumber(mw.ustring.gsub(dateStr:sub(ptr, i-1), "^%+(.+)$", "%1"), 10) -- remove '+' sign (explicitly give base 10 to prevent error)
if parts[index] == -0 then
parts[index] = tonumber("0") -- for some reason, 'parts[index] = 0' may actually store '-0', so parse from string instead
end
if precision == "y" then
-- we're done
return parts[1], parts[2], parts[3] -- year, month, day
end
index = index + 1
ptr = i + 1
i, j = dateStr:find("-", ptr)
if i then
-- month
parts[index] = tonumber(dateStr:sub(ptr, i-1), 10)
if precision == "m" then
-- we're done
return parts[1], parts[2], parts[3] -- year, month, day
end
index = index + 1
ptr = i + 1
end
end
if dateStr:sub(ptr) ~= "" then
-- day if we have month, month if we have year, or year
parts[index] = tonumber(dateStr:sub(ptr), 10)
end
return parts[1], parts[2], parts[3] -- year, month, day
end
-- taken from https://en.wikipedia.org/wiki/Module:Wd
local function datePrecedesDate(aY, aM, aD, bY, bM, bD)
if aY == nil or bY == nil then
return nil
end
aM = aM or 1
aD = aD or 1
bM = bM or 1
bD = bD or 1
if aY < bY then
return true
elseif aY > bY then
return false
elseif aM < bM then
return true
elseif aM > bM then
return false
elseif aD < bD then
return true
end
return false
end
function getClaimDate(claim)
if claim['qualifiers'] and claim['qualifiers'][POINT_IN_TIME_PID] then
local pointsInTime = claim['qualifiers'][POINT_IN_TIME_PID]
if #pointsInTime ~= 1 then
-- be conservative in what we accept
error("Encountered a statement with zero or multiple point in time (P85) qualifiers. Please add or remove point in time information so each statement has exactly one")
end
local pointInTime = pointsInTime[1]
if pointInTime and pointInTime['datavalue'] and pointInTime['datavalue']['value'] and pointInTime['datavalue']['value']['time'] then
return parseDate(pointInTime['datavalue']['value']['time'])
end
end
return nil
end
-- for a given list of statements find the newest one with a matching qual
function newestMatchingStatement(statements, qual, targetQualValue)
local newestStatement = nil
local newestStatementYr = nil
local newestStatementMo = nil
local newestStatementDay = nil
for k, v in pairs(statements) do
if v['rank'] ~= "deprecated" and v['qualifiers'] and v['qualifiers'][qual] then
local quals = v['qualifiers'][qual]
-- should only have one instance of the qualifier on a statement
if #quals == 1 then
local qual = quals[1]
if qual['datavalue'] and qual['datavalue']['value'] then
local qualValue = qual['datavalue']['value']
if qualValue == targetQualValue then
local targetYr, targetMo, targetDay = getClaimDate(v)
if targetYr then
local older = datePrecedesDate(targetYr, targetMo, targetDay, newestStatementYr, newestStatementMo, newestStatementDay)
if older == nil or not older then
newestStatementYr, newestStatementMo, newestStatementDay = targetYr, targetMo, targetDay
newestStatement = v
end
end
end
end
end
end
end
return newestStatement
end
-- for a given property and qualifier pair returns the newest statement that matches
function newestMatching(e, prop, qual, targetQualValue)
-- first check the best statements
local statements = e:getBestStatements(prop)
local newestStatement = newestMatchingStatement(statements, qual, targetQualValue)
if newestStatement then
return newestStatement
end
-- try again with all statements if nothing so far
statements = e:getAllStatements(prop)
newestStatement = newestMatchingStatement(statements, qual, targetQualValue)
if newestStatement then
return newestStatement
end
return nil
end
function getEntity ( frame )
local qid = nil
if frame.args then
qid = frame.args["qid"]
end
if not qid then
qid = mw.wikibase.getEntityIdForCurrentPage()
end
if not qid then
local e = nil
return e
end
local e = mw.wikibase.getEntity(qid)
assert(e, "No such item found: " .. qid)
return e
end
-- find the channel ID we are going to be getting the sub counts for
function getBestYtChanId(e)
local chanIds = e:getBestStatements(YT_CHAN_ID_PID)
if #chanIds == 1 then
local chan = chanIds[1]
if chan and chan["mainsnak"] and chan["mainsnak"]["datavalue"] and chan["mainsnak"]["datavalue"]["value"] then
return chan["mainsnak"]["datavalue"]["value"]
end
end
return nil
end
function returnError(frame, eMessage)
return frame:expandTemplate{ title = 'error', args = { eMessage } } .. "[[Category:Pages with YouTubeSubscribers module errors]]"
end
-- the date of the current YT subscriber count
function p.date( frame )
local e = getEntity(frame)
assert(e, "No qid found for page. Please make a Wikidata item for this article")
local chanId = getBestYtChanId(e)
assert(chanId, "Could not find a single best YouTube channel ID for this item. Add a YouTube channel ID or set the rank of one channel ID to be preferred")
local s = newestMatching(e, SUB_COUNT_PID, YT_CHAN_ID_PID, chanId)
if s then
local yt_year, yt_month, yt_day = getClaimDate(s)
if not yt_year then
return nil
end
local dateString = yt_year .. "|"
-- construct YYYY|mm|dd date string
if yt_month and yt_month ~= 0 then
dateString = dateString .. yt_month .. "|"
-- truncate the day of month
--if yt_day and yt_day ~= 0 then
-- dateString = dateString .. yt_day
--end
end
return frame:expandTemplate{title="Format date", args = {yt_year, yt_month, yd_day}}
end
error("Could not find a date for YouTube subscriber information. Is there a social media followers statement (P8687) qualified with good values for P585 and P2397?")
end
function p.dateNice( frame )
local status, obj = pcall(p.date, frame)
if status then
return obj
else
return returnError(frame, obj)
end
end
-- the most up to date number of subscribers
function p.subCount( frame )
local subCount = nil
local e = getEntity(frame)
if not e then
subCount = -424
return tonumber(subCount)
end
local chanId = getBestYtChanId(e)
if chanId then
local s = newestMatching(e, SUB_COUNT_PID, YT_CHAN_ID_PID, chanId)
if s and s["mainsnak"] and s['mainsnak']["datavalue"] and s['mainsnak']["datavalue"]["value"] and s['mainsnak']["datavalue"]['value']['amount'] then
subCount = s['mainsnak']["datavalue"]['value']['amount']
end
else
subCount = -404
end
if subCount then
return tonumber(subCount)
else
subCount = -412
return tonumber(subCount)
end
end
function p.subCountNice( frame )
local status, obj = pcall(p.subCount, frame)
if status then
if obj >= 0 then
return frame:expandTemplate{title="Format price", args = {obj}}
else
return obj
end
else
return returnError(frame, obj)
end
end
return p
98467dcdea470df426a9b002a85e7ae22390fb10
Template:Infobox Twitch streamer/styles.css
10
166
341
340
2023-08-10T15:23:47Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Infobox_Twitch_streamer/styles.css]]
sanitized-css
text/css
/* {{pp|small=yes}} */
/* twitch color branding */
.ib-twitch-title,
.ib-twitch-above,
.ib-twitch-header {
background-color: #6441A4;
color: white;
}
.ib-twitch-above {
font-size: 125%;
}
.ib-twitch-above .honorific-prefix,
.ib-twitch-above .honorific-suffix {
font-size: small;
font-weight: normal;
}
/* override blue link on purple background */
.ib-twitch-above .honorific-prefix a,
.ib-twitch-above .honorific-suffix a {
color: white;
}
.ib-twitch-header {
line-height: 1.5em;
}
.ib-twitch-title {
line-height: 1.6em;
}
.ib-twitch .infobox-full-data {
padding: 0;
}
.ib-twitch div.nickname,
.ib-twitch div.birthplace,
.ib-twitch div.deathplace {
display: inline;
}
.ib-twitch-below {
color: darkslategray;
}
/* mobile fixes */
body.skin-minerva .ib-twitch-title {
padding: 7px;
}
body.skin-minerva .ib-twitch-below hr:first-of-type {
display: none;
}
f972ac5a3688c2930702bb6a37a6de39fd9c993a
Template:Infobox YouTube personality/styles.css
10
167
343
342
2023-08-10T15:23:48Z
InsaneX
2
1 revision imported from [[:wikipedia:Template:Infobox_YouTube_personality/styles.css]]
sanitized-css
text/css
/* {{pp|small=yes}} */
/* youtube color branding */
.ib-youtube-title,
.ib-youtube-above,
.ib-youtube-header,
.ib-youtube-awards-color {
background-color: #B60000;
color: white;
}
.ib-youtube-above {
font-size: 125%;
}
.ib-youtube-above .honorific-prefix,
.ib-youtube-above .honorific-suffix {
font-size: small;
font-weight: normal;
}
/* override blue link on red background */
.ib-youtube-above .honorific-prefix a,
.ib-youtube-above .honorific-suffix a,
.ib-youtube-awards-color a,
.ib-youtube-awards-color .mw-collapsible-text,
.ib-youtube-awards-color .mw-collapsible-toggle::before,
.ib-youtube-awards-color .mw-collapsible-toggle::after {
color: white;
}
.ib-youtube-header {
line-height: 1.5em;
}
.ib-youtube-title {
line-height: 1.6em;
}
.ib-youtube .infobox-full-data {
padding: 0;
}
.ib-youtube div.nickname,
.ib-youtube div.birthplace,
.ib-youtube div.deathplace {
display: inline;
}
.ib-youtube-awards {
width: 100%;
display: inline-table;
border-spacing: 0;
margin: 0; /* mobile fix */
}
.ib-youtube-awards th div {
text-align: center;
margin: 0 4em;
}
.ib-youtube-awards td {
vertical-align: middle;
}
.ib-youtube-below {
color: darkslategray;
}
/* mobile fixes */
body.skin-minerva .ib-youtube-title {
padding: 7px;
}
body:not(.skin-minerva) .ib-youtube-awards td {
padding: 3px;
}
body.skin-minerva .ib-youtube-below hr:first-of-type {
display: none;
}
111c6691e3dc7827fe4fee42345186e0eb20fd0d
Umar Edits
0
4
344
225
2023-08-10T15:25:10Z
InsaneX
2
wikitext
text/x-wiki
{{Infobox YouTube personality
| name = John Doe
| image = JohnDoe.jpg
| channel_name = JohnDoeGeography
| subscribers = 1,000,000
| views = 50,000,000
| years_active = 2015–present
| silver_year = 2016
| gold_year = 2018
| diamond_year = 2020
| ruby_year = N/A
}}
'''Umar Edits'''
659d1f93e83fdce5e9aee37b43341a9891374648
Umar Edits
0
4
345
344
2023-08-10T15:33:33Z
InsaneX
2
Replaced content with "'''Umar Edits'''"
wikitext
text/x-wiki
'''Umar Edits'''
47964e30b13755911c7ca8e108450dfa724f2a86
351
345
2023-08-10T15:53:39Z
InsaneX
2
wikitext
text/x-wiki
[[File:UmarEdits_Logo.jpg|thumb|right|300px|Logo of Umar Edits.]]
'''Umar Edits'''
f5b9ba2993709f659ddbc7a01b02bcf95f64ef29
415
351
2023-08-11T06:34:57Z
InsaneX
2
wikitext
text/x-wiki
{{Infobox YouTube personality
| name = Mubashir Saddique
| image = Mubashir Saddique.jpg
| birth_place = [[Sialkot]], Pakistan
| birth_date = {{Birth date and age|df=yes|1985|02|7}}
| occupation = Food [[Vlogger]]
{{Infobox person|embed=yes
| alma_mater =
| children = }}
| channels = [https://www.youtube.com/@VillageFoodSecrets Village Food Secrets]<br/>[https://www.youtube.com/@MubashirSaddiqueShorts Mubashir Saddique]
| subscribers = 3.96 million<ref>https://www.youtube.com/@VillageFoodSecrets/about About Village Food Secrets [[YouTube]]</ref> <!-- PLEASE DO NOT CHANGE WITHOUT UPDATING stats_update BELOW -->
| views = 802.9 million<ref>https://www.youtube.com/@VillageFoodSecrets/about About Village Food Secrets [[YouTube]]</ref> <!-- PLEASE DO NOT CHANGE WITHOUT UPDATING stats_update BELOW -->
| years_active = 2016–present
| silver_button = yes
| gold_button = yes
| silver_year = 2018
| gold_year = 2019
| stats_update = 24 July 2023
| genre = [[Cooking]],[[Vlogging]]
| website =
}}
[[File:UmarEdits_Logo.jpg|thumb|right|300px|Logo of Umar Edits.]]
'''Umar Edits'''
3aabfa5f637ef8333b8feee9baec0d24f87a6164
Main Page
0
1
346
10
2023-08-10T15:42:03Z
InsaneX
2
wikitext
text/x-wiki
{| class="wikitable" style="width:100%; background:#f9f9f9; border:none; padding:5px;"
|-
! colspan="2" style="background:#ccccff; font-size:24px; text-align:center; padding:5px;"| Welcome to Geotubepedia
|-
| style="width:50%; vertical-align:top; padding:10px;"|
'''The ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content.'''
==== Featured Geotuber ====
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
==== News and Updates ====
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
||
| style="width:50%; vertical-align:top; padding:10px;"|
==== Explore ====
* [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]]
==== Contributing ====
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
==== Random Geotuber ====
Click [[Special:Random|here]] to discover a random Geotuber profile!
|-
| colspan="2" style="text-align:center; padding:5px;"|
'''Did you know?''': The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
|-
| colspan="2" style="text-align:center;"|
[[About Geotubepedia]] | [[Geotubepedia:Community Portal|Community Portal]] | [[Geotubepedia:Help|Help]]
|}
[[Category:Main page]]
f979261917e0b45f32599d017a7764db8d295f37
347
346
2023-08-10T15:48:08Z
InsaneX
2
wikitext
text/x-wiki
== Welcome to Geotubepedia ==
The ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content.
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
* [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]]
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
5dc1767ba9567fd0713dba2e6220837f996e713b
348
347
2023-08-10T15:50:41Z
InsaneX
2
/* Explore */
wikitext
text/x-wiki
== Welcome to Geotubepedia ==
The ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content.
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
8c3864e0174a14e1afe71333a8200654ffa5ac3d
349
348
2023-08-10T15:51:03Z
InsaneX
2
wikitext
text/x-wiki
== Welcome to Geotubepedia ==
The ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content.
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
7cda7330fb9d993cc6ef025c5235a1218861da34
File:UmarEdits Logo.jpg
6
168
350
2023-08-10T15:52:33Z
InsaneX
2
Logo of UmarEdits
wikitext
text/x-wiki
== Summary ==
Logo of UmarEdits
dc10f53243b069290e7feb3455885b12c5745bee
Cartoonabad
0
169
352
2023-08-10T16:28:16Z
InsaneX
2
Created page with "== Syed Samar == '''Syed Samar''' is a well-known Geotuber from Pakistan, best recognized for his YouTube channel, ''Cartoonabad''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. === Personal Life === Syed Samar was born on February 16, 2010, in Hyderabad. He identifies as a Shia Muslim. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His..."
wikitext
text/x-wiki
== Syed Samar ==
'''Syed Samar''' is a well-known Geotuber from Pakistan, best recognized for his YouTube channel, ''Cartoonabad''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
=== Personal Life ===
Syed Samar was born on February 16, 2010, in Hyderabad. He identifies as a Shia Muslim. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from Sharbat and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
=== Early Life ===
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in Hindi.
=== YouTube Career ===
Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. This was further influenced by his discovery of Glitch Editz and an Iranian Geotuber on his YouTube Shorts feed. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/Cartoonabad Cartoonabad on YouTube]
eb62c3c2da0ba3879a68f3f7c82d6da7b8414a55
353
352
2023-08-10T16:37:12Z
InsaneX
2
wikitext
text/x-wiki
'''Syed Samar''' ([[https://en.wikipedia.org/wiki/Urdu Urdu]]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [[https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad]], [[https://en.wikipedia.org/wiki/Pakistan Pakistan]]. He identifies as a [[https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [[https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat]] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
=== YouTube Career ===
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [[https://en.wikipedia.org/wiki/Hindi Hindi]]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/Cartoonabad Cartoonabad on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on Tiktok]
fb9c6db55f481d8d5c1db2d33aeab5c681c30a24
354
353
2023-08-10T16:37:25Z
InsaneX
2
wikitext
text/x-wiki
'''Syed Samar''' ([[https://en.wikipedia.org/wiki/Urdu Urdu]]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [[https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad]], [[https://en.wikipedia.org/wiki/Pakistan Pakistan]]. He identifies as a [[https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [[https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat]] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
=== YouTube Career ===
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [[https://en.wikipedia.org/wiki/Hindi Hindi]]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/Cartoonabad Cartoonabad on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
853250114ff2348a29adfd9537c8da78e8c459eb
355
354
2023-08-10T16:38:37Z
InsaneX
2
wikitext
text/x-wiki
'''Syed Samar''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
=== YouTube Career ===
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [https://en.wikipedia.org/wiki/Hindi Hindi]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/Cartoonabad Cartoonabad on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
b2b45424eedee64014007a259fa195eeb47fc771
356
355
2023-08-10T16:39:49Z
InsaneX
2
wikitext
text/x-wiki
[[File:UmarEdits_Logo.jpg|thumb|right|300px|Logo of Umar Edits.]]
'''Syed Samar''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
=== YouTube Career ===
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [https://en.wikipedia.org/wiki/Hindi Hindi]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/Cartoonabad Cartoonabad on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
355912970d557c31bfa1f9fd943d8721b5eed4c5
358
356
2023-08-10T16:41:11Z
InsaneX
2
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|right|300px|Logo of Umar Edits.]]
'''Syed Samar''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
=== YouTube Career ===
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [https://en.wikipedia.org/wiki/Hindi Hindi]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/Cartoonabad Cartoonabad on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
e879a8526bffcf64bd7dea425711973e121f4725
359
358
2023-08-10T16:41:27Z
InsaneX
2
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|right|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
=== YouTube Career ===
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [https://en.wikipedia.org/wiki/Hindi Hindi]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/Cartoonabad Cartoonabad on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
817d15946017c33f83a855df9d07e09b809f639e
360
359
2023-08-10T16:42:57Z
InsaneX
2
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|right|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [https://en.wikipedia.org/wiki/Hindi Hindi]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/Cartoonabad Cartoonabad on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
114848a01193ba2edf9197245d0f68b5b8ed9521
File:Cartoonabad Logo.jpg
6
170
357
2023-08-10T16:40:47Z
InsaneX
2
Logo of Cartoonabad
wikitext
text/x-wiki
== Summary ==
Logo of Cartoonabad
db50deb6125f618e3ea519c2687c09da0fdd882d
Saif Sheikh Edits
0
172
362
2023-08-10T17:23:02Z
InsaneX
2
Created page with "[[File:Saif Sheikh Logo.jpg|thumb|right|300px|Logo of Saif Sheikh Edits.]] '''Saif Sheikh''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سیف شیخ) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Saif Sheikh Edits'''. == Personal Life == Saif was born on February 4th, 2009, in Lahore, Pakistan. Saif experienced a significant transition in his life when he moved to Chicago in late 2012. Adapting to a new culture and environment, Saif's experience..."
wikitext
text/x-wiki
[[File:Saif Sheikh Logo.jpg|thumb|right|300px|Logo of Saif Sheikh Edits.]]
'''Saif Sheikh''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سیف شیخ) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Saif Sheikh Edits'''.
== Personal Life ==
Saif was born on February 4th, 2009, in Lahore, Pakistan. Saif experienced a significant transition in his life when he moved to Chicago in late 2012. Adapting to a new culture and environment, Saif's experiences in both Lahore and Chicago have played a pivotal role in shaping his perspectives and content. Politically, Saif is a supporter of Imran Khan.
== YouTube Career ==
Saif's journey into the realm of YouTube and geography was inspired by Geotubers like TheGamingKing and UmarEdits. Their content struck a chord with Saif, motivating him to dive into the world of geography content creation. As a result, he commenced his own channel, ''Saif Sheikh Edits'', where he brings a unique blend of his experiences and knowledge to his audience.
== See Also ==
* [https://www.youtube.com/SaifSheikhEdits Saif Sheikh Edits on YouTube]
* [https://www.instagram.com/sh2005_4_4/?igshid=OGQ5ZDc2ODk2ZA%3D%3D Saif Sheikh Edits on Instagram]
35af53c5c16db3d76cf3d4fcec4454f7c08c106b
Template:Ombox
10
173
364
363
2023-08-11T06:26:09Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:Message box|ombox}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
0e54065432d540737b9e56c4e3a8e7f74d4534ea
Template:Module other
10
174
366
365
2023-08-11T06:26:11Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Module}}
| module
| other
}}
}}
| module = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
503694836c1b07142e63fd35d8be69ec8bb9ffe7
Template:Module rating
10
175
368
367
2023-08-11T06:26:12Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc|<!--do not show protection level of the module on the doc page, use the second and optionally third parameter if the doc page is also protected -->{{#if:{{{2|}}}|{{Pp|{{{2}}}|action={{{3|}}}}}}}|{{Module other|{{ombox
| type = notice
| image = {{#switch: {{{1|}}}
| pre-alpha | prealpha | pa = [[File:Ambox warning blue construction.svg|40x40px|link=|alt=Pre-alpha]]
| alpha | a = [[File:Alpha lowercase.svg|26x26px|link=|alt=Alpha]]
| beta | b = [[File:Greek lc beta.svg|40x40px|link=|alt=Beta]]
| release | r | general | g = [[File:Green check.svg|40x40px|link=|alt=Ready for use]]
| protected | protect | p = [[File:{{#switch:{{#invoke:Effective protection level|edit|{{#switch:{{SUBPAGENAME}}|doc|sandbox={{FULLBASEPAGENAME}}|{{FULLPAGENAME}}}}}}|autoconfirmed=Semi|extendedconfirmed=Extended|accountcreator|templateeditor=Template|#default=Full}}-protection-shackle.svg|40x40px|link=|alt=Protected]]
| semiprotected | semiprotect | semi =[[File:Semi-protection-shackle.svg|40x40px|link=|alt=Semi-protected]]
}}
| style =
| textstyle =
| text = {{#switch: {{{1|}}}
| pre-alpha | prealpha | pa = This module is rated as [[:Category:Modules in pre-alpha development|pre-alpha]]. It is unfinished, and may or may not be in active development. It should not be used from article namespace pages. Modules remain pre-alpha until the original editor (or someone who takes one over if it is abandoned for some time) is satisfied with the basic structure.<!--
-->{{#switch: {{SUBPAGENAME}}|doc|sandbox=<!-- No category for /doc or /sandbox subpages -->
| {{#ifeq: {{{nocat|}}} | true | <!-- No category if user sets nocat=true --> | [[Category:Modules in pre-alpha development|{{PAGENAME}}]] }}
}}
| alpha | a = This module is rated as [[:Category:Modules in alpha|alpha]]. It is ready for third-party input, and may be used on a few pages to see if problems arise, but should be watched. Suggestions for new features or changes in their input and output mechanisms are welcome.<!--
-->{{#switch: {{SUBPAGENAME}}|doc|sandbox=<!-- No category for /doc or /sandbox subpages -->
| {{#ifeq: {{{nocat|}}} | true | <!-- No category if user sets nocat=true --> | [[Category:Modules in alpha|{{PAGENAME}}]] }}
}}
| beta | b = This module is rated as [[:Category:Modules in beta|beta]], and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected.<!--
-->{{#switch: {{SUBPAGENAME}}|doc|sandbox=<!-- No category for /doc or /sandbox subpages -->
| {{#ifeq: {{{nocat|}}} | true | <!-- No category if user sets nocat=true --> | [[Category:Modules in beta|{{PAGENAME}}]] }}
}}
| release | r | general | g = This module is rated as [[:Category:Modules for general use|ready for general use]]. It has reached a mature form and is thought to be relatively bug-free and ready for use wherever appropriate. It is ready to mention on help pages and other Wikipedia resources as an option for new users to learn. To reduce server load and bad output, it should be improved by [[Wikipedia:Template sandbox and test cases|sandbox testing]] rather than repeated trial-and-error editing.<!--
-->{{#switch: {{SUBPAGENAME}}|doc|sandbox=<!-- No category for /doc or /sandbox subpages -->
| {{#ifeq: {{{nocat|}}} | true | <!-- No category if user sets nocat=true --> | [[Category:Modules for general use|{{PAGENAME}}]] }}
}}
| protected | protect | p = This module is [[:Category:Modules subject to page protection|subject to page protection]]. It is a [[Wikipedia:High-risk templates|highly visible module]] in use by a very large number of pages, or is [[Wikipedia:Substitution|substituted]] very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is [[Wikipedia:Protection policy|protected]] from editing.<!--
-->{{#switch: {{SUBPAGENAME}}|doc|sandbox=<!-- No category for /doc or /sandbox subpages -->
| {{#ifeq: {{{nocat|}}} | true | <!-- No category if user sets nocat=true --> | [[Category:Modules subject to page protection|{{PAGENAME}}]] }}
}}
| semiprotected | semiprotect | semi = This module is [[:Category:Modules subject to page protection|subject to page protection]]. It is a [[Wikipedia:High-risk templates|highly visible module]] in use by a very large number of pages, or is [[Wikipedia:Substitution|substituted]] very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is [[WP:SEMI|semi-protected]] from editing.<!--
-->{{#switch: {{SUBPAGENAME}}|doc|sandbox=<!-- No category for /doc or /sandbox subpages -->
| {{#ifeq: {{{nocat|}}} | true | <!-- No category if user sets nocat=true --> | [[Category:Modules subject to page protection|{{PAGENAME}}]] }}
}}
| #default = {{error|Module rating is invalid or not specified.}}
}}
}}|{{error|Error: {{tl|Module rating}} must be placed in the Module namespace.}} [[Category:Pages with templates in the wrong namespace]]|demospace={{{demospace|<noinclude>module</noinclude>}}}}}}}</includeonly><noinclude>
{{module rating|release|nocat=true|demospace=module}}
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go in Wikidata. -->
</noinclude>
bbd244b3ea2e13ec4c1c810ae44f2f3789a93efc
Module:YouTubeSubscribers/doc
828
176
370
369
2023-08-11T06:26:13Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{Module rating|beta}}
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
This module fetches a YouTube channel's subscriber count from its Wikidata entity.
== Usage ==
<code><nowiki>{{</nowiki>#invoke:YouTubeSubscribers|''subCount''<nowiki>|qid=</nowiki>''Wikidata entity ID'' (optional)<nowiki>}}</nowiki></code>
<code><nowiki>{{</nowiki>#invoke:YouTubeSubscribers|''subCountNice''<nowiki>|qid=</nowiki>''Wikidata entity ID'' (optional)<nowiki>}}</nowiki></code> – formats the subscriber count
<code><nowiki>{{</nowiki>#invoke:YouTubeSubscribers|''date''<nowiki>|qid=</nowiki>''Wikidata entity ID'' (optional)<nowiki>}}</nowiki></code>
<code><nowiki>{{</nowiki>#invoke:YouTubeSubscribers|''dateNice''<nowiki>|qid=</nowiki>''Wikidata entity ID'' (optional)<nowiki>}}</nowiki></code>
== Data retrieval problem codes ==
* '''-404''' – Could not find a single best YouTube channel ID for this item. Add a YouTube channel ID or set the rank of one channel ID to be preferred
* '''-412''' – Found an associated YouTube channel ID but could not find a most recent value for social media followers (i.e. P8687 qualified with P585 and P2397)
* '''-424''' – No qid found for page. Please make a Wikidata item for this article
==Error tracking category==
[[:Category:Pages with YouTubeSubscribers module errors]]
<includeonly>{{Sandbox other||
<!-- Categories below this line; interwikis at Wikidata -->
[[Category:Wikidata templates]]
}}</includeonly>
95e396dd285ce792eaf61ddaa36f81eb3de5de8e
Template:Para
10
177
372
371
2023-08-11T06:26:53Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
<code class="tpl-para" style="word-break:break-word;{{SAFESUBST:<noinclude />#if:{{{plain|}}}|border: none; background-color: inherit;}} {{SAFESUBST:<noinclude />#if:{{{plain|}}}{{{mxt|}}}{{{green|}}}{{{!mxt|}}}{{{red|}}}|color: {{SAFESUBST:<noinclude />#if:{{{mxt|}}}{{{green|}}}|#006400|{{SAFESUBST:<noinclude />#if:{{{!mxt|}}}{{{red|}}}|#8B0000|inherit}}}};}} {{SAFESUBST:<noinclude />#if:{{{style|}}}|{{{style}}}}}">|{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{1}}}=}}{{{2|}}}</code><noinclude>
{{Documentation}}
<!--Categories and interwikis go near the bottom of the /doc subpage.-->
</noinclude>
06006deea2ed5d552aab61b4332321ab749ae7e8
Module:Transclusion count/data/C
828
178
374
373
2023-08-11T06:26:57Z
InsaneX
2
1 revision imported
Scribunto
text/plain
return {
["C"] = 649000,
["C-Class"] = 17000,
["C-SPAN"] = 12000,
["C-cmn"] = 2600,
["C-pl"] = 52000,
["C."] = 4000,
["CAN"] = 20000,
["CANelec"] = 14000,
["CANelec/gain"] = 2600,
["CANelec/hold"] = 4900,
["CANelec/source"] = 7100,
["CANelec/top"] = 6400,
["CANelec/total"] = 6200,
["CAS"] = 3800,
["CBB_Standings_End"] = 14000,
["CBB_Standings_Entry"] = 14000,
["CBB_Standings_Start"] = 14000,
["CBB_Yearly_Record_End"] = 3100,
["CBB_Yearly_Record_Entry"] = 3100,
["CBB_Yearly_Record_Start"] = 3000,
["CBB_Yearly_Record_Subhead"] = 3700,
["CBB_Yearly_Record_Subtotal"] = 2900,
["CBB_roster/Footer"] = 7900,
["CBB_roster/Header"] = 7900,
["CBB_roster/Player"] = 7900,
["CBB_schedule_end"] = 11000,
["CBB_schedule_entry"] = 11000,
["CBB_schedule_start"] = 11000,
["CBB_standings_end"] = 15000,
["CBB_standings_entry"] = 15000,
["CBB_standings_start"] = 15000,
["CBB_yearly_record_end"] = 4100,
["CBB_yearly_record_end/legend"] = 3600,
["CBB_yearly_record_entry"] = 4100,
["CBB_yearly_record_start"] = 4000,
["CBB_yearly_record_subhead"] = 3700,
["CBB_yearly_record_subtotal"] = 3800,
["CBSB_Standings_End"] = 4200,
["CBSB_Standings_Entry"] = 4200,
["CBSB_Standings_Start"] = 4200,
["CBSB_link"] = 3500,
["CBSB_standings_end"] = 4400,
["CBSB_standings_entry"] = 4400,
["CBSB_standings_start"] = 4400,
["CC0"] = 3900,
["CENTURY"] = 16000,
["CFB_Standings_End"] = 34000,
["CFB_Standings_Entry"] = 34000,
["CFB_Standings_Start"] = 34000,
["CFB_Yearly_Record_End"] = 6800,
["CFB_Yearly_Record_End/legend"] = 2400,
["CFB_Yearly_Record_Entry"] = 6800,
["CFB_Yearly_Record_Start"] = 6800,
["CFB_Yearly_Record_Subhead"] = 6800,
["CFB_Yearly_Record_Subtotal"] = 6600,
["CFB_schedule"] = 26000,
["CFB_schedule_entry"] = 19000,
["CFB_standings_end"] = 34000,
["CFB_standings_entry"] = 34000,
["CFB_standings_start"] = 34000,
["CFL_Year"] = 5600,
["CGF_year"] = 2600,
["CHE"] = 10000,
["CHI"] = 2700,
["CHL"] = 3600,
["CHN"] = 11000,
["CN"] = 3400,
["CO2"] = 3300,
["COI"] = 14000,
["COIUL"] = 129000,
["COI_editnotice"] = 6700,
["COL"] = 4900,
["COLON"] = 13000,
["CRI"] = 2200,
["CRO"] = 5400,
["CSK"] = 2800,
["CSS_image_crop"] = 4500,
["CUB"] = 3700,
["CURRENTDATE"] = 3600,
["CURRENTMINUTE"] = 2500,
["CYP"] = 2100,
["CZE"] = 15000,
["Calendar"] = 2400,
["California/color"] = 12000,
["Call_sign_disambiguation"] = 3100,
["Campaignbox"] = 23000,
["CanProvName"] = 14000,
["CanadaByProvinceCatNav"] = 9800,
["CanadaProvinceThe"] = 4000,
["Canadian_English"] = 6900,
["Canadian_Parliament_links"] = 5100,
["Canadian_election_result"] = 14000,
["Canadian_election_result/gain"] = 2700,
["Canadian_election_result/hold"] = 5000,
["Canadian_election_result/source"] = 8100,
["Canadian_election_result/top"] = 14000,
["Canadian_election_result/top/ElectionYearTest"] = 5800,
["Canadian_election_result/total"] = 11000,
["Canadian_party_colour"] = 8100,
["Canadian_party_colour/colour"] = 18000,
["Canadian_party_colour/colour/default"] = 18000,
["Canadian_party_colour/name"] = 15000,
["Canadian_party_colour/name/default"] = 6900,
["Canned_search"] = 5500,
["Cardinal_to_word"] = 6400,
["Cascite"] = 15000,
["Caselaw_source"] = 4000,
["Cassini-Ehess"] = 2600,
["Cast_listing"] = 15000,
["Castlist"] = 2400,
["Cat"] = 345000,
["CatAutoTOC"] = 658000,
["CatAutoTOC/core"] = 657000,
["CatRel"] = 3800,
["CatTrack"] = 3100,
["Cat_class"] = 6700,
["Cat_in_use"] = 50000,
["Cat_main"] = 199000,
["Cat_more"] = 101000,
["Cat_more_if_exists"] = 41000,
["Cat_see_also"] = 3500,
["Catalog_lookup_link"] = 515000,
["Category-Class"] = 14000,
["Category-inline"] = 9100,
["Category_TOC"] = 72000,
["Category_TOC/tracking"] = 72000,
["Category_U.S._State_elections_by_year"] = 7300,
["Category_U.S._State_elections_by_year/core"] = 7300,
["Category_class"] = 35000,
["Category_class/column"] = 35000,
["Category_class/second_row_column"] = 35000,
["Category_described_in_year"] = 5700,
["Category_diffuse"] = 7800,
["Category_disambiguation"] = 2400,
["Category_disambiguation/category_link"] = 2400,
["Category_explanation"] = 236000,
["Category_handler"] = 3300000,
["Category_ifexist"] = 5100,
["Category_importance"] = 10000,
["Category_importance/column"] = 10000,
["Category_importance/second_row_column"] = 10000,
["Category_link"] = 135000,
["Category_link_with_count"] = 6800,
["Category_more"] = 111000,
["Category_more_if_exists"] = 41000,
["Category_ordered_by_date"] = 11000,
["Category_other"] = 895000,
["Category_redirect"] = 109000,
["Category_see_also"] = 39000,
["Category_see_also/Category_pair_check"] = 39000,
["Category_see_also_if_exists"] = 72000,
["Category_see_also_if_exists_2"] = 88000,
["Category_title"] = 2400,
["Catexp"] = 7900,
["CathEncy"] = 2300,
["Catholic"] = 4100,
["Catholic_Encyclopedia"] = 5100,
["Catmain"] = 27000,
["Catmore"] = 9400,
["Cbb_link"] = 8700,
["Cbignore"] = 100000,
["Cbsb_link"] = 2100,
["Cc-by-2.5"] = 3800,
["Cc-by-3.0"] = 8600,
["Cc-by-sa-2.5"] = 2600,
["Cc-by-sa-2.5,2.0,1.0"] = 2600,
["Cc-by-sa-3.0"] = 25000,
["Cc-by-sa-3.0,2.5,2.0,1.0"] = 2200,
["Cc-by-sa-3.0-migrated"] = 24000,
["Cc-by-sa-4.0"] = 10000,
["Cc-zero"] = 3800,
["CensusAU"] = 9200,
["Census_2016_AUS"] = 6900,
["Cent"] = 5700,
["Center"] = 287000,
["Centralized_discussion"] = 6100,
["Centralized_discussion/core"] = 6100,
["Centralized_discussion/styles.css"] = 6100,
["Centre"] = 3200,
["Century"] = 2100,
["Century_name_from_decade"] = 2400,
["Century_name_from_decade_or_year"] = 77000,
["Century_name_from_title_decade"] = 7600,
["Century_name_from_title_year"] = 7500,
["Certification_Cite/Title"] = 30000,
["Certification_Cite/URL"] = 33000,
["Certification_Cite/archivedate"] = 6000,
["Certification_Cite/archiveurl"] = 6000,
["Certification_Cite_Ref"] = 29000,
["Certification_Table_Bottom"] = 29000,
["Certification_Table_Entry"] = 30000,
["Certification_Table_Entry/Foot"] = 29000,
["Certification_Table_Entry/Foot/helper"] = 29000,
["Certification_Table_Entry/Region"] = 30000,
["Certification_Table_Entry/Sales"] = 29000,
["Certification_Table_Entry/Sales/BelgianPeriod"] = 2100,
["Certification_Table_Entry/Sales/DanishPeriod"] = 3200,
["Certification_Table_Entry/Sales/DanishPeriodHelper1"] = 3200,
["Certification_Table_Entry/Sales/DanishPeriodHelper2"] = 3200,
["Certification_Table_Entry/Sales/GermanPeriod"] = 4000,
["Certification_Table_Entry/Sales/ItalianHelper"] = 3200,
["Certification_Table_Entry/Sales/NewZealandPeriod"] = 2000,
["Certification_Table_Entry/Sales/SwedishPeriod"] = 2100,
["Certification_Table_Separator"] = 2300,
["Certification_Table_Top"] = 30000,
["Cfb_link"] = 24000,
["Cfd_result"] = 2400,
["Cfdend"] = 4000,
["Chart"] = 4600,
["Chart/end"] = 4700,
["Chart/start"] = 4600,
["Chart_bottom"] = 3500,
["Chart_top"] = 3500,
["Check_completeness_of_transclusions"] = 7300,
["Check_talk"] = 30000,
["Check_talk_wp"] = 1370000,
["Check_winner_by_scores"] = 13000,
["CheckedSockpuppet"] = 7200,
["Checked_sockpuppet"] = 18000,
["Checkedsockpuppet"] = 5300,
["Checkip"] = 13000,
["Checkuser"] = 75000,
["Checkuserblock-account"] = 17000,
["Chem"] = 5800,
["Chem/atom"] = 5700,
["Chem/link"] = 5800,
["Chem2"] = 4800,
["Chem_molar_mass"] = 18000,
["Chem_molar_mass/format"] = 18000,
["Chembox"] = 14000,
["Chembox/styles.css"] = 14000,
["Chembox_3DMet"] = 14000,
["Chembox_3DMet/format"] = 14000,
["Chembox_AllOtherNames"] = 13000,
["Chembox_AllOtherNames/format"] = 13000,
["Chembox_Appearance"] = 6100,
["Chembox_BoilingPt"] = 3800,
["Chembox_CASNo"] = 14000,
["Chembox_CASNo/format"] = 14000,
["Chembox_CalcTemperatures"] = 6800,
["Chembox_ChEBI"] = 14000,
["Chembox_ChEBI/format"] = 14000,
["Chembox_ChEMBL"] = 14000,
["Chembox_ChEMBL/format"] = 14000,
["Chembox_ChemSpiderID"] = 14000,
["Chembox_ChemSpiderID/format"] = 14000,
["Chembox_CompTox"] = 14000,
["Chembox_CompTox/format"] = 14000,
["Chembox_Datapage_check"] = 14000,
["Chembox_Density"] = 4900,
["Chembox_DrugBank"] = 14000,
["Chembox_DrugBank/format"] = 14000,
["Chembox_ECHA"] = 7600,
["Chembox_ECNumber"] = 14000,
["Chembox_ECNumber/format"] = 14000,
["Chembox_Elements"] = 14000,
["Chembox_Elements/molecular_formula"] = 18000,
["Chembox_Footer"] = 14000,
["Chembox_Footer/tracking"] = 14000,
["Chembox_GHS_(set)"] = 3500,
["Chembox_Hazards"] = 12000,
["Chembox_IUPHAR_ligand"] = 14000,
["Chembox_IUPHAR_ligand/format"] = 14000,
["Chembox_Identifiers"] = 14000,
["Chembox_InChI"] = 13000,
["Chembox_InChI/format"] = 13000,
["Chembox_Indexlist"] = 14000,
["Chembox_Jmol"] = 14000,
["Chembox_Jmol/format"] = 14000,
["Chembox_KEGG"] = 14000,
["Chembox_KEGG/format"] = 14000,
["Chembox_MeltingPt"] = 5800,
["Chembox_Properties"] = 14000,
["Chembox_PubChem"] = 14000,
["Chembox_PubChem/format"] = 14000,
["Chembox_RTECS"] = 14000,
["Chembox_RTECS/format"] = 14000,
["Chembox_Related"] = 3400,
["Chembox_SMILES"] = 13000,
["Chembox_SMILES/format"] = 13000,
["Chembox_SolubilityInWater"] = 3900,
["Chembox_Structure"] = 2100,
["Chembox_UNII"] = 14000,
["Chembox_UNII/format"] = 14000,
["Chembox_headerbar"] = 14000,
["Chembox_image"] = 13000,
["Chembox_image_cell"] = 12000,
["Chembox_image_sbs"] = 13000,
["Chembox_parametercheck"] = 13000,
["Chembox_setDatarow"] = 4500,
["Chembox_setHeader"] = 4500,
["Chembox_templatePar/formatPreviewMessage"] = 14000,
["Chembox_verification"] = 7100,
["Chemicals"] = 7400,
["Chemistry"] = 3100,
["Chemspidercite"] = 11000,
["Chessgames_player"] = 3600,
["Chinese"] = 7200,
["Chr"] = 9100,
["ChristianityWikiProject"] = 5700,
["Circa"] = 70000,
["Circular_reference"] = 4100,
["Citation"] = 403000,
["Citation/make_link"] = 6000,
["Citation/styles.css"] = 46000,
["Citation_needed"] = 544000,
["Citation_needed_span"] = 3500,
["Citation_style"] = 4300,
["Cite_AV_media"] = 43000,
["Cite_AV_media_notes"] = 26000,
["Cite_Appletons'"] = 2400,
["Cite_Australian_Dictionary_of_Biography"] = 3300,
["Cite_Catholic_Encyclopedia"] = 8100,
["Cite_Colledge2006"] = 3100,
["Cite_DCB"] = 2800,
["Cite_DNB"] = 18000,
["Cite_EB1911"] = 25000,
["Cite_GNIS"] = 2300,
["Cite_Gaia_DR2"] = 2100,
["Cite_IUCN"] = 58000,
["Cite_Instagram"] = 2000,
["Cite_Jewish_Encyclopedia"] = 2900,
["Cite_NIE"] = 3600,
["Cite_NSW_Parliament"] = 3300,
["Cite_NSW_SHR"] = 2600,
["Cite_ODNB"] = 17000,
["Cite_Q"] = 44000,
["Cite_QHR"] = 3000,
["Cite_QPN"] = 4000,
["Cite_Rowlett"] = 2500,
["Cite_Russian_law"] = 7800,
["Cite_Ryan"] = 3200,
["Cite_Sports-Reference"] = 54000,
["Cite_USGov"] = 24000,
["Cite_WoRMS"] = 5400,
["Cite_act"] = 2700,
["Cite_arXiv"] = 5000,
["Cite_bcgnis"] = 3100,
["Cite_book"] = 1590000,
["Cite_certification"] = 33000,
["Cite_cgndb"] = 3300,
["Cite_comic"] = 2100,
["Cite_conference"] = 16000,
["Cite_court"] = 5400,
["Cite_court/styles.css"] = 5400,
["Cite_dictionary"] = 3600,
["Cite_document"] = 5200,
["Cite_encyclopedia"] = 204000,
["Cite_episode"] = 17000,
["Cite_gnis"] = 34000,
["Cite_interview"] = 7700,
["Cite_iucn"] = 58000,
["Cite_journal"] = 957000,
["Cite_magazine"] = 269000,
["Cite_map"] = 39000,
["Cite_news"] = 1510000,
["Cite_newspaper_The_Times"] = 6500,
["Cite_patent"] = 5500,
["Cite_patent/authors"] = 4400,
["Cite_patent/core"] = 5800,
["Cite_peakbagger"] = 4500,
["Cite_podcast"] = 3800,
["Cite_press_release"] = 65000,
["Cite_report"] = 35000,
["Cite_rowlett"] = 2500,
["Cite_simbad"] = 4500,
["Cite_sports-reference"] = 59000,
["Cite_thesis"] = 32000,
["Cite_tweet"] = 36000,
["Cite_video"] = 12000,
["Cite_video_game"] = 3100,
["Cite_web"] = 4560000,
["Cite_wikisource"] = 5600,
["Cite_wikisource/make_link"] = 58000,
["Civil_navigation"] = 2700,
["Cl"] = 132000,
["Clade"] = 7500,
["Clade/styles.css"] = 7600,
["Clarify"] = 40000,
["Class"] = 686000,
["Class/colour"] = 8560000,
["Class/icon"] = 21000,
["Class_mask"] = 8340000,
["Class_mask/b"] = 342000,
["Classical"] = 6900,
["Classicon"] = 4700,
["Clc"] = 5900,
["Cleanup"] = 10000,
["Cleanup_bare_URLs"] = 28000,
["Cleanup_reorganize"] = 2500,
["Cleanup_rewrite"] = 5900,
["Clear"] = 2940000,
["Clear-left"] = 4100,
["Clear_left"] = 31000,
["Clear_right"] = 2700,
["Clerk-Note"] = 9800,
["Clerk_Request"] = 2000,
["Clerknote"] = 7400,
["Clickable_button"] = 16000,
["Clickable_button_2"] = 957000,
["Closed_access"] = 4400,
["Closed_rfc_top"] = 2200,
["Clr"] = 3600,
["Clubplayerscat"] = 8500,
["Cmbox"] = 418000,
["Cn"] = 93000,
["Cnote2"] = 2300,
["Cnote2_Begin"] = 2300,
["Cnote2_End"] = 2300,
["Coat_of_arms"] = 5200,
["Cob"] = 12000,
["Code"] = 50000,
["Col-1-of-2"] = 2400,
["Col-2"] = 170000,
["Col-2-of-2"] = 2300,
["Col-3"] = 10000,
["Col-4"] = 3500,
["Col-begin"] = 212000,
["Col-break"] = 211000,
["Col-end"] = 211000,
["Col-float"] = 2700,
["Col-float-break"] = 2600,
["Col-float-end"] = 2700,
["Col-float/styles.css"] = 2700,
["Col-start"] = 20000,
["Colbegin"] = 21000,
["Colend"] = 24000,
["Collapse"] = 9700,
["Collapse_bottom"] = 51000,
["Collapse_top"] = 52000,
["Collapsebottom"] = 3800,
["Collapsetop"] = 3800,
["Collapsible_list"] = 53000,
["Collapsible_option"] = 134000,
["College"] = 8800,
["CollegePrimaryHeader"] = 5900,
["CollegePrimaryStyle"] = 96000,
["CollegeSecondaryStyle"] = 3500,
["College_Athlete_Recruit_End"] = 2900,
["College_Athlete_Recruit_Entry"] = 3000,
["College_Athlete_Recruit_Start"] = 2900,
["College_athlete_recruit_end"] = 4000,
["College_athlete_recruit_entry"] = 4200,
["College_athlete_recruit_start"] = 4200,
["College_color_list"] = 3900,
["Colon"] = 18000,
["Color"] = 469000,
["Color_box"] = 73000,
["Colorbox"] = 3600,
["Colorbull"] = 4900,
["Colored_link"] = 63000,
["Colors"] = 3800,
["Colour"] = 5800,
["Coloured_link"] = 6900,
["Column"] = 2400,
["Column/styles.css"] = 2400,
["Columns-end"] = 2100,
["Columns-list"] = 98000,
["Columns-start"] = 2200,
["Comedy"] = 2500,
["Comic_Book_DB"] = 3500,
["Comicbookdb"] = 3500,
["Comics-replaceability"] = 2900,
["Comics_infobox_sec/creator_nat"] = 2800,
["Comics_infobox_sec/formcat"] = 3200,
["Comics_infobox_sec/genre"] = 4000,
["Comics_infobox_sec/genrecat"] = 3600,
["Comics_infobox_sec/styles.css"] = 8100,
["Comicsproj"] = 28000,
["Comma_separated_entries"] = 426000,
["Comma_separated_values"] = 45000,
["Comment"] = 5200,
["Committed_identity"] = 3000,
["Committed_identity/styles.css"] = 3000,
["Commons"] = 66000,
["Commons-inline"] = 20000,
["Commons_cat"] = 48000,
["Commons_category"] = 844000,
["Commons_category-inline"] = 147000,
["Commons_category_inline"] = 6000,
["Commonscat"] = 65000,
["Commonscat-inline"] = 17000,
["Commonscat_inline"] = 2400,
["Commonscatinline"] = 6600,
["Compact_TOC"] = 7000,
["Compact_ToC"] = 4800,
["Compare"] = 5200,
["Compare_image_with_Wikidata"] = 10000,
["Composition_bar"] = 10000,
["Confirmed"] = 16000,
["Confused"] = 2800,
["Confusing"] = 2400,
["CongBio"] = 9600,
["CongLinks"] = 4600,
["Connected_contributor"] = 18000,
["Connected_contributor_(paid)"] = 6800,
["Constellation_navbox"] = 6800,
["Container"] = 11000,
["Container_cat"] = 7600,
["Container_category"] = 42000,
["Containercat"] = 2600,
["Contains_special_characters"] = 4100,
["Contains_special_characters/core"] = 4100,
["Contains_special_characters/styles.css"] = 4100,
["Content_category"] = 7600,
["Contentious_topics/list"] = 13000,
["Contentious_topics/page_restriction_editnotice_base"] = 2400,
["Contentious_topics/page_restriction_talk_notice_base"] = 3600,
["Contentious_topics/talk_notice"] = 6600,
["Context"] = 2700,
["Continent2continental"] = 16000,
["Continent_adjective_to_noun"] = 2200,
["Controversial"] = 3300,
["Convert"] = 1170000,
["Convinfobox"] = 204000,
["Convinfobox/2"] = 17000,
["Convinfobox/3"] = 119000,
["Convinfobox/pri2"] = 63000,
["Convinfobox/prisec2"] = 3100,
["Convinfobox/prisec3"] = 26000,
["Convinfobox/sec2"] = 9300,
["Coord"] = 1330000,
["Coord_missing"] = 95000,
["Coord_missing/CheckCat"] = 95000,
["Coords"] = 7600,
["Copied"] = 19000,
["Copy_edit"] = 2500,
["Copy_to_Wikimedia_Commons"] = 109000,
["Copyvios"] = 4800,
["Cospar"] = 2500,
["Cot"] = 12000,
["Count"] = 661000,
["Country2continent"] = 36000,
["Country2continental"] = 2400,
["Country2nationality"] = 343000,
["CountryPrefixThe"] = 109000,
["Country_abbreviation"] = 88000,
["Country_alias"] = 16000,
["Country_at_games_navbox"] = 2700,
["Country_at_games_navbox/below"] = 2600,
["Country_data"] = 6900,
["Country_data_AFG"] = 2200,
["Country_data_ALB"] = 6600,
["Country_data_ALG"] = 9400,
["Country_data_AND"] = 3000,
["Country_data_ANG"] = 3900,
["Country_data_ARG"] = 47000,
["Country_data_ARM"] = 7400,
["Country_data_AUS"] = 76000,
["Country_data_AUT"] = 46000,
["Country_data_AZE"] = 9100,
["Country_data_Afghanistan"] = 12000,
["Country_data_Alaska"] = 2100,
["Country_data_Albania"] = 20000,
["Country_data_Alberta"] = 3600,
["Country_data_Algeria"] = 25000,
["Country_data_American_Samoa"] = 2900,
["Country_data_Andorra"] = 7900,
["Country_data_Angola"] = 12000,
["Country_data_Anguilla"] = 2500,
["Country_data_Antigua_and_Barbuda"] = 6100,
["Country_data_Apulia"] = 7900,
["Country_data_Argentina"] = 81000,
["Country_data_Arizona"] = 2300,
["Country_data_Arkansas"] = 2000,
["Country_data_Armenia"] = 22000,
["Country_data_Aruba"] = 3600,
["Country_data_Australia"] = 126000,
["Country_data_Austria"] = 78000,
["Country_data_Azerbaijan"] = 28000,
["Country_data_BAH"] = 4000,
["Country_data_BAN"] = 3900,
["Country_data_BAR"] = 2400,
["Country_data_BEL"] = 51000,
["Country_data_BER"] = 2300,
["Country_data_BHR"] = 4600,
["Country_data_BIH"] = 13000,
["Country_data_BLR"] = 24000,
["Country_data_BOL"] = 5800,
["Country_data_BOT"] = 2300,
["Country_data_BRA"] = 57000,
["Country_data_BUL"] = 26000,
["Country_data_Bahamas"] = 9800,
["Country_data_Bahrain"] = 12000,
["Country_data_Bangladesh"] = 18000,
["Country_data_Barbados"] = 8000,
["Country_data_Belarus"] = 44000,
["Country_data_Belgium"] = 89000,
["Country_data_Belize"] = 5300,
["Country_data_Benin"] = 7400,
["Country_data_Bermuda"] = 5800,
["Country_data_Bhutan"] = 4700,
["Country_data_Bolivia"] = 15000,
["Country_data_Bosnia_and_Herzegovina"] = 29000,
["Country_data_Botswana"] = 9200,
["Country_data_Brazil"] = 102000,
["Country_data_British_Columbia"] = 3400,
["Country_data_British_Raj"] = 2200,
["Country_data_British_Virgin_Islands"] = 3300,
["Country_data_Brunei"] = 6300,
["Country_data_Bulgaria"] = 52000,
["Country_data_Burkina_Faso"] = 10000,
["Country_data_Burma"] = 2700,
["Country_data_Burundi"] = 6100,
["Country_data_CAM"] = 2100,
["Country_data_CAN"] = 58000,
["Country_data_CGO"] = 2400,
["Country_data_CHE"] = 4700,
["Country_data_CHI"] = 18000,
["Country_data_CHL"] = 2100,
["Country_data_CHN"] = 42000,
["Country_data_CIV"] = 8100,
["Country_data_CMR"] = 8700,
["Country_data_COD"] = 3200,
["Country_data_COL"] = 25000,
["Country_data_CPV"] = 2100,
["Country_data_CRC"] = 6700,
["Country_data_CRO"] = 33000,
["Country_data_CUB"] = 10000,
["Country_data_CYP"] = 9100,
["Country_data_CZE"] = 46000,
["Country_data_California"] = 5900,
["Country_data_Cambodia"] = 8800,
["Country_data_Cameroon"] = 18000,
["Country_data_Canada"] = 122000,
["Country_data_Cape_Verde"] = 6400,
["Country_data_Castile_and_León"] = 2000,
["Country_data_Catalonia"] = 3100,
["Country_data_Cayman_Islands"] = 4200,
["Country_data_Central_African_Republic"] = 5100,
["Country_data_Chad"] = 5600,
["Country_data_Chile"] = 40000,
["Country_data_China"] = 83000,
["Country_data_Chinese_Taipei"] = 20000,
["Country_data_Colombia"] = 46000,
["Country_data_Colorado"] = 5700,
["Country_data_Comoros"] = 4400,
["Country_data_Confederate_States_of_America"] = 3100,
["Country_data_Connecticut"] = 3200,
["Country_data_Cook_Islands"] = 3800,
["Country_data_Costa_Rica"] = 18000,
["Country_data_Croatia"] = 57000,
["Country_data_Cuba"] = 23000,
["Country_data_Curaçao"] = 3600,
["Country_data_Cyprus"] = 23000,
["Country_data_Czech_Republic"] = 81000,
["Country_data_Czechoslovakia"] = 19000,
["Country_data_DEN"] = 34000,
["Country_data_DEU"] = 8700,
["Country_data_DNK"] = 3600,
["Country_data_DOM"] = 7300,
["Country_data_Democratic_Republic_of_the_Congo"] = 13000,
["Country_data_Denmark"] = 69000,
["Country_data_Djibouti"] = 4600,
["Country_data_Dominica"] = 4300,
["Country_data_Dominican_Republic"] = 17000,
["Country_data_ECU"] = 12000,
["Country_data_EGY"] = 13000,
["Country_data_ENG"] = 47000,
["Country_data_ESA"] = 2300,
["Country_data_ESP"] = 73000,
["Country_data_EST"] = 14000,
["Country_data_ETH"] = 3600,
["Country_data_EU"] = 3700,
["Country_data_East_Germany"] = 14000,
["Country_data_East_Timor"] = 5000,
["Country_data_Ecuador"] = 25000,
["Country_data_Egypt"] = 32000,
["Country_data_El_Salvador"] = 13000,
["Country_data_Empire_of_Japan"] = 4000,
["Country_data_England"] = 97000,
["Country_data_Equatorial_Guinea"] = 5200,
["Country_data_Eritrea"] = 5400,
["Country_data_Estonia"] = 34000,
["Country_data_Eswatini"] = 5100,
["Country_data_Ethiopia"] = 13000,
["Country_data_Europe"] = 2400,
["Country_data_European_Union"] = 7400,
["Country_data_FIJ"] = 3800,
["Country_data_FIN"] = 34000,
["Country_data_FRA"] = 98000,
["Country_data_FRG"] = 15000,
["Country_data_FRO"] = 2000,
["Country_data_FR_Yugoslavia"] = 4000,
["Country_data_Faroe_Islands"] = 5400,
["Country_data_Federated_States_of_Micronesia"] = 3100,
["Country_data_Fiji"] = 12000,
["Country_data_Finland"] = 68000,
["Country_data_Florida"] = 6500,
["Country_data_France"] = 193000,
["Country_data_French_Guiana"] = 2100,
["Country_data_French_Polynesia"] = 3800,
["Country_data_GAB"] = 2400,
["Country_data_GAM"] = 2100,
["Country_data_GBR"] = 55000,
["Country_data_GDR"] = 8400,
["Country_data_GEO"] = 14000,
["Country_data_GER"] = 82000,
["Country_data_GHA"] = 9800,
["Country_data_GRE"] = 25000,
["Country_data_GUA"] = 5000,
["Country_data_GUI"] = 3200,
["Country_data_GUY"] = 2300,
["Country_data_Gabon"] = 7600,
["Country_data_Gambia"] = 6800,
["Country_data_Georgia"] = 10000,
["Country_data_Georgia_(U.S._state)"] = 2800,
["Country_data_Georgia_(country)"] = 29000,
["Country_data_German_Empire"] = 5400,
["Country_data_Germany"] = 151000,
["Country_data_Ghana"] = 24000,
["Country_data_Gibraltar"] = 5000,
["Country_data_Great_Britain"] = 74000,
["Country_data_Greece"] = 57000,
["Country_data_Greenland"] = 2900,
["Country_data_Grenada"] = 5200,
["Country_data_Guadeloupe"] = 2800,
["Country_data_Guam"] = 4700,
["Country_data_Guatemala"] = 13000,
["Country_data_Guernsey"] = 2200,
["Country_data_Guinea"] = 8400,
["Country_data_Guinea-Bissau"] = 5100,
["Country_data_Guyana"] = 7400,
["Country_data_HAI"] = 3100,
["Country_data_HKG"] = 13000,
["Country_data_HON"] = 4300,
["Country_data_HUN"] = 37000,
["Country_data_Haiti"] = 8700,
["Country_data_Honduras"] = 12000,
["Country_data_Hong_Kong"] = 26000,
["Country_data_Hungary"] = 70000,
["Country_data_IDN"] = 5000,
["Country_data_INA"] = 10000,
["Country_data_IND"] = 30000,
["Country_data_IRE"] = 10000,
["Country_data_IRI"] = 5500,
["Country_data_IRL"] = 21000,
["Country_data_IRN"] = 6300,
["Country_data_IRQ"] = 4200,
["Country_data_ISL"] = 8600,
["Country_data_ISR"] = 21000,
["Country_data_ITA"] = 86000,
["Country_data_Iceland"] = 23000,
["Country_data_Idaho"] = 2000,
["Country_data_Illinois"] = 4400,
["Country_data_India"] = 109000,
["Country_data_Indiana"] = 2700,
["Country_data_Indonesia"] = 37000,
["Country_data_Iowa"] = 2900,
["Country_data_Iran"] = 92000,
["Country_data_Iraq"] = 14000,
["Country_data_Ireland"] = 34000,
["Country_data_Isle_of_Man"] = 2900,
["Country_data_Israel"] = 46000,
["Country_data_Italy"] = 145000,
["Country_data_Ivory_Coast"] = 18000,
["Country_data_JAM"] = 9800,
["Country_data_JOR"] = 4000,
["Country_data_JP"] = 8100,
["Country_data_JPN"] = 59000,
["Country_data_Jamaica"] = 21000,
["Country_data_Japan"] = 119000,
["Country_data_Jersey"] = 2600,
["Country_data_Jordan"] = 12000,
["Country_data_KAZ"] = 20000,
["Country_data_KEN"] = 7400,
["Country_data_KGZ"] = 3800,
["Country_data_KOR"] = 31000,
["Country_data_KOS"] = 2400,
["Country_data_KSA"] = 6000,
["Country_data_KUW"] = 4100,
["Country_data_Kazakhstan"] = 34000,
["Country_data_Kenya"] = 20000,
["Country_data_Kingdom_of_France"] = 2100,
["Country_data_Kingdom_of_Great_Britain"] = 4800,
["Country_data_Kingdom_of_Italy"] = 4200,
["Country_data_Kiribati"] = 3000,
["Country_data_Kosovo"] = 8800,
["Country_data_Kuwait"] = 11000,
["Country_data_Kyrgyzstan"] = 9300,
["Country_data_LAT"] = 15000,
["Country_data_LBN"] = 2400,
["Country_data_LIB"] = 2600,
["Country_data_LIE"] = 3100,
["Country_data_LIT"] = 3100,
["Country_data_LTU"] = 12000,
["Country_data_LUX"] = 10000,
["Country_data_LVA"] = 2600,
["Country_data_Laos"] = 7500,
["Country_data_Latvia"] = 32000,
["Country_data_Lebanon"] = 15000,
["Country_data_Lesotho"] = 5200,
["Country_data_Liberia"] = 7300,
["Country_data_Libya"] = 8700,
["Country_data_Liechtenstein"] = 7800,
["Country_data_Lithuania"] = 31000,
["Country_data_Luxembourg"] = 24000,
["Country_data_MAC"] = 2400,
["Country_data_MAD"] = 2000,
["Country_data_MAR"] = 12000,
["Country_data_MAS"] = 11000,
["Country_data_MDA"] = 7700,
["Country_data_MEX"] = 30000,
["Country_data_MGL"] = 2900,
["Country_data_MKD"] = 7600,
["Country_data_MLI"] = 4400,
["Country_data_MLT"] = 5600,
["Country_data_MNE"] = 7900,
["Country_data_MON"] = 3700,
["Country_data_MOZ"] = 2200,
["Country_data_MRI"] = 2100,
["Country_data_MYA"] = 3000,
["Country_data_MYS"] = 3700,
["Country_data_Macau"] = 6400,
["Country_data_Macedonia"] = 4900,
["Country_data_Madagascar"] = 9100,
["Country_data_Malawi"] = 5700,
["Country_data_Malaysia"] = 36000,
["Country_data_Maldives"] = 6100,
["Country_data_Mali"] = 12000,
["Country_data_Malta"] = 17000,
["Country_data_Manitoba"] = 2500,
["Country_data_Marshall_Islands"] = 3700,
["Country_data_Martinique"] = 2800,
["Country_data_Maryland"] = 3100,
["Country_data_Massachusetts"] = 3000,
["Country_data_Mauritania"] = 5900,
["Country_data_Mauritius"] = 8000,
["Country_data_Mexico"] = 67000,
["Country_data_Michigan"] = 4300,
["Country_data_Minnesota"] = 3700,
["Country_data_Missouri"] = 2000,
["Country_data_Moldova"] = 19000,
["Country_data_Monaco"] = 10000,
["Country_data_Mongolia"] = 9800,
["Country_data_Montana"] = 2100,
["Country_data_Montenegro"] = 18000,
["Country_data_Montserrat"] = 2500,
["Country_data_Morocco"] = 27000,
["Country_data_Mozambique"] = 7300,
["Country_data_Myanmar"] = 14000,
["Country_data_NAM"] = 3400,
["Country_data_NED"] = 60000,
["Country_data_NEP"] = 2900,
["Country_data_NGA"] = 8200,
["Country_data_NGR"] = 8100,
["Country_data_NIR"] = 10000,
["Country_data_NLD"] = 6100,
["Country_data_NOR"] = 30000,
["Country_data_NZ"] = 3200,
["Country_data_NZL"] = 32000,
["Country_data_Namibia"] = 9900,
["Country_data_Nauru"] = 2500,
["Country_data_Nazi_Germany"] = 9700,
["Country_data_Nepal"] = 17000,
["Country_data_Netherlands"] = 114000,
["Country_data_Netherlands_Antilles"] = 2300,
["Country_data_New_Brunswick"] = 2500,
["Country_data_New_Caledonia"] = 3400,
["Country_data_New_Jersey"] = 4200,
["Country_data_New_South_Wales"] = 5800,
["Country_data_New_York"] = 4800,
["Country_data_New_York_(state)"] = 6800,
["Country_data_New_Zealand"] = 67000,
["Country_data_Newfoundland_and_Labrador"] = 2300,
["Country_data_Nicaragua"] = 8300,
["Country_data_Niger"] = 6000,
["Country_data_Nigeria"] = 33000,
["Country_data_North_Carolina"] = 3500,
["Country_data_North_Korea"] = 13000,
["Country_data_North_Macedonia"] = 18000,
["Country_data_Northern_Ireland"] = 15000,
["Country_data_Northern_Mariana_Islands"] = 2900,
["Country_data_Norway"] = 73000,
["Country_data_Nova_Scotia"] = 2300,
["Country_data_OMA"] = 2700,
["Country_data_Ohio"] = 4800,
["Country_data_Oman"] = 8700,
["Country_data_Ontario"] = 3800,
["Country_data_Ottoman_Empire"] = 2500,
["Country_data_PAK"] = 7900,
["Country_data_PAN"] = 5800,
["Country_data_PAR"] = 10000,
["Country_data_PER"] = 12000,
["Country_data_PHI"] = 12000,
["Country_data_PHL"] = 2500,
["Country_data_PNG"] = 2700,
["Country_data_POL"] = 50000,
["Country_data_POR"] = 31000,
["Country_data_PRC"] = 2100,
["Country_data_PRK"] = 4600,
["Country_data_PRT"] = 2900,
["Country_data_PUR"] = 7300,
["Country_data_Pakistan"] = 29000,
["Country_data_Palau"] = 3000,
["Country_data_Palestine"] = 6800,
["Country_data_Panama"] = 16000,
["Country_data_Papua_New_Guinea"] = 8000,
["Country_data_Paraguay"] = 21000,
["Country_data_Pennsylvania"] = 3700,
["Country_data_People's_Republic_of_China"] = 3300,
["Country_data_Peru"] = 30000,
["Country_data_Philippines"] = 35000,
["Country_data_Poland"] = 150000,
["Country_data_Portugal"] = 68000,
["Country_data_Prussia"] = 2600,
["Country_data_Puerto_Rico"] = 17000,
["Country_data_QAT"] = 7900,
["Country_data_Qatar"] = 17000,
["Country_data_Quebec"] = 4200,
["Country_data_ROM"] = 13000,
["Country_data_ROU"] = 26000,
["Country_data_RSA"] = 31000,
["Country_data_RUS"] = 63000,
["Country_data_Republic_of_China"] = 5700,
["Country_data_Republic_of_Ireland"] = 26000,
["Country_data_Republic_of_the_Congo"] = 7700,
["Country_data_Romania"] = 68000,
["Country_data_Russia"] = 115000,
["Country_data_Russian_Empire"] = 4900,
["Country_data_Rwanda"] = 7600,
["Country_data_SAM"] = 3100,
["Country_data_SCG"] = 3100,
["Country_data_SCO"] = 26000,
["Country_data_SEN"] = 8000,
["Country_data_SER"] = 3600,
["Country_data_SGP"] = 2800,
["Country_data_SIN"] = 7000,
["Country_data_SLO"] = 19000,
["Country_data_SLV"] = 3000,
["Country_data_SMR"] = 3100,
["Country_data_SPA"] = 4800,
["Country_data_SRB"] = 26000,
["Country_data_SRI"] = 4700,
["Country_data_SUI"] = 42000,
["Country_data_SUR"] = 2000,
["Country_data_SVK"] = 29000,
["Country_data_SVN"] = 6700,
["Country_data_SWE"] = 57000,
["Country_data_SWI"] = 4700,
["Country_data_SYR"] = 3600,
["Country_data_Saint_Kitts_and_Nevis"] = 4800,
["Country_data_Saint_Lucia"] = 4900,
["Country_data_Saint_Vincent_and_the_Grenadines"] = 4800,
["Country_data_Samoa"] = 7700,
["Country_data_San_Marino"] = 8500,
["Country_data_Saskatchewan"] = 2900,
["Country_data_Saudi_Arabia"] = 19000,
["Country_data_Scotland"] = 52000,
["Country_data_Senegal"] = 17000,
["Country_data_Serbia"] = 54000,
["Country_data_Serbia_and_Montenegro"] = 5100,
["Country_data_Seychelles"] = 5500,
["Country_data_Sierra_Leone"] = 7400,
["Country_data_Singapore"] = 27000,
["Country_data_Slovakia"] = 51000,
["Country_data_Slovenia"] = 43000,
["Country_data_Solomon_Islands"] = 4700,
["Country_data_Somalia"] = 6200,
["Country_data_South_Africa"] = 70000,
["Country_data_South_Carolina"] = 3300,
["Country_data_South_Korea"] = 66000,
["Country_data_South_Sudan"] = 4100,
["Country_data_Soviet_Union"] = 36000,
["Country_data_Spain"] = 133000,
["Country_data_Sri_Lanka"] = 19000,
["Country_data_Sudan"] = 8100,
["Country_data_Suriname"] = 6500,
["Country_data_Sweden"] = 101000,
["Country_data_Switzerland"] = 83000,
["Country_data_Syria"] = 15000,
["Country_data_São_Tomé_and_Príncipe"] = 3400,
["Country_data_TAN"] = 2500,
["Country_data_TCH"] = 11000,
["Country_data_THA"] = 21000,
["Country_data_TJK"] = 2600,
["Country_data_TKM"] = 2800,
["Country_data_TPE"] = 15000,
["Country_data_TRI"] = 4800,
["Country_data_TUN"] = 11000,
["Country_data_TUR"] = 28000,
["Country_data_Taiwan"] = 13000,
["Country_data_Tajikistan"] = 9000,
["Country_data_Tanzania"] = 12000,
["Country_data_Texas"] = 5300,
["Country_data_Thailand"] = 44000,
["Country_data_Togo"] = 7000,
["Country_data_Tonga"] = 6400,
["Country_data_Trinidad_and_Tobago"] = 14000,
["Country_data_Tunisia"] = 22000,
["Country_data_Turkey"] = 74000,
["Country_data_Turkmenistan"] = 7900,
["Country_data_Turks_and_Caicos_Islands"] = 2600,
["Country_data_Tuvalu"] = 2800,
["Country_data_U.S."] = 2100,
["Country_data_U.S._Virgin_Islands"] = 4800,
["Country_data_UAE"] = 9300,
["Country_data_UGA"] = 4100,
["Country_data_UK"] = 19000,
["Country_data_UKGBI"] = 3100,
["Country_data_UKR"] = 37000,
["Country_data_URS"] = 14000,
["Country_data_URU"] = 15000,
["Country_data_US"] = 4900,
["Country_data_USA"] = 133000,
["Country_data_USSR"] = 4500,
["Country_data_UZB"] = 12000,
["Country_data_Uganda"] = 13000,
["Country_data_Ukraine"] = 73000,
["Country_data_United_Arab_Emirates"] = 20000,
["Country_data_United_Kingdom"] = 89000,
["Country_data_United_Kingdom_of_Great_Britain_and_Ireland"] = 4400,
["Country_data_United_Nations"] = 4000,
["Country_data_United_States"] = 282000,
["Country_data_United_States_of_America"] = 5000,
["Country_data_Uruguay"] = 29000,
["Country_data_Uzbekistan"] = 21000,
["Country_data_VEN"] = 17000,
["Country_data_VIE"] = 6400,
["Country_data_Vanuatu"] = 5100,
["Country_data_Vatican_City"] = 2300,
["Country_data_Venezuela"] = 33000,
["Country_data_Vietnam"] = 23000,
["Country_data_Virginia"] = 2900,
["Country_data_WAL"] = 17000,
["Country_data_Wales"] = 34000,
["Country_data_Washington"] = 3400,
["Country_data_Washington,_D.C."] = 2200,
["Country_data_Washington_(state)"] = 3700,
["Country_data_West_Germany"] = 24000,
["Country_data_West_Indies"] = 2600,
["Country_data_Wisconsin"] = 5200,
["Country_data_YUG"] = 9700,
["Country_data_Yemen"] = 7800,
["Country_data_Yugoslavia"] = 18000,
["Country_data_ZAF"] = 4700,
["Country_data_ZAM"] = 3300,
["Country_data_ZIM"] = 8300,
["Country_data_Zambia"] = 9600,
["Country_data_Zimbabwe"] = 18000,
["Country_flagbio"] = 27000,
["Country_name"] = 23000,
["Country_showdata"] = 6100,
["Country_topics"] = 22000,
["County"] = 7700,
["County_(judet)_of_Romania"] = 3300,
["Course_assignment"] = 4200,
["Course_details"] = 6300,
["Course_instructor"] = 2400,
["Cquote"] = 37000,
["Cr"] = 4300,
["Cr-rt"] = 2100,
["Create_taxonomy/link"] = 107000,
["Cref2"] = 2300,
["Cricinfo"] = 24000,
["Cricketarchive"] = 3000,
["Crime_opentask"] = 49000,
["Croatian_Census_2011"] = 2100,
["Cross"] = 3200,
["Crossreference"] = 2600,
["Crossreference/styles.css"] = 2600,
["Csv"] = 3000,
["Ct"] = 12000,
["Curlie"] = 6700,
["Currency"] = 3600,
["Current_events"] = 8200,
["Current_events/styles.css"] = 8200,
["Currentdate"] = 22000,
["Cvt"] = 103000,
["Cycling_Archives"] = 4300,
["Cycling_archives"] = 2500,
["Cycling_data_LTS"] = 2100,
["Cycling_data_TJV"] = 2000,
["Cycling_team_link"] = 12000,
["Module:CFB_schedule"] = 26000,
["Module:CallAssert"] = 244000,
["Module:CanElecResTopTest"] = 5800,
["Module:CanadaByProvinceCatNav"] = 9800,
["Module:Cat_main"] = 199000,
["Module:Catalog_lookup_link"] = 515000,
["Module:Category_described_in_year"] = 5700,
["Module:Category_described_in_year/conf"] = 5700,
["Module:Category_handler"] = 4430000,
["Module:Category_handler/blacklist"] = 4430000,
["Module:Category_handler/config"] = 4430000,
["Module:Category_handler/data"] = 4430000,
["Module:Category_handler/shared"] = 4430000,
["Module:Category_more_if_exists"] = 41000,
["Module:Category_pair"] = 6100,
["Module:Category_see_also"] = 39000,
["Module:Celestial_object_quadrangle"] = 2300,
["Module:Check_DYK_hook"] = 114000,
["Module:Check_for_clobbered_parameters"] = 1210000,
["Module:Check_for_deprecated_parameters"] = 59000,
["Module:Check_for_unknown_parameters"] = 18500000,
["Module:Check_isxn"] = 481000,
["Module:Check_winner_by_scores"] = 13000,
["Module:Checkuser"] = 76000,
["Module:Chem2"] = 4800,
["Module:Chem2/styles.css"] = 4800,
["Module:Citation/CS1"] = 5580000,
["Module:Citation/CS1/COinS"] = 5580000,
["Module:Citation/CS1/Configuration"] = 5580000,
["Module:Citation/CS1/Date_validation"] = 5580000,
["Module:Citation/CS1/Identifiers"] = 5580000,
["Module:Citation/CS1/Suggestions"] = 24000,
["Module:Citation/CS1/Utilities"] = 5580000,
["Module:Citation/CS1/Whitelist"] = 5580000,
["Module:Citation/CS1/styles.css"] = 5720000,
["Module:Cite_IUCN"] = 58000,
["Module:Cite_Q"] = 44000,
["Module:Cite_tweet"] = 36000,
["Module:Cite_web"] = 40000,
["Module:Clade"] = 7600,
["Module:Class"] = 10200000,
["Module:Class/definition.json"] = 10200000,
["Module:Class/styles.css"] = 9380000,
["Module:Class_mask"] = 10500000,
["Module:Clickable_button_2"] = 957000,
["Module:Collapsible_list"] = 55000,
["Module:College_color"] = 127000,
["Module:College_color/data"] = 127000,
["Module:Color_contrast"] = 499000,
["Module:Color_contrast/colors"] = 501000,
["Module:Commons_link"] = 257000,
["Module:Complex_date"] = 66000,
["Module:Convert"] = 1230000,
["Module:Convert/data"] = 1230000,
["Module:Convert/helper"] = 8600,
["Module:Convert/text"] = 1230000,
["Module:Convert/wikidata"] = 3300,
["Module:Convert/wikidata/data"] = 3300,
["Module:ConvertNumeric"] = 21000,
["Module:Convert_character_width"] = 2800,
["Module:Convert_character_width/data"] = 2800,
["Module:Coordinates"] = 1330000,
["Module:Coordinates/styles.css"] = 1330000,
["Module:Copied"] = 19000,
["Module:Count_banners"] = 47000,
["Module:CountryAdjectiveDemonym"] = 45000,
["Module:CountryAdjectiveDemonym/Adjectives"] = 45000,
["Module:CountryAdjectiveDemonym/Demonyms"] = 45000,
["Module:CountryAdjectiveDemonym/The"] = 45000,
["Module:CountryData"] = 143000,
["Module:CountryData/cacheA"] = 12000,
["Module:CountryData/cacheB"] = 8300,
["Module:CountryData/cacheC"] = 12000,
["Module:CountryData/cacheD"] = 4500,
["Module:CountryData/cacheE"] = 2800,
["Module:CountryData/cacheF"] = 2600,
["Module:CountryData/cacheG"] = 2700,
["Module:CountryData/summary"] = 143000,
["Module:Country_adjective"] = 4300,
["Module:Country_alias"] = 52000,
["Module:Country_alias/data"] = 52000,
["Module:Currency"] = 3600,
["Module:Currency/Presentation"] = 3600,
}
b5974d0194e019096fb2348ee080590d1895d8ea
Template:Used in system
10
179
376
375
2023-08-11T06:26:58Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:High-use|main|1=|2={{{2|}}}|system={{#if:{{{1|}}}|{{{1}}}|in system messages}}<noinclude>|nocat=true</noinclude>}}<noinclude>
{{documentation}}<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
0abe278369db6cbbe319e7452d7644e27e11c532
Module:Check for unknown parameters/doc
828
180
378
377
2023-08-11T06:27:00Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{Used in system|in [[MediaWiki:Abusefilter-warning-DS]]}}
{{Module rating|p}}
{{Lua|Module:If preview|noprotcat=yes}}
This module may be appended to a template to check for uses of unknown parameters. Unlike many other modules, this module is ''not'' implemented by a template.
== Usage ==
=== Basic usage ===
<syntaxhighlight lang="wikitext">
{{#invoke:Check for unknown parameters|check
|unknown=[[Category:Some tracking category]]
|arg1|arg2|arg3|argN}}
</syntaxhighlight>
or to sort the entries in the tracking category by parameter with a preview error message
<syntaxhighlight lang="wikitext">
{{#invoke:Check for unknown parameters|check
|unknown=[[Category:Some tracking category|_VALUE_]]
|preview=unknown parameter "_VALUE_"
|arg1|arg2|...|argN}}
</syntaxhighlight>
or for an explicit red error message
<syntaxhighlight lang="wikitext">
{{#invoke:Check for unknown parameters|check
|unknown=<span class="error">Sorry, I don't recognize _VALUE_</span>
|arg1|arg2|...|argN}}
</syntaxhighlight>
Here, <code>arg1</code>, <code>arg2</code>, ..., <code>argN</code>, are the known parameters. Unnamed (positional) parameters can be added too: <code><nowiki>|1|2|argname1|argname2|...</nowiki></code>. Any parameter which is used, but not on this list, will cause the module to return whatever is passed with the <code>unknown</code> parameter. The <code>_VALUE_</code> keyword, if used, will be changed to the name of the parameter. This is useful for either sorting the entries in a tracking category, or for provide more explicit information.
By default, the module makes no distinction between a defined-but-blank parameter and a non-blank parameter. That is, both unlisted {{Para|foo|x}} and {{Para|foo}} are reported. To only track non-blank parameters use {{Para|ignoreblank|1}}.
By default, the module ignores blank positional parameters. That is, an unlisted {{Para|2}} is ignored. To ''include'' blank positional parameters in the tracking use {{Para|showblankpositional|1}}.
=== Lua patterns ===
This module supports [[:mw:Extension:Scribunto/Lua reference manual#Patterns|Lua patterns]] (similar to [[regular expression]]s), which are useful when there are many known parameters which use a systematic pattern. For example, <code>[[Module:Infobox3cols|Infobox3cols]]</code> uses
<syntaxhighlight lang="lua">
regexp1 = "header[%d]+",
regexp2 = "label[%d]+",
regexp3 = "data[%d]+[abc]?",
regexp4 = "class[%d]+[abc]?",
regexp5 = "rowclass[%d]+",
regexp6 = "rowstyle[%d]+",
regexp7 = "rowcellstyle[%d]+",
</syntaxhighlight>
to match all parameters of the form <code>headerNUM</code>, <code>labelNUM</code>, <code>dataNUM</code>, <code>dataNUMa</code>, <code>dataNUMb</code>, <code>dataNUMc</code>, ..., <code>rowcellstyleNUM</code>, where NUM is a string of digits.
== Example ==
<syntaxhighlight lang="wikitext">
{{Infobox
| above = {{{name|}}}
| label1 = Height
| data1 = {{{height|}}}
| label2 = Weight
| data2 = {{{weight|}}}
| label3 = Website
| data3 = {{{website|}}}
}}<!--
end infobox, start tracking
-->{{#invoke:Check for unknown parameters|check
| unknown = {{Main other|[[Category:Some tracking category|_VALUE_]]}}
| preview = unknown parameter "_VALUE_"
| name
| height | weight
| website
}}
</syntaxhighlight>
==Call from within Lua code==
See the end of [[Module:Rugby box]] for a simple example or [[Module:Infobox3cols]] or [[Module:Flag]] for more complicated examples.
==See also==
* {{Clc|Unknown parameters}} (category page can have header {{tl|Unknown parameters category}})
* [[Module:Params]] – for complex operations involving parameters
* [[Template:Checks for unknown parameters]] – adds documentation to templates using this module
* [[Module:Check for deprecated parameters]] – similar module that checks for deprecated parameters
* [[Module:Check for clobbered parameters]] – module that checks for conflicting parameters
* [[Module:TemplatePar]] – similar function (originally from dewiki)
* [[Template:Parameters]] and [[Module:Parameters]] – generates a list of parameter names for a given template
* [[Project:TemplateData]] based template parameter validation
* [[Module:Parameter validation]] checks a lot more
* [[User:Bamyers99/TemplateParametersTool]] - A tool for checking usage of template parameters
<includeonly>{{Sandbox other||
<!-- Categories go here and interwikis go in Wikidata. -->
[[Category:Modules that add a tracking category]]
}}</includeonly>
31dc4e2854c7bd27db7480bd6e8c65ae8e364ac2
Template:DMCA
10
181
380
379
2023-08-11T06:28:38Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Dated maintenance category (articles)]]
{{Redirect category shell|
{{R from move}}
{{R from modification}}
{{R from template shortcut}}
}}
711d3f1c53fa704297f675a8dcf1a56719c5b654
Template:Dated maintenance category
10
182
382
381
2023-08-11T06:28:38Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
<nowiki/><!--This nowiki helps to prevent whitespace at the top of articles-->{{#ifeq:{{FULLROOTPAGENAME}}|Wikipedia:Template messages|<!--Do not categorize-->|<!--
-->{{#ifexpr:{{#if:{{NAMESPACE}}|0|1}}+{{#ifeq:{{{onlyarticles|no}}}|yes|0|1}}
|{{#if:{{{3|}}}
|[[Category:{{{1}}} {{{2}}} {{{3}}}]]<!--
-->{{#ifexist:Category:{{{1}}} {{{2}}} {{{3}}}
|<!--
-->|[[Category:Articles with invalid date parameter in template]]<!--
-->}}
|[[Category:{{#if:{{{5|}}}
|{{{5}}}<!--
-->|{{{1}}}<!--
-->}}]]<!--
-->}}{{#if:{{{4|}}}
|[[Category:{{{4}}}]]}}<!--
-->}}<!--
-->}}<noinclude>
{{documentation}}
</noinclude>
41e7d4000124d4f718ddf222af0b72825048c4c4
Template:FULLROOTPAGENAME
10
183
384
383
2023-08-11T06:28:39Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{ safesubst:<noinclude/>#if: {{ safesubst:<noinclude/>Ns has subpages | {{ safesubst:<noinclude/>#if:{{{1|}}}|{{ safesubst:<noinclude/>NAMESPACE:{{{1}}}}}|{{ safesubst:<noinclude/>NAMESPACE}}}} }}
| {{ safesubst:<noinclude/>#titleparts:{{ safesubst:<noinclude/>#if:{{{1|}}}|{{{1}}}|{{ safesubst:<noinclude/>FULLPAGENAME}}}}|1}}
| {{ safesubst:<noinclude/>#if:{{{1|}}}|{{{1}}}|{{ safesubst:<noinclude/>FULLPAGENAME}}}}
}}<noinclude>
{{documentation}}
</noinclude>
fd0c4e7050dded2d50e5df405e6e5e31dd0d46ac
Template:Ns has subpages
10
184
386
385
2023-08-11T06:28:39Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:Ns has subpages|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
060d2d01af26cb67fd90a7c346a0d2d5e450a040
Module:Unsubst
828
185
388
387
2023-08-11T06:28:39Z
InsaneX
2
1 revision imported
Scribunto
text/plain
local checkType = require('libraryUtil').checkType
local p = {}
local BODY_PARAM = '$B'
local specialParams = {
['$params'] = 'parameter list',
['$aliases'] = 'parameter aliases',
['$flags'] = 'flags',
['$B'] = 'template content',
['$template-name'] = 'template invocation name override',
}
function p.main(frame, body)
-- If we are substing, this function returns a template invocation, and if
-- not, it returns the template body. The template body can be specified in
-- the body parameter, or in the template parameter defined in the
-- BODY_PARAM variable. This function can be called from Lua or from
-- #invoke.
-- Return the template body if we aren't substing.
if not mw.isSubsting() then
if body ~= nil then
return body
elseif frame.args[BODY_PARAM] ~= nil then
return frame.args[BODY_PARAM]
else
error(string.format(
"no template content specified (use parameter '%s' from #invoke)",
BODY_PARAM
), 2)
end
end
-- Sanity check for the frame object.
if type(frame) ~= 'table'
or type(frame.getParent) ~= 'function'
or not frame:getParent()
then
error(
"argument #1 to 'main' must be a frame object with a parent " ..
"frame available",
2
)
end
-- Find the invocation name.
local mTemplateInvocation = require('Module:Template invocation')
local name
if frame.args['$template-name'] and '' ~= frame.args['$template-name'] then
name = frame.args['$template-name'] -- override whatever the template name is with this name
else
name = mTemplateInvocation.name(frame:getParent():getTitle())
end
-- Combine passed args with passed defaults
local args = {}
if string.find( ','..(frame.args['$flags'] or '')..',', ',%s*override%s*,' ) then
for k, v in pairs( frame:getParent().args ) do
args[k] = v
end
for k, v in pairs( frame.args ) do
if not specialParams[k] then
if v == '__DATE__' then
v = mw.getContentLanguage():formatDate( 'F Y' )
end
args[k] = v
end
end
else
for k, v in pairs( frame.args ) do
if not specialParams[k] then
if v == '__DATE__' then
v = mw.getContentLanguage():formatDate( 'F Y' )
end
args[k] = v
end
end
for k, v in pairs( frame:getParent().args ) do
args[k] = v
end
end
-- Trim parameters, if not specified otherwise
if not string.find( ','..(frame.args['$flags'] or '')..',', ',%s*keep%-whitespace%s*,' ) then
for k, v in pairs( args ) do args[k] = mw.ustring.match(v, '^%s*(.*)%s*$') or '' end
end
-- Pull information from parameter aliases
local aliases = {}
if frame.args['$aliases'] then
local list = mw.text.split( frame.args['$aliases'], '%s*,%s*' )
for k, v in ipairs( list ) do
local tmp = mw.text.split( v, '%s*>%s*' )
aliases[tonumber(mw.ustring.match(tmp[1], '^[1-9][0-9]*$')) or tmp[1]] = ((tonumber(mw.ustring.match(tmp[2], '^[1-9][0-9]*$'))) or tmp[2])
end
end
for k, v in pairs( aliases ) do
if args[k] and ( not args[v] or args[v] == '' ) then
args[v] = args[k]
end
args[k] = nil
end
-- Remove empty parameters, if specified
if string.find( ','..(frame.args['$flags'] or '')..',', ',%s*remove%-empty%s*,' ) then
local tmp = 0
for k, v in ipairs( args ) do
if v ~= '' or ( args[k+1] and args[k+1] ~= '' ) or ( args[k+2] and args[k+2] ~= '' ) then
tmp = k
else
break
end
end
for k, v in pairs( args ) do
if v == '' then
if not (type(k) == 'number' and k < tmp) then args[k] = nil end
end
end
end
-- Order parameters
if frame.args['$params'] then
local params, tmp = mw.text.split( frame.args['$params'], '%s*,%s*' ), {}
for k, v in ipairs(params) do
v = tonumber(mw.ustring.match(v, '^[1-9][0-9]*$')) or v
if args[v] then tmp[v], args[v] = args[v], nil end
end
for k, v in pairs(args) do tmp[k], args[k] = args[k], nil end
args = tmp
end
return mTemplateInvocation.invocation(name, args)
end
p[''] = p.main -- For backwards compatibility
return p
7f01ffc8aa2ac4a4772f14c12e0b77e384ecabb6
Module:Ns has subpages
828
186
390
389
2023-08-11T06:28:40Z
InsaneX
2
1 revision imported
Scribunto
text/plain
-- This module implements [[Template:Ns has subpages]].
-- While the template is fairly simple, this information is made available to
-- Lua directly, so using a module means that we don't have to update the
-- template as new namespaces are added.
local p = {}
function p._main(ns, frame)
-- Get the current namespace if we were not passed one.
if not ns then
ns = mw.title.getCurrentTitle().namespace
end
-- Look up the namespace table from mw.site.namespaces. This should work
-- for a majority of cases.
local nsTable = mw.site.namespaces[ns]
-- Try using string matching to get the namespace from page names.
-- Do a quick and dirty bad title check to try and make sure we do the same
-- thing as {{NAMESPACE}} in most cases.
if not nsTable and type(ns) == 'string' and not ns:find('[<>|%[%]{}]') then
local nsStripped = ns:gsub('^[_%s]*:', '')
nsStripped = nsStripped:gsub(':.*$', '')
nsTable = mw.site.namespaces[nsStripped]
end
-- If we still have no match then try the {{NAMESPACE}} parser function,
-- which should catch the remainder of cases. Don't use a mw.title object,
-- as this would increment the expensive function count for each new page
-- tested.
if not nsTable then
frame = frame or mw.getCurrentFrame()
local nsProcessed = frame:callParserFunction('NAMESPACE', ns)
nsTable = nsProcessed and mw.site.namespaces[nsProcessed]
end
return nsTable and nsTable.hasSubpages
end
function p.main(frame)
local ns = frame:getParent().args[1]
if ns then
ns = ns:match('^%s*(.-)%s*$') -- trim whitespace
ns = tonumber(ns) or ns
end
local hasSubpages = p._main(ns, frame)
return hasSubpages and 'yes' or ''
end
return p
e133068ba73738b16e1e3eba47735516a461eb5b
Template:Use dmy dates
10
187
392
391
2023-08-11T06:28:41Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{ <includeonly>safesubst:</includeonly>#invoke:Unsubst||date=__DATE__ |$B=
{{DMCA|Use dmy dates|from|{{{date|}}}}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using Use dmy dates template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Use dmy dates]] with unknown parameter "_VALUE_"|ignoreblank=y| cs1-dates | date }}}}<noinclude>{{documentation}}</noinclude>
3a087cd27e88fd70a0765c62d5ab506c3b73c9e7
Template:Section link
10
188
394
393
2023-08-11T06:28:45Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:Section link|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
8d047e5845f8a9b74a4655b5dd79ca7595a8f88b
Module:Section link
828
189
396
395
2023-08-11T06:28:45Z
InsaneX
2
1 revision imported
Scribunto
text/plain
-- This module implements {{section link}}.
require('strict');
local checkType = require('libraryUtil').checkType
local p = {}
local function makeSectionLink(page, section, display)
display = display or section
page = page or ''
-- MediaWiki doesn't allow these in `page`, so only need to do for `section`
if type(section) == 'string' then
section = string.gsub(section, "{", "{")
section = string.gsub(section, "}", "}")
end
return string.format('[[%s#%s|%s]]', page, section, display)
end
local function normalizeTitle(title)
title = mw.ustring.gsub(mw.ustring.gsub(title, "'", ""), '"', '')
title = mw.ustring.gsub(title, "%b<>", "")
return mw.title.new(title).prefixedText
end
function p._main(page, sections, options, title)
-- Validate input.
checkType('_main', 1, page, 'string', true)
checkType('_main', 3, options, 'table', true)
if sections == nil then
sections = {}
elseif type(sections) == 'string' then
sections = {sections}
elseif type(sections) ~= 'table' then
error(string.format(
"type error in argument #2 to '_main' " ..
"(string, table or nil expected, got %s)",
type(sections)
), 2)
end
options = options or {}
title = title or mw.title.getCurrentTitle()
-- Deal with blank page names elegantly
if page and not page:find('%S') then
page = nil
options.nopage = true
end
-- Make the link(s).
local isShowingPage = not options.nopage
if #sections <= 1 then
local linkPage = page or ''
local section = sections[1] or 'Notes'
local display = '§ ' .. section
if isShowingPage then
page = page or title.prefixedText
if options.display and options.display ~= '' then
if normalizeTitle(options.display) == normalizeTitle(page) then
display = options.display .. ' ' .. display
else
error(string.format(
'Display title "%s" was ignored since it is ' ..
"not equivalent to the page's actual title",
options.display
), 0)
end
else
display = page .. ' ' .. display
end
end
return makeSectionLink(linkPage, section, display)
else
-- Multiple sections. First, make a list of the links to display.
local ret = {}
for i, section in ipairs(sections) do
ret[i] = makeSectionLink(page, section)
end
-- Assemble the list of links into a string with mw.text.listToText.
-- We use the default separator for mw.text.listToText, but a custom
-- conjunction. There is also a special case conjunction if we only
-- have two links.
local conjunction
if #sections == 2 then
conjunction = '​ and '
else
conjunction = ', and '
end
ret = mw.text.listToText(ret, nil, conjunction)
-- Add the intro text.
local intro = '§§ '
if isShowingPage then
intro = (page or title.prefixedText) .. ' ' .. intro
end
ret = intro .. ret
return ret
end
end
function p.main(frame)
local yesno = require('Module:Yesno')
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Section link',
valueFunc = function (key, value)
value = value:match('^%s*(.-)%s*$') -- Trim whitespace
-- Allow blank first parameters, as the wikitext template does this.
if value ~= '' or key == 1 then
return value
end
end
})
for k, v in pairs(args) do -- replace underscores in the positional parameter values
if 'number' == type(k) then
if not yesno (args['keep-underscores']) then -- unless |keep-underscores=yes
args[k] = mw.uri.decode (v, 'WIKI'); -- percent-decode; replace underscores with space characters
else
args[k] = mw.uri.decode (v, 'PATH'); -- percent-decode; retain underscores
end
end
end
-- Sort the arguments.
local page
local sections, options = {}, {}
for k, v in pairs(args) do
if k == 1 then
-- Doing this in the loop because of a bug in [[Module:Arguments]]
-- when using pairs with deleted arguments.
page = mw.text.decode(v, true)
elseif type(k) == 'number' then
sections[k] = v
else
options[k] = v
end
end
options.nopage = yesno (options.nopage); -- make boolean
-- Extract section from page, if present
if page then
local p, s = page:match('^(.-)#(.*)$')
if p then page, sections[1] = p, s end
end
-- Compress the sections array.
local function compressArray(t)
local nums, ret = {}, {}
for num in pairs(t) do
nums[#nums + 1] = num
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[i] = t[num]
end
return ret
end
sections = compressArray(sections)
return p._main(page, sections, options)
end
return p
5cc61d43dc601ca43e9472500fc5cd09ca7cea44
Module:Transclusion count/data/I
828
190
398
397
2023-08-11T06:28:48Z
InsaneX
2
1 revision imported
Scribunto
text/plain
return {
["IAAF_name"] = 2200,
["IAST"] = 6100,
["IBDB_name"] = 9100,
["ICD10"] = 4700,
["ICD9"] = 4400,
["ICS"] = 2900,
["IDN"] = 3400,
["IMDb_episode"] = 9900,
["IMDb_episodes"] = 2600,
["IMDb_name"] = 153000,
["IMDb_title"] = 188000,
["IMO_Number"] = 4100,
["IMSLP"] = 8200,
["INA"] = 2100,
["IND"] = 7500,
["INR"] = 6500,
["INRConvert"] = 5600,
["INRConvert/CurrentRate"] = 5500,
["INRConvert/USD"] = 5500,
["INRConvert/out"] = 5500,
["IOC_profile"] = 5300,
["IP"] = 2600,
["IPA"] = 142000,
["IPA-all"] = 3600,
["IPA-de"] = 8100,
["IPA-es"] = 8100,
["IPA-fr"] = 44000,
["IPA-it"] = 5900,
["IPA-nl"] = 3700,
["IPA-pl"] = 4100,
["IPA-pt"] = 3700,
["IPA-ru"] = 2700,
["IPA-sh"] = 2700,
["IPA-sl"] = 6900,
["IPA-th"] = 3000,
["IPA_audio_link"] = 19000,
["IPA_link"] = 3400,
["IPAc-cmn"] = 2600,
["IPAc-en"] = 48000,
["IPAc-pl"] = 52000,
["IPC_athlete"] = 2800,
["IPSummary"] = 78000,
["IP_summary"] = 78000,
["IPtalk"] = 21000,
["IPuser"] = 7000,
["IPvandal"] = 2900,
["IRC"] = 7300,
["IRI"] = 2200,
["IRL"] = 5500,
["IRN"] = 3600,
["ISBN"] = 461000,
["ISBNT"] = 39000,
["ISBN_missing"] = 2500,
["ISFDB_name"] = 4100,
["ISFDB_title"] = 4600,
["ISL"] = 2100,
["ISO_15924/script-example-character"] = 2800,
["ISO_15924/wp-article"] = 2800,
["ISO_15924/wp-article/format"] = 2800,
["ISO_15924/wp-article/label"] = 2700,
["ISO_3166_code"] = 514000,
["ISO_3166_name"] = 16000,
["ISO_639_name"] = 8000,
["ISP"] = 5300,
["ISR"] = 4800,
["ISSN"] = 12000,
["ISSN_link"] = 30000,
["ISTAT"] = 8100,
["ISU_figure_skater"] = 2500,
["ITA"] = 17000,
["ITF"] = 6200,
["ITF_profile"] = 9000,
["ITIS"] = 4400,
["ITN_talk"] = 10000,
["ITN_talk/date"] = 10000,
["IUCN_banner"] = 15000,
["I_sup"] = 4500,
["Iaaf_name"] = 7400,
["Ice_hockey"] = 19000,
["Ice_hockey_stats"] = 16000,
["Icehockeystats"] = 12000,
["Icon"] = 576000,
["If"] = 269000,
["If_all"] = 6400,
["If_between"] = 3700,
["If_both"] = 798000,
["If_empty"] = 3630000,
["If_first_display_both"] = 73000,
["If_in_page"] = 9400,
["If_last_display_both"] = 30000,
["If_preview"] = 57000,
["If_then_show"] = 283000,
["Ifempty"] = 4000,
["Ifeq"] = 16000,
["Iferror_then_show"] = 3200,
["Ifexist_not_redirect"] = 1120000,
["Ifnotempty"] = 14000,
["Ifnumber"] = 35000,
["Ifsubst"] = 437000,
["Ih"] = 7500,
["Ill"] = 112000,
["Illm"] = 6700,
["Image_frame"] = 4900,
["Image_label"] = 4500,
["Image_label_begin"] = 3900,
["Image_label_end"] = 3500,
["Image_label_small"] = 2600,
["Image_needed"] = 4500,
["Image_other"] = 274000,
["Image_requested"] = 167000,
["Image_requested/Category_helper"] = 158000,
["Imbox"] = 914000,
["Imdb_name"] = 5400,
["Imdb_title"] = 4200,
["Import_style"] = 11000,
["Import_style/inputbox.css"] = 11000,
["Importance"] = 5610000,
["Importance/colour"] = 5620000,
["Importance_mask"] = 10200000,
["Improve_categories"] = 7400,
["Improve_documentation"] = 2300,
["In_class"] = 5800,
["In_lang"] = 353000,
["In_progress"] = 3200,
["In_string"] = 74000,
["In_title"] = 19000,
["Inactive_WikiProject_banner"] = 205000,
["Inactive_userpage_blanked"] = 4900,
["Include-USGov"] = 29000,
["Incomplete_list"] = 23000,
["Inconclusive"] = 2100,
["Increase"] = 43000,
["Incumbent_pope"] = 4300,
["Indent"] = 4300,
["IndexFungorum"] = 2200,
["Indian_English"] = 4300,
["Indian_Rupee"] = 10000,
["Indian_railway_code"] = 3200,
["Inflation"] = 19000,
["Inflation-fn"] = 5400,
["Inflation-year"] = 4400,
["Inflation/IN/startyear"] = 5500,
["Inflation/UK"] = 4300,
["Inflation/UK/dataset"] = 4300,
["Inflation/UK/startyear"] = 4300,
["Inflation/US"] = 12000,
["Inflation/US/dataset"] = 12000,
["Inflation/US/startyear"] = 12000,
["Inflation/fn"] = 6200,
["Inflation/year"] = 24000,
["Info"] = 7200,
["Infobox"] = 3210000,
["Infobox/Columns"] = 2400,
["Infobox/mobileviewfix.css"] = 143000,
["Infobox3cols"] = 17000,
["Infobox_AFL_biography"] = 14000,
["Infobox_Aircraft_Begin"] = 5400,
["Infobox_Aircraft_Type"] = 4700,
["Infobox_Athletics_Championships"] = 2700,
["Infobox_Australian_place"] = 15000,
["Infobox_CFL_biography"] = 2200,
["Infobox_COA_wide"] = 3100,
["Infobox_Canada_electoral_district"] = 2400,
["Infobox_Canadian_Football_League_biography"] = 5700,
["Infobox_Canadian_Football_League_biography/position"] = 5700,
["Infobox_Chinese"] = 20000,
["Infobox_Chinese/Chinese"] = 2700,
["Infobox_Chinese/Footer"] = 8700,
["Infobox_Chinese/Header"] = 8700,
["Infobox_Chinese/Korean"] = 17000,
["Infobox_Christian_leader"] = 18000,
["Infobox_Election"] = 2200,
["Infobox_French_commune"] = 38000,
["Infobox_GAA_player"] = 2800,
["Infobox_Gaelic_games_player"] = 5000,
["Infobox_German_location"] = 13000,
["Infobox_German_place"] = 14000,
["Infobox_Grand_Prix_race_report"] = 2000,
["Infobox_Greece_place"] = 2800,
["Infobox_Greek_Dimos"] = 2800,
["Infobox_Hindu_temple"] = 2400,
["Infobox_Indian_constituency"] = 4600,
["Infobox_Indian_constituency/defaultdata"] = 4600,
["Infobox_Italian_comune"] = 8100,
["Infobox_Korean_name"] = 15000,
["Infobox_Korean_name/categories"] = 15000,
["Infobox_MLB_yearly"] = 3100,
["Infobox_NASCAR_race_report"] = 2200,
["Infobox_NCAA_team_season"] = 18000,
["Infobox_NFL_biography"] = 28000,
["Infobox_NFL_player"] = 7900,
["Infobox_NFL_season"] = 2500,
["Infobox_NFL_team_season"] = 3900,
["Infobox_NRHP"] = 72000,
["Infobox_NRHP/conv"] = 18000,
["Infobox_NRHP/locmapin2region"] = 66000,
["Infobox_Officeholder"] = 4900,
["Infobox_Olympic_event"] = 7300,
["Infobox_Olympic_event/games_text"] = 7300,
["Infobox_Paralympic_event"] = 2600,
["Infobox_Paralympic_event/games_text"] = 2600,
["Infobox_Politician"] = 2200,
["Infobox_Romanian_subdivision"] = 3200,
["Infobox_Russian_district"] = 2000,
["Infobox_Russian_inhabited_locality"] = 4400,
["Infobox_SCOTUS_case"] = 3700,
["Infobox_Site_of_Special_Scientific_Interest"] = 2000,
["Infobox_Swiss_town"] = 2800,
["Infobox_Switzerland_municipality"] = 2900,
["Infobox_Turkey_place"] = 16000,
["Infobox_U.S._county"] = 3000,
["Infobox_U.S._county/district"] = 3000,
["Infobox_UK_constituency"] = 2100,
["Infobox_UK_constituency/year"] = 2100,
["Infobox_UK_legislation"] = 3200,
["Infobox_UK_place"] = 26000,
["Infobox_UK_place/NoDialCode"] = 7900,
["Infobox_UK_place/NoPostCode"] = 3100,
["Infobox_UK_place/area"] = 2400,
["Infobox_UK_place/dist"] = 2500,
["Infobox_UK_place/local"] = 26000,
["Infobox_UK_place/styles.css"] = 26000,
["Infobox_UN_resolution"] = 2300,
["Infobox_US_Supreme_Court_case"] = 3800,
["Infobox_US_Supreme_Court_case/courts"] = 3800,
["Infobox_Wikipedia_user"] = 9700,
["Infobox_YouTube_personality"] = 2600,
["Infobox_YouTube_personality/styles.css"] = 2600,
["Infobox_academic"] = 13000,
["Infobox_aircraft_begin"] = 14000,
["Infobox_aircraft_occurrence"] = 2300,
["Infobox_aircraft_type"] = 12000,
["Infobox_airline"] = 4600,
["Infobox_airport"] = 15000,
["Infobox_airport/datatable"] = 15000,
["Infobox_album"] = 161000,
["Infobox_album/color"] = 190000,
["Infobox_album/link"] = 161000,
["Infobox_anatomy"] = 4500,
["Infobox_ancient_site"] = 5300,
["Infobox_animanga/Footer"] = 6700,
["Infobox_animanga/Header"] = 6800,
["Infobox_animanga/Print"] = 5400,
["Infobox_animanga/Video"] = 4700,
["Infobox_architect"] = 3700,
["Infobox_artist"] = 28000,
["Infobox_artist_discography"] = 5900,
["Infobox_artwork"] = 11000,
["Infobox_athlete"] = 2900,
["Infobox_automobile"] = 8400,
["Infobox_award"] = 13000,
["Infobox_badminton_player"] = 3200,
["Infobox_baseball_biography"] = 28000,
["Infobox_baseball_biography/style"] = 28000,
["Infobox_baseball_biography/styles.css"] = 28000,
["Infobox_basketball_biography"] = 21000,
["Infobox_basketball_biography/style"] = 21000,
["Infobox_basketball_club"] = 3000,
["Infobox_beauty_pageant"] = 2400,
["Infobox_bilateral_relations"] = 4400,
["Infobox_body_of_water"] = 18000,
["Infobox_book"] = 52000,
["Infobox_boxer"] = 5700,
["Infobox_bridge"] = 6000,
["Infobox_building"] = 27000,
["Infobox_character"] = 7600,
["Infobox_chess_biography"] = 3800,
["Infobox_chess_player"] = 3100,
["Infobox_church"] = 15000,
["Infobox_church/denomination"] = 15000,
["Infobox_church/font_color"] = 15000,
["Infobox_civil_conflict"] = 2400,
["Infobox_civilian_attack"] = 5400,
["Infobox_college_coach"] = 11000,
["Infobox_college_football_game"] = 2100,
["Infobox_college_sports_team_season"] = 39000,
["Infobox_college_sports_team_season/link"] = 39000,
["Infobox_college_sports_team_season/name"] = 39000,
["Infobox_college_sports_team_season/succession"] = 39000,
["Infobox_college_sports_team_season/team"] = 39000,
["Infobox_comic_book_title"] = 2900,
["Infobox_comics_character"] = 3600,
["Infobox_comics_creator"] = 3500,
["Infobox_comics_creator/styles.css"] = 3500,
["Infobox_company"] = 83000,
["Infobox_computing_device"] = 2300,
["Infobox_concert"] = 3300,
["Infobox_constituency"] = 5200,
["Infobox_country"] = 6300,
["Infobox_country/formernext"] = 6000,
["Infobox_country/imagetable"] = 5200,
["Infobox_country/multirow"] = 8200,
["Infobox_country/status_text"] = 2700,
["Infobox_country/styles.css"] = 6400,
["Infobox_country_at_games"] = 15000,
["Infobox_country_at_games/core"] = 15000,
["Infobox_country_at_games/see_also"] = 12000,
["Infobox_court_case"] = 4600,
["Infobox_court_case/images"] = 2400,
["Infobox_cricket_tournament"] = 2300,
["Infobox_cricketer"] = 32000,
["Infobox_cricketer/career"] = 32000,
["Infobox_cricketer/national_side"] = 7500,
["Infobox_criminal"] = 6300,
["Infobox_curler"] = 2600,
["Infobox_cycling_race_report"] = 4500,
["Infobox_cyclist"] = 16000,
["Infobox_dam"] = 5600,
["Infobox_designation_list"] = 19000,
["Infobox_designation_list/entry"] = 17000,
["Infobox_dim"] = 6900,
["Infobox_dim/core"] = 6900,
["Infobox_diocese"] = 3800,
["Infobox_drug"] = 9600,
["Infobox_drug/chemical_formula"] = 9600,
["Infobox_drug/data_page_link"] = 9600,
["Infobox_drug/formatATC"] = 9500,
["Infobox_drug/formatCASnumber"] = 9600,
["Infobox_drug/formatChEBI"] = 9600,
["Infobox_drug/formatChEMBL"] = 9600,
["Infobox_drug/formatChemDBNIAID"] = 9600,
["Infobox_drug/formatChemSpider"] = 9600,
["Infobox_drug/formatCompTox"] = 9600,
["Infobox_drug/formatDrugBank"] = 9600,
["Infobox_drug/formatIUPHARBPS"] = 9600,
["Infobox_drug/formatJmol"] = 9600,
["Infobox_drug/formatKEGG"] = 9600,
["Infobox_drug/formatPDBligand"] = 8900,
["Infobox_drug/formatPubChemCID"] = 9600,
["Infobox_drug/formatPubChemSID"] = 9600,
["Infobox_drug/formatUNII"] = 9600,
["Infobox_drug/legal_status"] = 9700,
["Infobox_drug/licence"] = 9600,
["Infobox_drug/maintenance_categories"] = 9600,
["Infobox_drug/non-ref-space"] = 4000,
["Infobox_drug/pregnancy_category"] = 9600,
["Infobox_drug/title"] = 9600,
["Infobox_election"] = 29000,
["Infobox_election/row"] = 29000,
["Infobox_election/shortname"] = 28000,
["Infobox_enzyme"] = 5100,
["Infobox_ethnic_group"] = 7200,
["Infobox_event"] = 5400,
["Infobox_family"] = 2100,
["Infobox_figure_skater"] = 4200,
["Infobox_film"] = 155000,
["Infobox_film/short_description"] = 151000,
["Infobox_film_awards"] = 2600,
["Infobox_film_awards/link"] = 2600,
["Infobox_film_awards/style"] = 2600,
["Infobox_food"] = 6800,
["Infobox_football_biography"] = 205000,
["Infobox_football_club"] = 27000,
["Infobox_football_club_season"] = 20000,
["Infobox_football_league"] = 2600,
["Infobox_football_league_season"] = 19000,
["Infobox_football_match"] = 5900,
["Infobox_football_tournament_season"] = 7900,
["Infobox_former_subdivision"] = 3300,
["Infobox_former_subdivision/styles.css"] = 3300,
["Infobox_galaxy"] = 2100,
["Infobox_game"] = 2500,
["Infobox_game_score"] = 3400,
["Infobox_gene"] = 13000,
["Infobox_given_name"] = 4000,
["Infobox_golfer"] = 4400,
["Infobox_golfer/highest_ranking"] = 4400,
["Infobox_government_agency"] = 10000,
["Infobox_government_cabinet"] = 2500,
["Infobox_gridiron_football_person"] = 2500,
["Infobox_gridiron_football_person/position"] = 5700,
["Infobox_gymnast"] = 3400,
["Infobox_handball_biography"] = 4900,
["Infobox_historic_site"] = 11000,
["Infobox_horseraces"] = 2600,
["Infobox_hospital"] = 6300,
["Infobox_hospital/care_system"] = 6300,
["Infobox_hospital/lists"] = 6300,
["Infobox_ice_hockey_biography"] = 20000,
["Infobox_ice_hockey_player"] = 19000,
["Infobox_ice_hockey_team"] = 3000,
["Infobox_ice_hockey_team_season"] = 2000,
["Infobox_international_football_competition"] = 5700,
["Infobox_islands"] = 8700,
["Infobox_islands/area"] = 9100,
["Infobox_islands/density"] = 9100,
["Infobox_islands/length"] = 8700,
["Infobox_islands/styles.css"] = 8700,
["Infobox_journal"] = 9700,
["Infobox_journal/Abbreviation_search"] = 9600,
["Infobox_journal/Bluebook_check"] = 9400,
["Infobox_journal/Former_check"] = 9400,
["Infobox_journal/ISO_4_check"] = 9400,
["Infobox_journal/ISSN-eISSN"] = 9500,
["Infobox_journal/Indexing_search"] = 9500,
["Infobox_journal/MathSciNet_check"] = 9400,
["Infobox_journal/NLM_check"] = 9400,
["Infobox_journal/frequency"] = 8600,
["Infobox_lake"] = 4400,
["Infobox_language"] = 9500,
["Infobox_language/family-color"] = 11000,
["Infobox_language/genetic"] = 6500,
["Infobox_language/linguistlist"] = 9500,
["Infobox_language/ref"] = 7100,
["Infobox_legislature"] = 3600,
["Infobox_library"] = 2100,
["Infobox_lighthouse"] = 2600,
["Infobox_lighthouse/light"] = 2600,
["Infobox_locomotive"] = 4900,
["Infobox_magazine"] = 7600,
["Infobox_manner_of_address"] = 3300,
["Infobox_mapframe"] = 79000,
["Infobox_martial_artist"] = 5700,
["Infobox_martial_artist/record"] = 5700,
["Infobox_medal_templates"] = 421000,
["Infobox_medical_condition"] = 10000,
["Infobox_medical_condition_(new)"] = 8200,
["Infobox_medical_details"] = 2000,
["Infobox_military_conflict"] = 22000,
["Infobox_military_installation"] = 9700,
["Infobox_military_person"] = 45000,
["Infobox_military_unit"] = 26000,
["Infobox_mine"] = 2100,
["Infobox_model"] = 2300,
["Infobox_mountain"] = 28000,
["Infobox_multi-sport_competition_event"] = 2300,
["Infobox_museum"] = 10000,
["Infobox_musical_artist"] = 121000,
["Infobox_musical_artist/color"] = 121000,
["Infobox_musical_artist/hCard_class"] = 312000,
["Infobox_musical_composition"] = 2900,
["Infobox_name"] = 7400,
["Infobox_name_module"] = 6800,
["Infobox_newspaper"] = 9600,
["Infobox_nobility"] = 2400,
["Infobox_noble"] = 7300,
["Infobox_officeholder"] = 216000,
["Infobox_officeholder/office"] = 221000,
["Infobox_official_post"] = 8000,
["Infobox_organization"] = 36000,
["Infobox_pageant_titleholder"] = 3000,
["Infobox_park"] = 7300,
["Infobox_person"] = 469000,
["Infobox_person/Wikidata"] = 4900,
["Infobox_person/height"] = 102000,
["Infobox_person/length"] = 7100,
["Infobox_person/weight"] = 66000,
["Infobox_philosopher"] = 3400,
["Infobox_planet"] = 4700,
["Infobox_play"] = 3900,
["Infobox_political_party"] = 14000,
["Infobox_power_station"] = 3000,
["Infobox_prepared_food"] = 3100,
["Infobox_professional_wrestler"] = 4200,
["Infobox_professional_wrestling_event"] = 2600,
["Infobox_protected_area"] = 14000,
["Infobox_protein_family"] = 2100,
["Infobox_publisher"] = 2400,
["Infobox_racehorse"] = 5500,
["Infobox_racing_driver"] = 3800,
["Infobox_racing_driver_series_section"] = 2000,
["Infobox_radio_station"] = 22000,
["Infobox_rail"] = 2900,
["Infobox_rail_line"] = 7200,
["Infobox_rail_service"] = 2900,
["Infobox_rail_service/doc"] = 2900,
["Infobox_reality_competition_season"] = 3500,
["Infobox_record_label"] = 4000,
["Infobox_recurring_event"] = 6300,
["Infobox_religious_biography"] = 5200,
["Infobox_religious_building"] = 12000,
["Infobox_religious_building/color"] = 17000,
["Infobox_restaurant"] = 2700,
["Infobox_river"] = 30000,
["Infobox_river/calcunit"] = 30000,
["Infobox_river/discharge"] = 30000,
["Infobox_river/row-style"] = 30000,
["Infobox_river/source"] = 30000,
["Infobox_road"] = 24000,
["Infobox_road/meta/mask/category"] = 24000,
["Infobox_road/meta/mask/country"] = 24000,
["Infobox_road/styles.css"] = 25000,
["Infobox_road_small"] = 2300,
["Infobox_rockunit"] = 6400,
["Infobox_royalty"] = 21000,
["Infobox_royalty/short_description"] = 13000,
["Infobox_rugby_biography"] = 16000,
["Infobox_rugby_biography/correct_date"] = 16000,
["Infobox_rugby_biography/depcheck"] = 15000,
["Infobox_rugby_league_biography"] = 9900,
["Infobox_rugby_league_biography/PLAYER"] = 9800,
["Infobox_rugby_team"] = 2600,
["Infobox_sailboat_specifications"] = 2300,
["Infobox_saint"] = 5000,
["Infobox_school"] = 38000,
["Infobox_school/short_description"] = 38000,
["Infobox_school_district"] = 5600,
["Infobox_school_district/styles.css"] = 5600,
["Infobox_scientist"] = 48000,
["Infobox_service_record"] = 2600,
["Infobox_settlement"] = 559000,
["Infobox_settlement/areadisp"] = 233000,
["Infobox_settlement/columns"] = 94000,
["Infobox_settlement/columns/styles.css"] = 94000,
["Infobox_settlement/densdisp"] = 433000,
["Infobox_settlement/impus"] = 81000,
["Infobox_settlement/lengthdisp"] = 168000,
["Infobox_settlement/link"] = 94000,
["Infobox_settlement/metric"] = 207000,
["Infobox_settlement/pref"] = 289000,
["Infobox_settlement/styles.css"] = 559000,
["Infobox_ship_begin"] = 41000,
["Infobox_ship_career"] = 37000,
["Infobox_ship_characteristics"] = 41000,
["Infobox_ship_class_overview"] = 4100,
["Infobox_ship_image"] = 40000,
["Infobox_shopping_mall"] = 3400,
["Infobox_short_story"] = 2300,
["Infobox_skier"] = 2500,
["Infobox_soap_character"] = 2900,
["Infobox_software"] = 14000,
["Infobox_software/simple"] = 14000,
["Infobox_song"] = 75000,
["Infobox_song/color"] = 75000,
["Infobox_song/link"] = 75000,
["Infobox_spaceflight"] = 3500,
["Infobox_spaceflight/styles.css"] = 3500,
["Infobox_sport_event"] = 2100,
["Infobox_sports_competition_event"] = 17000,
["Infobox_sports_competition_event/medalrow"] = 11000,
["Infobox_sports_league"] = 5000,
["Infobox_sports_season"] = 5300,
["Infobox_sports_team"] = 2200,
["Infobox_sportsperson"] = 106000,
["Infobox_stadium"] = 3500,
["Infobox_station"] = 55000,
["Infobox_station/doc"] = 55000,
["Infobox_station/services"] = 55000,
["Infobox_station/styles.css"] = 55000,
["Infobox_street"] = 3400,
["Infobox_swimmer"] = 9300,
["Infobox_television"] = 56000,
["Infobox_television/Short_description"] = 54000,
["Infobox_television_channel"] = 6200,
["Infobox_television_episode"] = 12000,
["Infobox_television_episode/styles.css"] = 12000,
["Infobox_television_season"] = 9400,
["Infobox_television_station"] = 3700,
["Infobox_tennis_biography"] = 10000,
["Infobox_tennis_event"] = 2400,
["Infobox_tennis_tournament_event"] = 19000,
["Infobox_tennis_tournament_year"] = 9100,
["Infobox_tennis_tournament_year/color"] = 28000,
["Infobox_tennis_tournament_year/footer"] = 28000,
["Infobox_train"] = 2300,
["Infobox_union"] = 2100,
["Infobox_university"] = 26000,
["Infobox_user"] = 2600,
["Infobox_venue"] = 18000,
["Infobox_video_game"] = 28000,
["Infobox_video_game/styles.css"] = 28000,
["Infobox_volleyball_biography"] = 5300,
["Infobox_weapon"] = 7300,
["Infobox_website"] = 7700,
["Infobox_writer"] = 38000,
["Information"] = 102000,
["Information/styles.css"] = 102000,
["Inprogress"] = 2400,
["Input_link"] = 32000,
["Instagram"] = 11000,
["Interlanguage_link"] = 150000,
["Interlanguage_link_multi"] = 19000,
["Internet_Archive_author"] = 18000,
["Internet_Archive_film"] = 2500,
["Intitle"] = 12000,
["Invalid_SVG"] = 3600,
["Invalid_SVG/styles.css"] = 3600,
["Iptalk"] = 20000,
["IranCensus2006"] = 48000,
["IranNCSGN"] = 3200,
["Iran_Census_2006"] = 48000,
["Irc"] = 2100,
["Irish_place_name"] = 2600,
["IsIPAddress"] = 39000,
["IsValidPageName"] = 140000,
["Is_country_in_Central_America"] = 13000,
["Is_country_in_the_Caribbean"] = 14000,
["Is_interwiki_link"] = 6100,
["Is_italic_taxon"] = 473000,
["Is_redirect"] = 26000,
["Isbn"] = 7400,
["Isfdb_name"] = 3800,
["Isfdb_title"] = 4500,
["Isnumeric"] = 205000,
["Iso2continent"] = 35000,
["Iso2country"] = 23000,
["Iso2country/article"] = 22000,
["Iso2country/data"] = 23000,
["Iso2nationality"] = 224000,
["Issubst"] = 72000,
["Isu_name"] = 2200,
["Italic_dab2"] = 5200,
["Italic_title"] = 284000,
["Italic_title_prefixed"] = 8700,
["Italics_colon"] = 3700,
["Italictitle"] = 4300,
["Ivm"] = 5700,
["Ivm/styles.css"] = 5700,
["Ivmbox"] = 122000,
["Ivory_messagebox"] = 140000,
["Module:I18n/complex_date"] = 66000,
["Module:IP"] = 130000,
["Module:IPA_symbol"] = 4700,
["Module:IPA_symbol/data"] = 4700,
["Module:IPAc-en"] = 48000,
["Module:IPAc-en/data"] = 48000,
["Module:IPAc-en/phonemes"] = 48000,
["Module:IPAc-en/pronunciation"] = 48000,
["Module:IPAddress"] = 189000,
["Module:ISO_3166"] = 1030000,
["Module:ISO_3166/data/AT"] = 2500,
["Module:ISO_3166/data/BA"] = 3400,
["Module:ISO_3166/data/CA"] = 2500,
["Module:ISO_3166/data/CN"] = 2100,
["Module:ISO_3166/data/DE"] = 14000,
["Module:ISO_3166/data/ES"] = 3600,
["Module:ISO_3166/data/FR"] = 38000,
["Module:ISO_3166/data/GB"] = 6400,
["Module:ISO_3166/data/GR"] = 3100,
["Module:ISO_3166/data/IN"] = 29000,
["Module:ISO_3166/data/IR"] = 6300,
["Module:ISO_3166/data/National"] = 1030000,
["Module:ISO_3166/data/PL"] = 5800,
["Module:ISO_3166/data/RS"] = 3200,
["Module:ISO_3166/data/RU"] = 25000,
["Module:ISO_3166/data/US"] = 85000,
["Module:ISO_639_name"] = 20000,
["Module:ISOdate"] = 66000,
["Module:Icon"] = 577000,
["Module:Icon/data"] = 577000,
["Module:If_empty"] = 3630000,
["Module:If_in_page"] = 9400,
["Module:If_preview"] = 287000,
["Module:If_preview/configuration"] = 287000,
["Module:If_preview/styles.css"] = 287000,
["Module:Import_style"] = 11000,
["Module:In_lang"] = 354000,
["Module:Indent"] = 4300,
["Module:Infobox"] = 4080000,
["Module:Infobox/dates"] = 68000,
["Module:Infobox/styles.css"] = 4330000,
["Module:Infobox3cols"] = 295000,
["Module:InfoboxImage"] = 4380000,
["Module:Infobox_body_of_water_tracking"] = 18000,
["Module:Infobox_cyclist_tracking"] = 16000,
["Module:Infobox_gene"] = 13000,
["Module:Infobox_mapframe"] = 401000,
["Module:Infobox_military_conflict"] = 22000,
["Module:Infobox_military_conflict/styles.css"] = 22000,
["Module:Infobox_multi-lingual_name"] = 20000,
["Module:Infobox_multi-lingual_name/data"] = 20000,
["Module:Infobox_power_station"] = 3000,
["Module:Infobox_road"] = 25000,
["Module:Infobox_road/browselinks"] = 25000,
["Module:Infobox_road/errors"] = 24000,
["Module:Infobox_road/length"] = 25000,
["Module:Infobox_road/locations"] = 24000,
["Module:Infobox_road/map"] = 24000,
["Module:Infobox_road/route"] = 25000,
["Module:Infobox_road/sections"] = 24000,
["Module:Infobox_television"] = 56000,
["Module:Infobox_television_disambiguation_check"] = 63000,
["Module:Infobox_television_episode"] = 12000,
["Module:Infobox_television_season_disambiguation_check"] = 8900,
["Module:Infobox_television_season_name"] = 9400,
["Module:Internet_Archive"] = 18000,
["Module:IrelandByCountyCatNav"] = 3300,
["Module:Is_infobox_in_lead"] = 376000,
["Module:Is_instance"] = 334000,
["Module:Italic_title"] = 1110000,
["Module:Italic_title2"] = 5200,
}
a29f03d181b4fcf53177bd213f7cc28801871433
Template:Elc
10
191
400
399
2023-08-11T06:28:49Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
<includeonly><code>[<nowiki/>[{{{1}}}{{#if:{{{2|}}}|{{!}}{{{2}}}}}]<nowiki/>]{{{3|}}}</code></includeonly><!--
--><noinclude>
{{documentation}}
</noinclude>
d76ca6072fb7ca852811a573aa38e9026487417c
Template:Mlx
10
192
402
401
2023-08-11T06:28:49Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Module link expanded]]
{{Redirect category shell|
{{R from move}}
}}
3a80cf77e735d41b1611f1bd7f028ce9941330a2
Module:InfoboxImage/doc
828
193
404
403
2023-08-11T06:29:01Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{used in system}}
{{Module rating|protected}}
==Overview==
This module is used within infoboxes to process the image parameters and tidy up the formatting of the result.
==Parameters==
{| class="wikitable"
! Parameter
! Description
|-
| image
| Required. The main parameter that should be passed over which contains the image info.
|-
| size
| Size to display image, in pixels. Use is discouraged per [[WP:THUMBSIZE]]; see {{Para|upright}} below instead.
|-
| maxsize
| Maximum size to display image. Note: If no size or sizedefault params specified then image will be shown at maxsize.
|-
| sizedefault
| The size to use for the image if no size param is specified. Defaults to [[Wikipedia:Autosizing images|frameless]].
|-
| alt
| Alt text for the image.
|-
| title
| Title text for image (mouseover text).
|-
| border
| If yes, then a border is added.
|-
| page
| The page number to be displayed when using a multi-page image.
|-
| upright
| If upright=yes, adds "upright" which displays image at 75% of default image size (which is 220px if not changed at [[Special:Preferences]]). If a value, adds "upright=''value''" to image, where values less than 1 scale the image down (0.9 = 90%) and values greater than 1 scale the image up (1.15 = 115%).
|-
| center
| If yes, then the image is centered.
|-
| thumbtime
| thumbtime param, used for video clips.
|-
| suppressplaceholder
| If no, then will not suppress certain placeholder images. See {{section link||Placeholder images which can be suppressed}}.
|-
| link
| Page to go to when clicking on the image.
|-
| class
| HTML classes to add to the image.
|}
Note: If you specify the maxsize or sizedefault params, then you should include the px after the number.
{{Use dmy dates|date=July 2016}}
==Parameters displayed in image syntax==
All parameters:
:<syntaxhighlight lang="wikitext" style="overflow:auto;">{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | size={{{size}}} | maxsize={{{maxsize}}} | sizedefault={{{sizedefault}}} | upright={{{upright}}} | alt={{{alt}}} | title={{{title}}} | thumbtime={{{thumbtime}}} | link={{{link}}} | border=yes | center=yes | page={{{page}}} | class={{{class}}} }}</syntaxhighlight>
:<code>{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | size={{{size}}} | maxsize={{{maxsize}}} | sizedefault={{{sizedefault}}} | upright={{{upright}}} | alt={{{alt}}} | title={{{title}}} | thumbtime={{{thumbtime}}} | link={{{link}}} | border=yes | center=yes | page={{{page}}} | class={{{class}}}}}</code>
When "size" and "maxsize" are defined, the smaller of the two is used (if "px" is omitted it will be added by the module):
:<syntaxhighlight lang="wikitext" style="overflow:auto;">{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | size=300px | maxsize=250px }}</syntaxhighlight>
:<code>{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | size=300px | maxsize=250px }}</code>
When "size" is not defined, "sizedefault" is used, even if larger than "maxsize" (in actual use "px" is required after the number; omitted here to show it is not added by the module):
:<syntaxhighlight lang="wikitext" style="overflow:auto;">{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | sizedefault=250px | maxsize=200px }}</syntaxhighlight>
:<code>{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | sizedefault=250px | maxsize=200px }}</code>
When "size" and "sizedefault" are not defined, "maxsize" is used (in actual use "px" is required after the number; omitted here to show it is not added by the module):
:<syntaxhighlight lang="wikitext" style="overflow:auto;">{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | maxsize=250px }}</syntaxhighlight>
:<code>{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | maxsize=250px }}</code>
When "size", "sizedefault", and "maxsize" are not defined, "frameless" is added, which displays the image at the default thumbnail size (220px, but logged in users can change this at [[Special:Preferences]]) and is required if using "upright" to scale the default size:
:<syntaxhighlight lang="wikitext" style="overflow:auto;">{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} }}</syntaxhighlight>
:<code>{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} }}</code>
Use of "upright" without a number value, which displays the image at approximately 75% of the user's default size (multiplied by 0.75 then rounded to nearest 10):
:<syntaxhighlight lang="wikitext" style="overflow:auto;">{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | upright = yes }}</syntaxhighlight>
:<code>{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | upright = yes }}</code>
When "alt" is used without "title", the alt text is also used as the title:
:<syntaxhighlight lang="wikitext" style="overflow:auto;">{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | alt = Alt text }}</syntaxhighlight>
:<code>{{#invoke:InfoboxImage | InfoboxImage | image={{{image}}} | alt = Alt text }}</code>
For more information, see [[Wikipedia:Extended image syntax]].
==Sample usage==
<syntaxhighlight lang="wikitext" style="overflow:auto;">
|image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|upright={{{image_upright|1}}}|alt={{{alt|}}}}}
</syntaxhighlight>
==Examples==
{| class="wikitable"
|-
| {{mlx|InfoboxImage|InfoboxImage}}
| {{#invoke:InfoboxImage|InfoboxImage}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}}}
| {{#invoke:InfoboxImage|InfoboxImage|image=}}
|-
|
{{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg}}<br />
{{mlx|InfoboxImage|InfoboxImage|image{{=}}File:Abbey Rd Studios.jpg}}<br />
{{mlx|InfoboxImage|InfoboxImage|image{{=}}Image:Abbey Rd Studios.jpg}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg}}
|-
|
{{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|upright{{=}}yes}}<br />
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|upright=yes}}
|-
|
{{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|upright{{=}}1.2}}<br />
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|upright=1.2}}
|-
|
{{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|size{{=}}100px}}<br />
{{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|size{{=}}100}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|size=100px}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}{{elc|Image:Abbey Rd Studios.jpg|200px}}}}
| {{#invoke:InfoboxImage|InfoboxImage|image=[[Image:Abbey Rd Studios.jpg|200px]]}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}{{elc|Image:Abbey Rd Studios.jpg|200px}}|title=Abbey Road!}}
| {{#invoke:InfoboxImage|InfoboxImage|image=[[Image:Abbey Rd Studios.jpg|200px]]|title=Abbey Road!}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|sizedefault{{=}}250px|alt{{=}}The front stairs and door of Abbey Road Studios}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|sizedefault=250px|alt=The front stairs and door of Abbey Road Studios}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|sizedefault{{=}}250|alt{{=}}The front stairs and door of Abbey Road Studios}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|sizedefault=250|alt=The front stairs and door of Abbey Road Studios}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|sizedefault{{=}}250px|alt{{=}}The front stairs and door of Abbey Road Studios|title=Exterior, front view of Abbey Road studios}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|sizedefault=250px|alt=The front stairs and door of Abbey Road Studios|title=Exterior, front view of Abbey Road studios}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|alt{{=}}The front stairs and door of Abbey Road Studios}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|alt=The front stairs and door of Abbey Road Studios}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|size{{=}}100px|alt{{=}}The front stairs and door of Abbey Road Studios}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|size=100px|alt=The front stairs and door of Abbey Road Studios}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Bandera de Bilbao.svg|size{{=}}100|border{{=}}yes}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Bandera de Bilbao.svg|size=200|border=yes}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Image is needed male.svg}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Image is needed male.svg}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Image is needed male.svg|suppressplaceholder=no}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Image is needed male.svg|suppressplaceholder=no}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}{{elc|File:Image is needed male.svg|200px}}}}
| {{#invoke:InfoboxImage|InfoboxImage|image=[[File:Image is needed male.svg|200px]]}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}{{elc|File:Image is needed male.svg|200px}}|suppressplaceholder{{=}}no}}
| {{#invoke:InfoboxImage|InfoboxImage|image=[[File:Image is needed male.svg|200px]]|suppressplaceholder=no}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|size=50px|maxsize{{=}}100px}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|size=50px|maxsize=100px}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|size=200px|maxsize{{=}}100px}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|size=200px|maxsize=100px}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}{{elc|File:Abbey Rd Studios.jpg|200px}}|maxsize{{=}}100px}}
| {{#invoke:InfoboxImage|InfoboxImage|image=[[File:Abbey Rd Studios.jpg|200px]]|maxsize=100px}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}Abbey Rd Studios.jpg|maxsize{{=}}100px|center{{=}}yes}}
| {{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|maxsize=100px|center=yes}}
|-
| {{mlx|InfoboxImage|InfoboxImage|image{{=}}no such image|maxsize{{=}}100px|center{{=}}yes}}<!-- this issue sh'd be fixed somewhow-->
| {{#invoke:InfoboxImage|InfoboxImage|image=no such image|maxsize=100px|center=yes}}
|}
== Placeholder images which can be suppressed ==
{|
| style="vertical-align:top;" |
* [[:File:Blue - replace this image female.svg]]
* [[:File:Blue - replace this image male.svg]]
* [[:File:Female no free image yet.png]]
* [[:File:Male no free image yet.png]]
* [[:File:Flag of None (square).svg]]
* [[:File:Flag of None.svg]]
* [[:File:Flag of.svg]]
* [[:File:Green - replace this image female.svg]]
* [[:File:Green - replace this image male.svg]]
* [[:File:Image is needed female.svg]]
* [[:File:Image is needed male.svg]]
* [[:File:Location map of None.svg]]
* [[:File:Male no free image yet.png]]
* [[:File:Missing flag.png]]
* [[:File:No flag.svg]]
* [[:File:No free portrait.svg]]
* [[:File:No portrait (female).svg]]
* [[:File:No portrait (male).svg]]
* [[:File:Red - replace this image female.svg]]
* [[:File:Red - replace this image male.svg]]
* [[:File:Replace this image female (blue).svg]]
* [[:File:Replace this image female.svg]]
* [[:File:Replace this image male (blue).svg]]
* [[:File:Replace this image male.svg]]
* [[:File:Silver - replace this image female.svg]]
* [[:File:Silver - replace this image male.svg]]
* [[:File:Replace this image.svg]]
* [[:File:Cricket no pic.png]]
* [[:File:CarersLogo.gif]]
* [[:File:Diagram Needed.svg]]
* [[:File:Example.jpg]]
* [[:File:Image placeholder.png]]
* [[:File:No male portrait.svg]]
* [[:File:Nocover-upload.png]]
* [[:File:NoDVDcover copy.png]]
* [[:File:Noribbon.svg]]
| style="vertical-align:top;" |
* [[:File:No portrait-BFD-test.svg]]
* [[:File:Placeholder barnstar ribbon.png]]
* [[:File:Project Trains no image.png]]
* [[:File:Image-request.png]]
* [[:File:Sin bandera.svg]]
* [[:File:Sin escudo.svg]]
* [[:File:Replace this image - temple.png]]
* [[:File:Replace this image butterfly.png]]
* [[:File:Replace this image.svg]]
* [[:File:Replace this image1.svg]]
* [[:File:Resolution angle.png]]
* [[:File:Image-No portrait-text-BFD-test.svg]]
* [[:File:Insert image here.svg]]
* [[:File:No image available.png]]
* [[:File:NO IMAGE YET square.png]]
* [[:File:NO IMAGE YET.png]]
* [[:File:No Photo Available.svg]]
* [[:File:No Screenshot.svg]]
* [[:File:No-image-available.jpg]]
* [[:File:Null.png]]
* [[:File:PictureNeeded.gif]]
* [[:File:Place holder.jpg]]
* [[:File:Unbenannt.JPG]]
* [[:File:UploadACopyrightFreeImage.svg]]
* [[:File:UploadAnImage.gif]]
* [[:File:UploadAnImage.svg]]
* [[:File:UploadAnImageShort.svg]]
* [[:File:CarersLogo.gif]]
* [[:File:Diagram Needed.svg]]
* [[:File:No male portrait.svg]]
* [[:File:NoDVDcover copy.png]]
* [[:File:Placeholder barnstar ribbon.png]]
* [[:File:Project Trains no image.png]]
* [[:File:Image-request.png]]
|}
== Tracking categories ==
* {{clc|Pages using infoboxes with thumbnail images}}
<includeonly>{{Sandbox other||
{{DEFAULTSORT:Image, {{PAGENAME}}}}
[[Category:Modules for image handling]]
[[Category:Modules that add a tracking category]]
[[Category:Infobox modules]]
}}</includeonly>
c94fcbc786f35c8e23c8f499b3090efc604852c7
Template:Module link expanded
10
194
406
405
2023-08-11T06:29:02Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
<includeonly><code>{{{{{{{|safesubst:}}}#invoke:Separated entries|main|[[Module:{{{1}}}{{{section|}}}|#invoke:{{{1}}}]]|{{{2|''function''}}}|separator=|}}}}</code></includeonly><noinclude>{{documentation}}<!-- Categories go on the /doc subpage and interwikis go on Wikidata. --></noinclude>
fe65540c0f768ae41c071fe8617ea0d5c38617e7
Template:Dated maintenance category (articles)
10
195
408
407
2023-08-11T06:29:02Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{Dated maintenance category
|onlyarticles=yes
|1={{{1|}}}
|2={{{2|}}}
|3={{{3|}}}
|4={{{4|}}}
|5={{{5|}}}
}}<noinclude>
{{documentation|Template:Dated maintenance category/doc}}
</noinclude>
6bbc57c75cc28708a0e71dd658224d5945d80d68
Template:High-use
10
196
410
409
2023-08-11T06:29:31Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:High-use|main|1={{{1|}}}|2={{{2|}}}|info={{{info|}}}|demo={{{demo|}}}|form={{{form|}}}|expiry={{{expiry|}}}|system={{{system|}}}}}<noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage; interwiki links go to Wikidata, thank you! -->
</noinclude>
a3322d1bd47ac03df14fa2090855cff4fede9bc7
Module:Infobox/doc
828
197
412
411
2023-08-11T06:29:35Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{High-use|3308957|all-pages = yes}}
{{module rating|protected}}
{{Lua|Module:Navbar|Module:Italic title}}
{{Uses TemplateStyles|Module:Infobox/styles.css|Template:Hlist/styles.css|Template:Plainlist/styles.css}}
'''Module:Infobox''' is a [[WP:Module|module]] that implements the {{tl|Infobox}} template. Please see the template page for usage instructions.
== Tracking categories ==
* {{clc|Pages using infobox templates with ignored data cells}}
* {{clc|Articles using infobox templates with no data rows}}
* {{clc|Pages using embedded infobox templates with the title parameter}}
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
[[Category:Modules that add a tracking category]]
[[Category:Wikipedia infoboxes]]
[[Category:Infobox modules]]
[[Category:Modules that check for strip markers]]
}}</includeonly>
936ad219eb263a6f3293d62f667bd7b5db1059c1
Template:Pp
10
198
414
413
2023-08-11T06:30:21Z
InsaneX
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:Protection banner|main}}<noinclude>
{{documentation}}
</noinclude>
4b195ffc44cfde864ef77b55a54c006333226ced
User:Epicguyeditz
2
199
416
2023-08-11T06:38:03Z
Epicguyeditz
6
nothing
wikitext
text/x-wiki
"'''khalid kalakhel'''" also known as "'''epicguy_editz'''" is an pakistani geotuber, He is known for his youtube videos with an channel over 590+ subscribers and 200,000 views.
4c959d98c60edbe28172f37082f9c3724a2ad4b7
420
416
2023-08-11T06:56:33Z
Epicguyeditz
6
wikitext
text/x-wiki
"'''khalid kalakhel'''" also known as "'''epicguy_editz'''" is an pakistani geotuber, He is known for his youtube videos with an channel over 590+ subscribers and 200,000+ views as of August 11th. he started his youtube channel in '''December of 2018''', he is '''13 years old''' and wants '''1000 subscribers''' on youtube.
1a04dcf49b0e925b66618af7feff58b68c2cf9a2
421
420
2023-08-11T07:00:42Z
Epicguyeditz
6
wikitext
text/x-wiki
"'''khalid kalakhel'''" also known as "'''epicguy_editz'''" is an '''pakistani geotuber''', He is known for his youtube videos with an channel over 590+ subscribers and 200,000+ views as of August 11th. he started his youtube channel in '''December of 2018''', he is '''13 years old''' and wants '''1000 subscribers''' on youtube. He is '''Hyderabad''', A city in '''pakistan'''
fa0d351cff1f37d0a7d27723b9c9a29e8b01601b
User talk:Epicguyeditz
3
200
417
2023-08-11T06:51:21Z
InsaneX
2
Created page with "Hey, Welcome to Geotubepedia! Happy to see good people like you joining us!"
wikitext
text/x-wiki
Hey, Welcome to Geotubepedia!
Happy to see good people like you joining us!
48b5e824b67decfc37dcfb48b4a8e6f2fe58ae39
418
417
2023-08-11T06:51:37Z
InsaneX
2
wikitext
text/x-wiki
Hey, Welcome to Geotubepedia!
Happy to see good people like you joining us! [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 06:51, 11 August 2023 (UTC)
60982f0c7f1664899d8cc91b83d4725fb469ad3d
419
418
2023-08-11T06:52:01Z
InsaneX
2
wikitext
text/x-wiki
== Welcome ==
Hey, Welcome to Geotubepedia!
Happy to see good people like you joining us! [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 06:51, 11 August 2023 (UTC)
bdf0649a7f438bdb095b25c185e74f0245786e40
User:Epicguyeditz
2
199
422
421
2023-08-11T07:07:30Z
Epicguyeditz
6
h
wikitext
text/x-wiki
"'''khalid kalakhel'''" also known as "'''epicguy_editz'''" is an '''pakistani geotuber''', He is known for his youtube videos with an channel over 590+ subscribers and 200,000+ views as of August 11th. he started his youtube channel in '''December of 2018''', he is '''13 years old''' and wants '''1000 subscribers''' on youtube. He is from '''Hyderabad''', A city in '''pakistan''
688d085bd9c71f633da53de8859573e973b5effd
428
422
2023-08-11T07:18:15Z
Epicguyeditz
6
added content
wikitext
text/x-wiki
"'''khalid kalakhel'''" also known as "'''epicguy_editz'''" is an '''pakistani geotuber''', He is known for his youtube videos with an channel over 590+ subscribers and 200,000+ views as of August 11th. he started his youtube channel in '''December of 2018''', he is '''13 years old''' and wants '''1000 subscribers''' on youtube. He is from '''Hyderabad''', A city in '''pakistan. he uses capcut and alight motion to make his edits''
3b0165fc12685e9981bfd381b588a1b417e217df
431
428
2023-08-11T07:24:39Z
Epicguyeditz
6
my name
wikitext
text/x-wiki
"'''<span lang="ur" dir="ltr">khalid kalakhel</span>'''" also known as "'''epicguy_editz'''" is an '''pakistani geotuber''', He is known for his youtube videos with an channel over 590+ subscribers and 200,000+ views as of August 11th. he started his youtube channel in '''December of 2018''', he is '''13 years old''' and wants '''1000 subscribers''' on youtube. He is from '''Hyderabad''', A city in '''pakistan. he uses capcut and alight motion to make his edits''
f87f1bc64e5eacdda08177a7bb72bf4aec0ff008
436
431
2023-08-11T07:39:03Z
Epicguyeditz
6
I removed all of my text, how do you generate things about me without doing no work?
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
437
436
2023-08-11T07:42:03Z
InsaneX
2
wikitext
text/x-wiki
Why you removed all the text?
1b96b2f1f30aa6325fcf256b25fbefa3a8307b6e
User talk:Epicguyeditz
3
200
423
419
2023-08-11T07:09:53Z
Epicguyeditz
6
/* . */ new section
wikitext
text/x-wiki
== Welcome ==
Hey, Welcome to Geotubepedia!
Happy to see good people like you joining us! [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 06:51, 11 August 2023 (UTC)
== . ==
subscribe to me [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:09, 11 August 2023 (UTC)
== . ==
subscribe to me [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:09, 11 August 2023 (UTC)
5669b4d63891f66e39eb2a5c34d5cedf8fa59793
424
423
2023-08-11T07:11:25Z
InsaneX
2
wikitext
text/x-wiki
== Welcome ==
Hey, Welcome to Geotubepedia!
Happy to see good people like you joining us! [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 06:51, 11 August 2023 (UTC)
== Give Discord Link ==
Can you give me your Discord account name or anything else? I will create a page for you
== . ==
subscribe to me [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:09, 11 August 2023 (UTC)
== . ==
subscribe to me [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:09, 11 August 2023 (UTC)
cf2b80a46bbc617a3ccdc0872932066ab8b23e83
425
424
2023-08-11T07:11:36Z
InsaneX
2
wikitext
text/x-wiki
== Welcome ==
Hey, Welcome to Geotubepedia!
Happy to see good people like you joining us! [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 06:51, 11 August 2023 (UTC)
== Give Discord Link ==
Can you give me your Discord account name or anything else? I will create a page for you [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 07:11, 11 August 2023 (UTC)
== . ==
subscribe to me [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:09, 11 August 2023 (UTC)
== . ==
subscribe to me [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:09, 11 August 2023 (UTC)
508a69c14d6f4411aca0c4fbebad38ce8fbf3793
426
425
2023-08-11T07:14:04Z
Epicguyeditz
6
wikitext
text/x-wiki
== Welcome ==
Hey, Welcome to Geotubepedia!
Happy to see good people like you joining us! [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 06:51, 11 August 2023 (UTC)
== Give Discord Link ==
Can you give me your Discord account name or anything else? I will create a page for you [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 07:11, 11 August 2023 (UTC)
d1sbeliefs [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:14, 11 August 2023 (UTC)
== . ==
subscribe to me [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:09, 11 August 2023 (UTC)
== . ==
subscribe to me [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:09, 11 August 2023 (UTC)
2edf0a3d68767c80df69b8757325231846bcd85c
429
426
2023-08-11T07:18:47Z
Epicguyeditz
6
wikitext
text/x-wiki
== Welcome ==
Hey, Welcome to Geotubepedia!
Happy to see good people like you joining us! [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 06:51, 11 August 2023 (UTC)
== Give Discord Link ==
Can you give me your Discord account name or anything else? I will create a page for you [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 07:11, 11 August 2023 (UTC)
d1sbeliefs [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:14, 11 August 2023 (UTC)
d1sbeliefs [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:18, 11 August 2023 (UTC)
== . ==
subscribe to me [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:09, 11 August 2023 (UTC)
== . ==
subscribe to me [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:09, 11 August 2023 (UTC)
53af60bab0f357b34202d89d0c08617c1b32fe3a
430
429
2023-08-11T07:22:02Z
Epicguyeditz
6
wikitext
text/x-wiki
== Welcome ==
Hey, Welcome to Geotubepedia!
Happy to see good people like you joining us! [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 06:51, 11 August 2023 (UTC)
t [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:22, 11 August 2023 (UTC)
== Give Discord Link ==
Can you give me your Discord account name or anything else? I will create a page for you [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 07:11, 11 August 2023 (UTC)
d1sbeliefs [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:14, 11 August 2023 (UTC)
d1sbeliefs [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:18, 11 August 2023 (UTC)
== . ==
subscribe to me [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:09, 11 August 2023 (UTC)
== . ==
subscribe to me [[User:Epicguyeditz|Epicguyeditz]] ([[User talk:Epicguyeditz|talk]]) 07:09, 11 August 2023 (UTC)
fc2b56ab3840af6698e807626301f0932df30a5c
User:InsaneX
2
201
427
2023-08-11T07:17:01Z
InsaneX
2
Created page with "Hello, I am the creator of Geotubepedia!"
wikitext
text/x-wiki
Hello,
I am the creator of Geotubepedia!
72d131e0a28242b968c6a2a52d29cec6113f6a87
Module:Message box/ombox.css
828
81
432
165
2023-08-11T07:33:30Z
InsaneX
2
InsaneX changed the content model of the page [[Module:Message box/ombox.css]] from "plain text" to "Sanitized CSS": For Troubleshooting
sanitized-css
text/css
/* {{pp|small=y}} */
.ombox {
margin: 4px 0;
border-collapse: collapse;
border: 1px solid #a2a9b1; /* Default "notice" gray */
background-color: #f8f9fa;
box-sizing: border-box;
}
/* For the "small=yes" option. */
.ombox.mbox-small {
font-size: 88%;
line-height: 1.25em;
}
.ombox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
.ombox-delete {
border: 2px solid #b32424; /* Red */
}
.ombox-content {
border: 1px solid #f28500; /* Orange */
}
.ombox-style {
border: 1px solid #fc3; /* Yellow */
}
.ombox-move {
border: 1px solid #9932cc; /* Purple */
}
.ombox-protection {
border: 2px solid #a2a9b1; /* Gray-gold */
}
.ombox .mbox-text {
border: none;
/* @noflip */
padding: 0.25em 0.9em;
width: 100%;
}
.ombox .mbox-image {
border: none;
/* @noflip */
padding: 2px 0 2px 0.9em;
text-align: center;
}
.ombox .mbox-imageright {
border: none;
/* @noflip */
padding: 2px 0.9em 2px 0;
text-align: center;
}
/* An empty narrow cell */
.ombox .mbox-empty-cell {
border: none;
padding: 0;
width: 1px;
}
.ombox .mbox-invalid-type {
text-align: center;
}
@media (min-width: 720px) {
.ombox {
margin: 4px 10%;
}
.ombox.mbox-small {
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin: 4px 0 4px 1em;
width: 238px;
}
}
8fe3df4bb607e699eab2dbd23bd4a1a446391002
Module:Shortcut/styles.css
828
88
433
179
2023-08-11T07:34:52Z
InsaneX
2
InsaneX changed the content model of the page [[Module:Shortcut/styles.css]] from "plain text" to "Sanitized CSS"
sanitized-css
text/css
/* {{pp-template}} */
.module-shortcutboxplain {
float: right;
margin: 0 0 0 1em;
border: 1px solid #aaa;
background: #fff;
padding: 0.3em 0.6em 0.2em 0.6em;
text-align: center;
font-size: 85%;
}
.module-shortcutboxleft {
float: left;
margin: 0 1em 0 0;
}
.module-shortcutlist {
display: inline-block;
border-bottom: 1px solid #aaa;
margin-bottom: 0.2em;
}
.module-shortcutboxplain ul {
font-weight: bold;
}
.module-shortcutanchordiv {
position: relative;
top: -3em;
}
li .module-shortcutanchordiv {
float: right; /* IE/Edge in list items */
}
.mbox-imageright .module-shortcutboxplain {
padding: 0.4em 1em 0.4em 1em;
line-height: 1.3;
margin: 0;
}
ccf3877e4b14726147d3b1d8a297fbecacdb2cf8
Template:Plainlist/styles.css
10
87
434
177
2023-08-11T07:35:36Z
InsaneX
2
InsaneX changed the content model of the page [[Template:Plainlist/styles.css]] from "plain text" to "Sanitized CSS"
sanitized-css
text/css
/* {{pp-template|small=yes}} */
.plainlist ol,
.plainlist ul {
line-height: inherit;
list-style: none;
margin: 0;
padding: 0; /* Reset Minerva default */
}
.plainlist ol li,
.plainlist ul li {
margin-bottom: 0;
}
51706efa229ff8794c0d94f260a208e7c5e6ec30
Module:Documentation/styles.css
828
58
435
119
2023-08-11T07:38:12Z
InsaneX
2
InsaneX changed the content model of the page [[Module:Documentation/styles.css]] from "plain text" to "Sanitized CSS"
sanitized-css
text/css
/* {{pp|small=yes}} */
.documentation,
.documentation-metadata {
border: 1px solid #a2a9b1;
background-color: #ecfcf4;
clear: both;
}
.documentation {
margin: 1em 0 0 0;
padding: 1em;
}
.documentation-metadata {
margin: 0.2em 0; /* same margin left-right as .documentation */
font-style: italic;
padding: 0.4em 1em; /* same padding left-right as .documentation */
}
.documentation-startbox {
padding-bottom: 3px;
border-bottom: 1px solid #aaa;
margin-bottom: 1ex;
}
.documentation-heading {
font-weight: bold;
font-size: 125%;
}
.documentation-clear { /* Don't want things to stick out where they shouldn't. */
clear: both;
}
.documentation-toolbar {
font-style: normal;
font-size: 85%;
}
ce0e629c92e3d825ab9fd927fe6cc37d9117b6cb
Cartoonabad
0
169
438
360
2023-08-11T07:48:22Z
InsaneX
2
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|right|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [https://en.wikipedia.org/wiki/Hindi Hindi]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
bb0d6327fb8ec80c35d6569a4d7eecc726b6de6a
461
438
2023-08-11T11:27:20Z
InsaneX
2
wikitext
text/x-wiki
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
[[File:Cartoonabad_Logo.jpg|thumb|right|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [https://en.wikipedia.org/wiki/Hindi Hindi]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
8c62cc34f1d93318936278093f6670902a831779
Umar Edits
0
4
439
415
2023-08-11T07:55:23Z
InsaneX
2
Replaced content with "[[File:C UmarEdits_Logo.jpg|thumb|right|300px|Logo of Umar Edits.]] '''Umar Edits'''"
wikitext
text/x-wiki
[[File:C UmarEdits_Logo.jpg|thumb|right|300px|Logo of Umar Edits.]]
'''Umar Edits'''
e6d28e585205546350db347575a72d7071fa3c0c
440
439
2023-08-11T07:56:16Z
InsaneX
2
wikitext
text/x-wiki
[[File UmarEdits_Logo.jpg|thumb|right|300px|Logo of Umar Edits.]]
'''Umar Edits'''
7b6a0a1b9b804577656a986bcffac3f4bf5dff7e
441
440
2023-08-11T07:57:08Z
InsaneX
2
wikitext
text/x-wiki
[[File:UmarEdits_Logo.jpg|thumb|right|300px|Logo of Umar Edits.]]
'''Umar Edits'''
f5b9ba2993709f659ddbc7a01b02bcf95f64ef29
Main Page
0
1
442
349
2023-08-11T10:44:26Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
== Welcome to Geotubepedia ==
The ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content.
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
c4ddc06dfaa33d62deb1f3603d488629acb05baa
443
442
2023-08-11T10:46:22Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
== Welcome to Geotubepedia ==
Geotubepedia is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
aabda0d368991df71cf2da41093ba0c1ae91a052
444
443
2023-08-11T10:59:44Z
InsaneX
2
wikitext
text/x-wiki
<style type="text/css">
/* Change the color of the main page headings */
body.page-Main_Page h2 {
color: ##ff0022; /* Change #YOUR_COLOR_CODE to the desired color for the heading text */
border-bottom-color: ##ff0022; /* Change #YOUR_COLOR_CODE to the desired color for the separator line */
}
</style>
__NOTOC__
== Welcome to Geotubepedia ==
Geotubepedia is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
fc4b088fd0707af05fa7fafd99b5b2bd30a77bce
445
444
2023-08-11T10:59:58Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
== Welcome to Geotubepedia ==
Geotubepedia is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
aabda0d368991df71cf2da41093ba0c1ae91a052
446
445
2023-08-11T11:09:28Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px;">Welcome to Geotubepedia</h2>
== Welcome to Geotubepedia ==
Geotubepedia is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
a553b6206b2ae794886101564269e9d09b74a54c
447
446
2023-08-11T11:10:20Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px;">Welcome to Geotubepedia</h2>
== Welcome to Geotubepedia ==
Geotubepedia is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
b3acab5886b7819acc25ac50bcd0ee2405cafb13
448
447
2023-08-11T11:11:05Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 10px;">Welcome to Geotubepedia</h2>
== Welcome to Geotubepedia ==
Geotubepedia is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
29798ae821cda9c906e7b98b0dee97e8e1b18dfe
449
448
2023-08-11T11:11:19Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h2>
== Welcome to Geotubepedia ==
Geotubepedia is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
3dac2c3d0f65e724671ec3e399c347d792967375
450
449
2023-08-11T11:11:34Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h2>
Geotubepedia is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
5a66718fb43ade2c5653562ee42abd1fd0f08f3a
451
450
2023-08-11T11:12:47Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h2>
<h1 style="text-align: center;" Geotubepedia is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.</p>
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
c208b0a0dae21bb17c5c9b5c696e8a347ea2f003
452
451
2023-08-11T11:13:02Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h2>
<p style="text-align: center;" Geotubepedia is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.</p>
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
9accc0ed56d343418010c08a56139a3174123076
453
452
2023-08-11T11:13:30Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h2>
Geotubepedia is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
97eabece3f67e686fc0fcfd2b4ccca4aba255d04
454
453
2023-08-11T11:16:38Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h2>
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
4e549fd68d3fe9830c81ea3ae8fda1686058e4d2
455
454
2023-08-11T11:17:13Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1>
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
=== Featured Geotuber ===
'''GeoMaster''': An acclaimed Geotuber known for his in-depth country comparisons and geographical history. [Read more...][Link to GeoMaster's page]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
5e14bed8b7cd51ec9ae496241e17793f8e02da82
456
455
2023-08-11T11:19:39Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1>
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1>
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. [[Cartoonabad | Read More..]]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
cc83e25112b53515a0981a2a997d002fb41ababc
457
456
2023-08-11T11:20:42Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1>
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1>
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
<!--- * [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
* [[Geotube Awards]] -->
'''Coming Soon'''
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
a44a1d5a5a4ff7bf15dfcdf57ad76a76dcea2c11
458
457
2023-08-11T11:24:36Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1>
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1>
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
* [[List of Geotubers]]
* [[Top Geography YouTube Channels]]
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
91eea8ea1efef5e33f5214cb09a155bfa68fa8d2
459
458
2023-08-11T11:25:11Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1>
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1>
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
* [[Category:List of Geotubers]]
* [[Category:Top Geography YouTube Channels]]
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
129ca250eec4c8203ac8fab4836c0b73af74280e
460
459
2023-08-11T11:26:05Z
InsaneX
2
/* Explore */
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1>
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1>
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
=== News and Updates ===
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
9631fb3f9806a68a5ea5d16209504756abd376fd
463
460
2023-08-11T11:31:48Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1>
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1>
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1>
* '''August 10, 2023:''' Geotubepedia is launched!
* '''August 12, 2023:''' New Geotuber profiles added!
=== Explore ===
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
e009de5fbeb994ec492307b3e7075b9d47f90674
464
463
2023-08-11T11:34:56Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1>
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1>
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1>
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1>
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
0bb16ea1c3ca8b51b07dc6947c34a7a175c68ebd
470
464
2023-08-11T11:49:46Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
==Recent Changes==
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
05a4ca02ca1ed0c98468f72705f4c2a5459ff6e1
471
470
2023-08-11T14:41:42Z
InsaneX
2
/* Featured Geotuber */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
==Recent Changes==
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
8495fe05fb0f7158906e5cc189a95c03caa3bc46
472
471
2023-08-11T14:43:01Z
InsaneX
2
/* Other Links */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
==Recent Changes==
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[Geotubepedia:About About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
1b7a71820e2d712fc5025442724b708e0d2de51c
Category:List of Geotubers
14
202
462
2023-08-11T11:28:28Z
InsaneX
2
Created page with "This Category contains the list of all Geotubers."
wikitext
text/x-wiki
This Category contains the list of all Geotubers.
522de3305964983674eed326b9957ea31fabd8d9
Category:Top Geotubers
14
204
466
2023-08-11T11:38:11Z
InsaneX
2
Created page with "List of Top Geotubers."
wikitext
text/x-wiki
List of Top Geotubers.
5748e7ebbdea3220ed7434a18d81c3b407a97e04
Saif Sheikh Edits
0
172
467
362
2023-08-11T11:39:01Z
InsaneX
2
wikitext
text/x-wiki
[[Category:List of Geotubers]]
[[File:Saif Sheikh Logo.jpg|thumb|right|300px|Logo of Saif Sheikh Edits.]]
'''Saif Sheikh''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سیف شیخ) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Saif Sheikh Edits'''.
== Personal Life ==
Saif was born on February 4th, 2009, in Lahore, Pakistan. Saif experienced a significant transition in his life when he moved to Chicago in late 2012. Adapting to a new culture and environment, Saif's experiences in both Lahore and Chicago have played a pivotal role in shaping his perspectives and content. Politically, Saif is a supporter of Imran Khan.
== YouTube Career ==
Saif's journey into the realm of YouTube and geography was inspired by Geotubers like TheGamingKing and UmarEdits. Their content struck a chord with Saif, motivating him to dive into the world of geography content creation. As a result, he commenced his own channel, ''Saif Sheikh Edits'', where he brings a unique blend of his experiences and knowledge to his audience.
== See Also ==
* [https://www.youtube.com/SaifSheikhEdits Saif Sheikh Edits on YouTube]
* [https://www.instagram.com/sh2005_4_4/?igshid=OGQ5ZDc2ODk2ZA%3D%3D Saif Sheikh Edits on Instagram]
15587304c61fea6891704d9a4d8c408577d5adec
MediaWiki:Common.js
8
205
468
2023-08-11T11:43:44Z
InsaneX
2
Created page with "/* Any JavaScript here will be loaded for all users on every page load. */ $(document).ready(function() { // Check if it's the main page and mobile view with Minerva skin if (mw.config.get('wgIsMainPage') && mw.config.get('skin') === 'minerva') { // Disable the section collapsing feature $('.mw-collapsible-toggle').hide(); } });"
javascript
text/javascript
/* Any JavaScript here will be loaded for all users on every page load. */
$(document).ready(function() {
// Check if it's the main page and mobile view with Minerva skin
if (mw.config.get('wgIsMainPage') && mw.config.get('skin') === 'minerva') {
// Disable the section collapsing feature
$('.mw-collapsible-toggle').hide();
}
});
bef8c9d69054dac217f999d5cf80ff3967a58ddb
469
468
2023-08-11T11:45:02Z
InsaneX
2
javascript
text/javascript
/* Any JavaScript here will be loaded for all users on every page load. */
7850587e5c59a0259c9c96f81797dcf059b3cac9
Main Page
0
1
473
472
2023-08-11T14:43:16Z
InsaneX
2
/* Other Links */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
==Recent Changes==
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
b59d2f06ff0a3bd51907435813e3c7ba08254dcd
483
473
2023-08-11T15:25:41Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
==Recent Changes==
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Learn how to [[Help:Contributing|contribute]].
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
f62de9aa8fd95f934b399f0a586a32a18fea876b
484
483
2023-08-11T15:26:29Z
InsaneX
2
/* Contributing */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
==Recent Changes==
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
e6623788d1618021674e1c154091e13cd88127bc
485
484
2023-08-11T15:26:50Z
InsaneX
2
/* Recent Changes */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
df1922a53997de2836de735883f22ca1e503c6d9
486
485
2023-08-11T15:35:30Z
InsaneX
2
/* Explore */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about YouTubers who love exploring our world
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
b77fdab07fc9e01304823fb4bb7a3952246d7de9
487
486
2023-08-11T15:35:43Z
InsaneX
2
/* Explore */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about YouTubers who love exploring our world.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
90c5c7a052d6a56b7a51c4fdc163db87ea17d34a
488
487
2023-08-11T15:36:10Z
InsaneX
2
/* Explore */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
=== Did you know? ===
The term "Geotuber" was first coined in 2019 by a group of Geography enthusiasts on YouTube.
== Other Links ==
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
b0ce5c8dd21dc3b6dee1d5504548ac49b9406c9d
489
488
2023-08-11T15:36:24Z
InsaneX
2
/* Did you know? */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Community Portal|Community Portal]]
* [[Geotubepedia:Help|Help]]
54ff707d6dd4d6d078e65d6ff62caefcb456197f
490
489
2023-08-11T15:36:45Z
InsaneX
2
/* Other Links */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Help Desk|Help]]
d73191ba9597ce60e6cd78e043ce142f3ba03cbe
491
490
2023-08-11T15:37:47Z
InsaneX
2
/* Welcome to Geotubepedia */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content. Join our [https://discord.gg/aPXQ5ZMjH8 Discord Server] for more Information.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Help Desk|Help]]
4eed964f12706ebcf4e10dae6a85d921a31cc857
494
491
2023-08-11T15:51:13Z
InsaneX
2
/* Other Links */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content. Join our [https://discord.gg/aPXQ5ZMjH8 Discord Server] for more Information.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Help Desk|Help]]
8a4cf984dd02121e0f80cbd1f6b64d733eb9151c
501
494
2023-08-11T16:09:56Z
InsaneX
2
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content. Join our [https://discord.gg/aPXQ5ZMjH8 Discord Server] for more Information.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Help Desk|Help]]
916dd540d8acdc55fff8a6a9a9818009c72b856c
502
501
2023-08-11T16:10:37Z
InsaneX
2
/* Other Links */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content. Join our [https://discord.gg/aPXQ5ZMjH8 Discord Server] for more Information.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia is launched!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:Copyrights | Geotubpedia Copyrights]]
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Help Desk|Help Desk]]
cd25b2f97dcbbc01ec72ceae15c8aba079c4d0dc
506
502
2023-08-11T16:40:21Z
InsaneX
2
/* Recent Changes */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content. Join our [https://discord.gg/aPXQ5ZMjH8 Discord Server] for more Information.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 11, 2023:''' Geotubepedia was officially launched!
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia was created!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:Copyrights | Geotubpedia Copyrights]]
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Help Desk|Help Desk]]
0b5b8be62e06418dd848aa2452fac000018584d8
Geotubepedia:About
4
206
474
2023-08-11T14:49:05Z
InsaneX
2
Created page with "{{Geotubepedia:Header}} == About Geotubepedia == '''Geotubepedia''' is a free online encyclopedia dedicated to documenting the profiles, contributions, and histories of Geotubers, individuals or groups who produce YouTube content centered around Geography and related themes, such as comparisons of countries, empires, and other geopolitical topics. Created by a community of volunteers, Geotubepedia aims to serve as a centralized resource for audiences and creators alike..."
wikitext
text/x-wiki
{{Geotubepedia:Header}}
== About Geotubepedia ==
'''Geotubepedia''' is a free online encyclopedia dedicated to documenting the profiles, contributions, and histories of Geotubers, individuals or groups who produce YouTube content centered around Geography and related themes, such as comparisons of countries, empires, and other geopolitical topics. Created by a community of volunteers, Geotubepedia aims to serve as a centralized resource for audiences and creators alike to explore the vibrant world of Geotubing.
=== Mission ===
Our mission is to provide accurate, unbiased, and comprehensive information about the Geotuber community, its members, and their works. We believe that understanding and appreciating these content creators can foster a deeper appreciation for the field of Geography and its real-world implications.
=== History ===
Geotubepedia was founded in 2023 as a collaborative project for fans and creators alike to document the evolution of Geotubing. The platform is growing rapidly thanks to the contributions of Geotubers who link to their Geotubepedia pages from their channel's about page, and the diligent efforts of dedicated editors.
=== Content and structure ===
All of Geotubepedia's articles aim to adhere to the principles of neutrality, verifiability, and notability. Every Geotuber with a dedicated page on this platform has been deemed notable by our community standards, based on their contributions, viewership, and impact in the field.
=== Governance and operations ===
While Geotubepedia is built on the foundation of open collaboration, we have a dedicated team of administrators and editors who oversee the platform's operations, ensuring content quality and addressing potential concerns. Decisions are made based on community consensus, and any significant changes to the platform's guidelines or policies are subject to discussion among active members.
== Participate ==
We invite all passionate fans and creators to contribute to Geotubepedia. Whether you're a long-time Geotuber or someone who just discovered this exciting niche, your insights and expertise are valuable to us. Learn more on our [[Geotubepedia:Contribute|Contribute]] page.
== See also ==
* [[Geotubepedia:Guidelines|Guidelines]]
* [[Geotubepedia:FAQ|Frequently Asked Questions]]
== External links ==
* [https://www.miraheze.org/ Miraheze homepage]
[[Category:Geotubepedia documentation]]
77ea2ff774717712abbd9ca1f8cc244cfb83187a
475
474
2023-08-11T14:49:21Z
InsaneX
2
wikitext
text/x-wiki
'''Geotubepedia''' is a free online encyclopedia dedicated to documenting the profiles, contributions, and histories of Geotubers, individuals or groups who produce YouTube content centered around Geography and related themes, such as comparisons of countries, empires, and other geopolitical topics. Created by a community of volunteers, Geotubepedia aims to serve as a centralized resource for audiences and creators alike to explore the vibrant world of Geotubing.
=== Mission ===
Our mission is to provide accurate, unbiased, and comprehensive information about the Geotuber community, its members, and their works. We believe that understanding and appreciating these content creators can foster a deeper appreciation for the field of Geography and its real-world implications.
=== History ===
Geotubepedia was founded in 2023 as a collaborative project for fans and creators alike to document the evolution of Geotubing. The platform is growing rapidly thanks to the contributions of Geotubers who link to their Geotubepedia pages from their channel's about page, and the diligent efforts of dedicated editors.
=== Content and structure ===
All of Geotubepedia's articles aim to adhere to the principles of neutrality, verifiability, and notability. Every Geotuber with a dedicated page on this platform has been deemed notable by our community standards, based on their contributions, viewership, and impact in the field.
=== Governance and operations ===
While Geotubepedia is built on the foundation of open collaboration, we have a dedicated team of administrators and editors who oversee the platform's operations, ensuring content quality and addressing potential concerns. Decisions are made based on community consensus, and any significant changes to the platform's guidelines or policies are subject to discussion among active members.
== Participate ==
We invite all passionate fans and creators to contribute to Geotubepedia. Whether you're a long-time Geotuber or someone who just discovered this exciting niche, your insights and expertise are valuable to us. Learn more on our [[Geotubepedia:Contribute|Contribute]] page.
== See also ==
* [[Geotubepedia:Guidelines|Guidelines]]
* [[Geotubepedia:FAQ|Frequently Asked Questions]]
== External links ==
* [https://www.miraheze.org/ Miraheze homepage]
[[Category:Geotubepedia documentation]]
d724548191eecb819bf71c6d5f086e8e37c5b685
476
475
2023-08-11T14:50:02Z
InsaneX
2
wikitext
text/x-wiki
'''Geotubepedia''' is a free online encyclopedia dedicated to documenting the profiles, contributions, and histories of Geotubers, individuals or groups who produce YouTube content centered around Geography and related themes, such as comparisons of countries, empires, and other geopolitical topics. Created by a community of volunteers, Geotubepedia aims to serve as a centralized resource for audiences and creators alike to explore the vibrant world of Geotubing.
== Mission ==
Our mission is to provide accurate, unbiased, and comprehensive information about the Geotuber community, its members, and their works. We believe that understanding and appreciating these content creators can foster a deeper appreciation for the field of Geography and its real-world implications.
== History ==
Geotubepedia was founded in 2023 as a collaborative project for fans and creators alike to document the evolution of Geotubing. The platform is growing rapidly thanks to the contributions of Geotubers who link to their Geotubepedia pages from their channel's about page, and the diligent efforts of dedicated editors.
== Content and structure ==
All of Geotubepedia's articles aim to adhere to the principles of neutrality, verifiability, and notability. Every Geotuber with a dedicated page on this platform has been deemed notable by our community standards, based on their contributions, viewership, and impact in the field.
== Governance and operations ==
While Geotubepedia is built on the foundation of open collaboration, we have a dedicated team of administrators and editors who oversee the platform's operations, ensuring content quality and addressing potential concerns. Decisions are made based on community consensus, and any significant changes to the platform's guidelines or policies are subject to discussion among active members.
== Participate ==
We invite all passionate fans and creators to contribute to Geotubepedia. Whether you're a long-time Geotuber or someone who just discovered this exciting niche, your insights and expertise are valuable to us. Learn more on our [[Geotubepedia:Contribute|Contribute]] page.
== See also ==
* [[Geotubepedia:Guidelines|Guidelines]]
* [[Geotubepedia:FAQ|Frequently Asked Questions]]
== External links ==
* [https://www.miraheze.org/ Miraheze homepage]
[[Category:Geotubepedia documentation]]
dbf1bb032515a4f125699be007b6ed7f0d93cb69
477
476
2023-08-11T14:50:17Z
InsaneX
2
/* External links */
wikitext
text/x-wiki
'''Geotubepedia''' is a free online encyclopedia dedicated to documenting the profiles, contributions, and histories of Geotubers, individuals or groups who produce YouTube content centered around Geography and related themes, such as comparisons of countries, empires, and other geopolitical topics. Created by a community of volunteers, Geotubepedia aims to serve as a centralized resource for audiences and creators alike to explore the vibrant world of Geotubing.
== Mission ==
Our mission is to provide accurate, unbiased, and comprehensive information about the Geotuber community, its members, and their works. We believe that understanding and appreciating these content creators can foster a deeper appreciation for the field of Geography and its real-world implications.
== History ==
Geotubepedia was founded in 2023 as a collaborative project for fans and creators alike to document the evolution of Geotubing. The platform is growing rapidly thanks to the contributions of Geotubers who link to their Geotubepedia pages from their channel's about page, and the diligent efforts of dedicated editors.
== Content and structure ==
All of Geotubepedia's articles aim to adhere to the principles of neutrality, verifiability, and notability. Every Geotuber with a dedicated page on this platform has been deemed notable by our community standards, based on their contributions, viewership, and impact in the field.
== Governance and operations ==
While Geotubepedia is built on the foundation of open collaboration, we have a dedicated team of administrators and editors who oversee the platform's operations, ensuring content quality and addressing potential concerns. Decisions are made based on community consensus, and any significant changes to the platform's guidelines or policies are subject to discussion among active members.
== Participate ==
We invite all passionate fans and creators to contribute to Geotubepedia. Whether you're a long-time Geotuber or someone who just discovered this exciting niche, your insights and expertise are valuable to us. Learn more on our [[Geotubepedia:Contribute|Contribute]] page.
== See also ==
* [[Geotubepedia:Guidelines|Guidelines]]
* [[Geotubepedia:FAQ|Frequently Asked Questions]]
[[Category:Geotubepedia documentation]]
1c2acd75acbb2a61a661d35bef38aee0cffda3e2
478
477
2023-08-11T14:52:22Z
InsaneX
2
Protected "[[Geotubepedia:About]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
'''Geotubepedia''' is a free online encyclopedia dedicated to documenting the profiles, contributions, and histories of Geotubers, individuals or groups who produce YouTube content centered around Geography and related themes, such as comparisons of countries, empires, and other geopolitical topics. Created by a community of volunteers, Geotubepedia aims to serve as a centralized resource for audiences and creators alike to explore the vibrant world of Geotubing.
== Mission ==
Our mission is to provide accurate, unbiased, and comprehensive information about the Geotuber community, its members, and their works. We believe that understanding and appreciating these content creators can foster a deeper appreciation for the field of Geography and its real-world implications.
== History ==
Geotubepedia was founded in 2023 as a collaborative project for fans and creators alike to document the evolution of Geotubing. The platform is growing rapidly thanks to the contributions of Geotubers who link to their Geotubepedia pages from their channel's about page, and the diligent efforts of dedicated editors.
== Content and structure ==
All of Geotubepedia's articles aim to adhere to the principles of neutrality, verifiability, and notability. Every Geotuber with a dedicated page on this platform has been deemed notable by our community standards, based on their contributions, viewership, and impact in the field.
== Governance and operations ==
While Geotubepedia is built on the foundation of open collaboration, we have a dedicated team of administrators and editors who oversee the platform's operations, ensuring content quality and addressing potential concerns. Decisions are made based on community consensus, and any significant changes to the platform's guidelines or policies are subject to discussion among active members.
== Participate ==
We invite all passionate fans and creators to contribute to Geotubepedia. Whether you're a long-time Geotuber or someone who just discovered this exciting niche, your insights and expertise are valuable to us. Learn more on our [[Geotubepedia:Contribute|Contribute]] page.
== See also ==
* [[Geotubepedia:Guidelines|Guidelines]]
* [[Geotubepedia:FAQ|Frequently Asked Questions]]
[[Category:Geotubepedia documentation]]
1c2acd75acbb2a61a661d35bef38aee0cffda3e2
479
478
2023-08-11T15:00:44Z
InsaneX
2
/* Participate */
wikitext
text/x-wiki
'''Geotubepedia''' is a free online encyclopedia dedicated to documenting the profiles, contributions, and histories of Geotubers, individuals or groups who produce YouTube content centered around Geography and related themes, such as comparisons of countries, empires, and other geopolitical topics. Created by a community of volunteers, Geotubepedia aims to serve as a centralized resource for audiences and creators alike to explore the vibrant world of Geotubing.
== Mission ==
Our mission is to provide accurate, unbiased, and comprehensive information about the Geotuber community, its members, and their works. We believe that understanding and appreciating these content creators can foster a deeper appreciation for the field of Geography and its real-world implications.
== History ==
Geotubepedia was founded in 2023 as a collaborative project for fans and creators alike to document the evolution of Geotubing. The platform is growing rapidly thanks to the contributions of Geotubers who link to their Geotubepedia pages from their channel's about page, and the diligent efforts of dedicated editors.
== Content and structure ==
All of Geotubepedia's articles aim to adhere to the principles of neutrality, verifiability, and notability. Every Geotuber with a dedicated page on this platform has been deemed notable by our community standards, based on their contributions, viewership, and impact in the field.
== Governance and operations ==
While Geotubepedia is built on the foundation of open collaboration, we have a dedicated team of administrators and editors who oversee the platform's operations, ensuring content quality and addressing potential concerns. Decisions are made based on community consensus, and any significant changes to the platform's guidelines or policies are subject to discussion among active members.
== Participate ==
We invite all passionate fans and creators to contribute to Geotubepedia. Whether you're a long-time Geotuber or someone who just discovered this exciting niche, your insights and expertise are valuable to us. Learn more on our [|Discord Server]. Need help? Check the [[Geotubepedia:Help Desk|Help Desk]].
== See also ==
* [[Geotubepedia:Guidelines|Guidelines]]
* [[Geotubepedia:FAQ|Frequently Asked Questions]]
[[Category:Geotubepedia documentation]]
02d814a549c1e5a9ce2e9f3504ab43a0c38d8896
495
479
2023-08-11T15:51:38Z
InsaneX
2
/* See also */
wikitext
text/x-wiki
'''Geotubepedia''' is a free online encyclopedia dedicated to documenting the profiles, contributions, and histories of Geotubers, individuals or groups who produce YouTube content centered around Geography and related themes, such as comparisons of countries, empires, and other geopolitical topics. Created by a community of volunteers, Geotubepedia aims to serve as a centralized resource for audiences and creators alike to explore the vibrant world of Geotubing.
== Mission ==
Our mission is to provide accurate, unbiased, and comprehensive information about the Geotuber community, its members, and their works. We believe that understanding and appreciating these content creators can foster a deeper appreciation for the field of Geography and its real-world implications.
== History ==
Geotubepedia was founded in 2023 as a collaborative project for fans and creators alike to document the evolution of Geotubing. The platform is growing rapidly thanks to the contributions of Geotubers who link to their Geotubepedia pages from their channel's about page, and the diligent efforts of dedicated editors.
== Content and structure ==
All of Geotubepedia's articles aim to adhere to the principles of neutrality, verifiability, and notability. Every Geotuber with a dedicated page on this platform has been deemed notable by our community standards, based on their contributions, viewership, and impact in the field.
== Governance and operations ==
While Geotubepedia is built on the foundation of open collaboration, we have a dedicated team of administrators and editors who oversee the platform's operations, ensuring content quality and addressing potential concerns. Decisions are made based on community consensus, and any significant changes to the platform's guidelines or policies are subject to discussion among active members.
== Participate ==
We invite all passionate fans and creators to contribute to Geotubepedia. Whether you're a long-time Geotuber or someone who just discovered this exciting niche, your insights and expertise are valuable to us. Learn more on our [|Discord Server]. Need help? Check the [[Geotubepedia:Help Desk|Help Desk]].
== See also ==
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:FAQ|Frequently Asked Questions]]
[[Category:Geotubepedia documentation]]
9974044e7019542d493fd54f58893ad2c05fcdb7
496
495
2023-08-11T15:52:54Z
InsaneX
2
/* See also */
wikitext
text/x-wiki
'''Geotubepedia''' is a free online encyclopedia dedicated to documenting the profiles, contributions, and histories of Geotubers, individuals or groups who produce YouTube content centered around Geography and related themes, such as comparisons of countries, empires, and other geopolitical topics. Created by a community of volunteers, Geotubepedia aims to serve as a centralized resource for audiences and creators alike to explore the vibrant world of Geotubing.
== Mission ==
Our mission is to provide accurate, unbiased, and comprehensive information about the Geotuber community, its members, and their works. We believe that understanding and appreciating these content creators can foster a deeper appreciation for the field of Geography and its real-world implications.
== History ==
Geotubepedia was founded in 2023 as a collaborative project for fans and creators alike to document the evolution of Geotubing. The platform is growing rapidly thanks to the contributions of Geotubers who link to their Geotubepedia pages from their channel's about page, and the diligent efforts of dedicated editors.
== Content and structure ==
All of Geotubepedia's articles aim to adhere to the principles of neutrality, verifiability, and notability. Every Geotuber with a dedicated page on this platform has been deemed notable by our community standards, based on their contributions, viewership, and impact in the field.
== Governance and operations ==
While Geotubepedia is built on the foundation of open collaboration, we have a dedicated team of administrators and editors who oversee the platform's operations, ensuring content quality and addressing potential concerns. Decisions are made based on community consensus, and any significant changes to the platform's guidelines or policies are subject to discussion among active members.
== Participate ==
We invite all passionate fans and creators to contribute to Geotubepedia. Whether you're a long-time Geotuber or someone who just discovered this exciting niche, your insights and expertise are valuable to us. Learn more on our [|Discord Server]. Need help? Check the [[Geotubepedia:Help Desk|Help Desk]].
== See also ==
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Help Desk|Help Desk]]
[[Category:Geotubepedia documentation]]
de7a6ce6947daf43532881de6e6bae8b11a2a3db
499
496
2023-08-11T16:08:38Z
InsaneX
2
/* See also */
wikitext
text/x-wiki
'''Geotubepedia''' is a free online encyclopedia dedicated to documenting the profiles, contributions, and histories of Geotubers, individuals or groups who produce YouTube content centered around Geography and related themes, such as comparisons of countries, empires, and other geopolitical topics. Created by a community of volunteers, Geotubepedia aims to serve as a centralized resource for audiences and creators alike to explore the vibrant world of Geotubing.
== Mission ==
Our mission is to provide accurate, unbiased, and comprehensive information about the Geotuber community, its members, and their works. We believe that understanding and appreciating these content creators can foster a deeper appreciation for the field of Geography and its real-world implications.
== History ==
Geotubepedia was founded in 2023 as a collaborative project for fans and creators alike to document the evolution of Geotubing. The platform is growing rapidly thanks to the contributions of Geotubers who link to their Geotubepedia pages from their channel's about page, and the diligent efforts of dedicated editors.
== Content and structure ==
All of Geotubepedia's articles aim to adhere to the principles of neutrality, verifiability, and notability. Every Geotuber with a dedicated page on this platform has been deemed notable by our community standards, based on their contributions, viewership, and impact in the field.
== Governance and operations ==
While Geotubepedia is built on the foundation of open collaboration, we have a dedicated team of administrators and editors who oversee the platform's operations, ensuring content quality and addressing potential concerns. Decisions are made based on community consensus, and any significant changes to the platform's guidelines or policies are subject to discussion among active members.
== Participate ==
We invite all passionate fans and creators to contribute to Geotubepedia. Whether you're a long-time Geotuber or someone who just discovered this exciting niche, your insights and expertise are valuable to us. Learn more on our [|Discord Server]. Need help? Check the [[Geotubepedia:Help Desk|Help Desk]].
== See also ==
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Copyrights|Geotubepedia Copyrights]]
* [[Geotubepedia:Help Desk|Help Desk]]
[[Category:Geotubepedia documentation]]
8697c1490d80914e25962496058bf58a8c3839c0
Geotubepedia:Help Desk
4
207
480
2023-08-11T15:21:56Z
InsaneX
2
Created page with "Welcome to the '''Geotubepedia Help Desk'''. This is a place where you can ask questions and get assistance regarding any issues or queries you might have about Geotubepedia. Whether you're new to the platform or an experienced editor, we're here to help. == Rules for the Help Desk == Please follow the rules below: * Please keep questions related to Geotubepedia. * Don't share personal information, especially passwords. * Be respectful and patient; everyone is here to h..."
wikitext
text/x-wiki
Welcome to the '''Geotubepedia Help Desk'''. This is a place where you can ask questions and get assistance regarding any issues or queries you might have about Geotubepedia. Whether you're new to the platform or an experienced editor, we're here to help.
== Rules for the Help Desk ==
Please follow the rules below:
* Please keep questions related to Geotubepedia.
* Don't share personal information, especially passwords.
* Be respectful and patient; everyone is here to help and learn.
* If you suspect a technical issue, please provide clear details so we can assist you better.
== Questions ==
Please place your questions below, and a member of our community will get back to you as soon as possible.
=== Need Further Assistance? ===
If you need more direct help or are facing urgent issues, please join our [link to Discord Server|Discord Server]. Our community and moderators are active there and ready to assist.
f944d4f8e36e373133991631c160fbb32ab05bca
481
480
2023-08-11T15:22:57Z
InsaneX
2
/* Rules for the Help Desk */
wikitext
text/x-wiki
Welcome to the '''Geotubepedia Help Desk'''. This is a place where you can ask questions and get assistance regarding any issues or queries you might have about Geotubepedia. Whether you're new to the platform or an experienced editor, we're here to help.
== Rules for the Help Desk ==
Please follow the rules below:
* Please keep questions related to Geotubepedia.
* Don't share personal information, especially passwords.
* Be respectful and patient; everyone is here to help and learn.
* If you suspect a technical issue, please provide clear details so we can assist you better.
* Remember to sign your post by adding four tildes ([[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 15:22, 11 August 2023 (UTC)) at the end of your post. Alternatively, you can click on the signature icon (Geotubepedia edit toolbar signature icon) on the edit toolbar.
== Questions ==
Please place your questions below, and a member of our community will get back to you as soon as possible.
=== Need Further Assistance? ===
If you need more direct help or are facing urgent issues, please join our [link to Discord Server|Discord Server]. Our community and moderators are active there and ready to assist.
89331909652c56be104e5cacb153b731cc272a63
482
481
2023-08-11T15:24:54Z
InsaneX
2
wikitext
text/x-wiki
Welcome to the '''Geotubepedia Help Desk'''. This is a place where you can ask questions and get assistance regarding any issues or queries you might have about Geotubepedia. Whether you're new to the platform or an experienced editor, we're here to help.
== Rules for the Help Desk ==
Please follow the rules below:
* Please keep questions related to Geotubepedia.
* Don't share personal information, especially passwords.
* Be respectful and patient; everyone is here to help and learn.
* If you suspect a technical issue, please provide clear details so we can assist you better.
* Remember to sign your post by adding four tildes <nowiki>~~~~</nowiki> at the end of your post. Alternatively, you can click on the signature icon (Geotubepedia edit toolbar signature icon) on the edit toolbar.
== Questions ==
Please place your questions below, and a member of our community will get back to you as soon as possible.
=== Need Further Assistance? ===
If you need more direct help or are facing urgent issues, please join our [link to Discord Server|Discord Server]. Our community and moderators are active there and ready to assist.
3e59c473b95adb81502e71e2a3b9fb8a3ac40eb8
Geotubepedia:Policies and Guidelines
4
208
492
2023-08-11T15:47:25Z
InsaneX
2
Created page with "At '''Geotubepedia''', our aim is to maintain a collaborative, informative, and respectful environment. These guidelines and policies ensure that our platform remains a trusted source for all things Geotuber. === General Conduct === * '''Be Respectful:''' Engage with other users civilly. Avoid personal attacks, harassment, or any form of discrimination. * '''Assume Good Faith:''' Believe that everyone is here to make positive contributions, unless proven otherwise. ===..."
wikitext
text/x-wiki
At '''Geotubepedia''', our aim is to maintain a collaborative, informative, and respectful environment. These guidelines and policies ensure that our platform remains a trusted source for all things Geotuber.
=== General Conduct ===
* '''Be Respectful:''' Engage with other users civilly. Avoid personal attacks, harassment, or any form of discrimination.
* '''Assume Good Faith:''' Believe that everyone is here to make positive contributions, unless proven otherwise.
=== Content Guidelines ===
* '''Neutrality:''' Ensure articles are written from a neutral point of view. Refrain from promotional language or bias.
* '''Verifiability:''' Information added should be backed by reliable sources, especially if potentially controversial.
* '''Original Research:''' Geotubepedia is about sharing well-sourced, established facts, not personal opinions or theories.
=== Editing Guidelines ===
* '''Approval Process:''' Every edit submitted is reviewed and approved by our team before it's visible to the public, ensuring quality and accuracy.
* '''Citing Sources:''' Always try to provide sources when adding new information.
* '''Talk Pages:''' Discuss changes or disputes on the respective article's talk page.
* '''Avoid Edit Wars:''' Discuss disagreements on the talk page instead of continually undoing edits.
=== Inclusivity in Content Creation ===
* '''All Geotubers Welcome:''' We believe in documenting the entire Geotuber community. Whether you have a large following or are just starting out, Geotubepedia acknowledges and values every contributor. There's no notability barrier here!
=== User Accounts ===
* '''Single Account Policy:''' Stick to one account for your contributions. Using multiple accounts to mislead or cause disruption is against our principles.
* '''Privacy:''' Protect your and others' privacy. Avoid sharing personal or identifying details.
=== Administrative Actions ===
* '''Page Protection:''' Some pages may be protected to prevent disruptions.
* '''Deletion:''' Content that doesn't align with our guidelines might be flagged for deletion.
* '''Blocking:''' Continuous disregard for these guidelines may result in temporary or permanent blocking from editing.
== Questions or Concerns? ==
For any questions about our guidelines or Geotubepedia in general, please visit our [[Geotubepedia:Help Desk|Help Desk]] or join our [https://discord.gg/8nc4W5nggg Discord Server].
[[Category:Geotubepedia documentation]]
54cb08308f9e89750917f052b9db282e4473e65b
493
492
2023-08-11T15:48:16Z
InsaneX
2
wikitext
text/x-wiki
At '''Geotubepedia''', our aim is to maintain a collaborative, informative, and respectful environment. These guidelines and policies ensure that our platform remains a trusted source for all things Geotuber.
== General Conduct ==
* '''Be Respectful:''' Engage with other users civilly. Avoid personal attacks, harassment, or any form of discrimination.
* '''Assume Good Faith:''' Believe that everyone is here to make positive contributions, unless proven otherwise.
== Content Guidelines ==
* '''Neutrality:''' Ensure articles are written from a neutral point of view. Refrain from promotional language or bias.
* '''Verifiability:''' Information added should be backed by reliable sources, especially if potentially controversial.
* '''Original Research:''' Geotubepedia is about sharing well-sourced, established facts, not personal opinions or theories.
== Editing Guidelines ==
* '''Approval Process:''' Every edit submitted is reviewed and approved by our team before it's visible to the public, ensuring quality and accuracy.
* '''Citing Sources:''' Always try to provide sources when adding new information.
* '''Talk Pages:''' Discuss changes or disputes on the respective article's talk page.
* '''Avoid Edit Wars:''' Discuss disagreements on the talk page instead of continually undoing edits.
== Inclusivity in Content Creation ==
* '''All Geotubers Welcome:''' We believe in documenting the entire Geotuber community. Whether you have a large following or are just starting out, Geotubepedia acknowledges and values every contributor. There's no notability barrier here!
== User Accounts ==
* '''Single Account Policy:''' Stick to one account for your contributions. Using multiple accounts to mislead or cause disruption is against our principles.
* '''Privacy:''' Protect your and others' privacy. Avoid sharing personal or identifying details.
== Administrative Actions ==
* '''Page Protection:''' Some pages may be protected to prevent disruptions.
* '''Deletion:''' Content that doesn't align with our guidelines might be flagged for deletion.
* '''Blocking:''' Continuous disregard for these guidelines may result in temporary or permanent blocking from editing.
== Questions or Concerns? ==
For any questions about our guidelines or Geotubepedia in general, please visit our [[Geotubepedia:Help Desk|Help Desk]] or join our [https://discord.gg/8nc4W5nggg Discord Server].
[[Category:Geotubepedia documentation]]
bc031f3c9ce831529222daf318b96d8a48907050
Geotubepedia:Copyrights
4
209
497
2023-08-11T16:06:05Z
InsaneX
2
Created page with "The text of Geotubepedia is copyrighted (automatically, under the Berne Convention) by Geotubepedia editors and contributors and is formally licensed to the public under one or several liberal licenses. Most of Geotubepedia's text and many of its images are co-licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License (CC BY-SA) and the GNU Free Documentation License (GFDL) (unversioned, with no invariant sections, front-cover texts, or back-cover te..."
wikitext
text/x-wiki
The text of Geotubepedia is copyrighted (automatically, under the Berne Convention) by Geotubepedia editors and contributors and is formally licensed to the public under one or several liberal licenses. Most of Geotubepedia's text and many of its images are co-licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License (CC BY-SA) and the GNU Free Documentation License (GFDL) (unversioned, with no invariant sections, front-cover texts, or back-cover texts). Some text has been imported only under CC BY-SA and CC BY-SA-compatible license and cannot be reused under GFDL; such text will be identified on the page footer, in the page history, or on the discussion page of the article that utilizes the text. Every image has a description page that indicates the license under which it is released or, if it is non-free, the rationale under which it is used.
The licenses Geotubepedia uses grant free access to our content in the same sense that free software is licensed freely. Geotubepedia content can be copied, modified, and redistributed if and only if the copied version is made available on the same terms to others and acknowledgment of the authors of the Geotubepedia article used is included (a link back to the article is generally thought to satisfy the attribution requirement; see below for more details). Copied Geotubepedia content will therefore remain free under an appropriate license and can continue to be used by anyone subject to certain restrictions, most of which aim to ensure that freedom. This principle is known as copyleft in contrast to typical copyright licenses.
To this end:
* Permission is granted to copy, distribute and/or modify Geotubepedia's text under the terms of the Creative Commons Attribution-ShareAlike 3.0 Unported License and, unless otherwise noted, the GNU Free Documentation License, unversioned, with no invariant sections, front-cover texts, or back-cover texts.
* A copy of the Creative Commons Attribution-ShareAlike 3.0 Unported License is included in the section entitled "Geotubepedia:Text of Creative Commons Attribution-ShareAlike 3.0 Unported License"
* A copy of the GNU Free Documentation License is included in the section entitled "GNU Free Documentation License".
* Content on Geotubepedia is covered by disclaimers.
* The English text of the CC BY-SA and GFDL licenses is the only legally binding restriction between authors and users of Geotubepedia content. What follows is our interpretation of CC BY-SA and GFDL, as it pertains to the rights and obligations of users and contributors.
'''Contributors' rights and obligations'''
''Shortcut''
GP:CRANDO
If you contribute text directly to Geotubepedia, you thereby license it to the public for reuse under CC BY-SA and GFDL (unversioned, with no invariant sections, front-cover texts, or back-cover texts). Non-text media may be contributed under a variety of different licenses that support the general goal of allowing unrestricted re-use and re-distribution. See Guidelines for images and other media files, below.
If you want to import text that you have found elsewhere or that you have co-authored with others, you can only do so if it is available under terms that are compatible with the CC BY-SA license. You do not need to ensure or guarantee that the imported text is available under the GNU Free Documentation License, unless you are its sole author. Furthermore, please note that you cannot import information which is available only under the GFDL. In other words, you may only import text that is (a) single-licensed under terms compatible with the CC BY-SA license or (b) dual-licensed with the GFDL and another license with terms compatible with the CC BY-SA license. If you are the sole author of the material, you must license it under both CC BY-SA and GFDL.
If the material, text or media, has been previously published and you wish to donate it to Geotubepedia under appropriate license, you will need to verify copyright permission through one of our established procedures. See Geotubepedia:Donating copyrighted materials for details. If you are not a copyright holder, you will still need to verify copyright permission; see the Using copyrighted work from others section below.
You retain copyright to materials you contribute to Geotubepedia, text and media. Copyright is never transferred to Geotubepedia. You can later republish and relicense them in any way you like. However, you can never retract or alter the license for copies of materials that you place here; these copies will remain so licensed until they enter the public domain when your copyright expires (currently some decades after an author's death).
'''Using copyrighted work from others'''
''Shortcut''
GP:COPYOTHERS
All creative works are copyrighted, by international agreement, unless either they fall into the public domain or their copyright is explicitly disclaimed. Generally, Geotubepedia must have permission to use copyrighted works. There are some circumstances under which copyrighted works may be legally utilized without permission; see Geotubepedia:Non-free content for specific details on when and how to utilize such material. However, it is our goal to be able to freely redistribute as much of Geotubepedia's material as possible, so original images and sound files licensed under CC BY-SA and GFDL (unversioned, with no invariant sections, front-cover texts, or back-cover texts) or in the public domain are greatly preferred to copyrighted media files used under fair use or otherwise.
If you want to import media (including text) that you have found elsewhere, and it does not meet the non-free content policy and guideline, you can only do so if it is public domain or available under terms that are compatible with the CC BY-SA license. If you import media under a compatible license which requires attribution, you must, in a reasonable fashion, credit the author(s). You must also in most cases verify that the material is compatibly licensed or public domain. If the original source of publication contains a copyright disclaimer or other indication that the material is free for use, a link to it on the media description page or the article's talk page may satisfy this requirement. If you obtain special permission to use a copyrighted work from the copyright holder under compatible terms, you must make a note of that fact (along with the relevant names and dates) and verify this through one of several processes. See Geotubepedia:Requesting copyright permission for the procedure for asking a copyright holder to grant a usable license for their work and for the processes for verifying that license has been granted.
Never use materials that infringe the copyrights of others. This could create legal liabilities and seriously hurt Geotubepedia. If in doubt, write the content yourself, thereby creating a new copyrighted work which can be included in Geotubepedia without trouble.
Note that copyright law governs the creative expression of ideas, not the ideas or information themselves. Therefore, it is legal to read an encyclopedia article or other work, reformulate the concepts in your own words, and submit it to Geotubepedia, so long as you do not follow the source too closely. However, it would still be ethical and recommended best practice to cite your original source.
'''Texts with multiple authors'''
''Shortcut''
GP:MULTIAUTH
Given the wiki nature of Geotubepedia, any article may have dozens or even thousands of individual contributors. For legal purposes, the most significant contributors to an article are its main or named authors, who will have made substantial intellectual contributions to its content, and those who have contributed copyrighted text to it, either directly or through translation from another language. Anyone may list themselves as an editor on the discussion page of an article they have edited. A named editor of a Geotubepedia article has certain rights and responsibilities concerning that article; for details see the policy page. The copyrights for significant contributions to an article are held by their contributors; for details and for a definition of what constitutes a significant contribution, see the policy page.
'''Reusing Geotubepedia content'''
''Shortcut''
GP:REUSE
Whenever you reuse or distribute Geotubepedia content, either commercially or non-commercially, you must provide attribution, though not in any way that suggests that Geotubepedia endorses you or your use. You must also include a copy of the Creative Commons Attribution-ShareAlike 3.0 Unported License with any content you distribute. If you make modifications or additions to the page you reuse, you must license them under the Creative Commons Attribution-ShareAlike 3.0 Unported License, or broadly compatible terms. Where you do use a work under its GFDL license, you must, if you distribute it in a manner that allows the use of digital technology, provide access to a "Transparent copy" of the work. The easiest way to ensure you are compliant with the GFDL, if you wish to use content under that license, is to link to the original source page on Geotubepedia.
If you reproduce Geotubepedia content in a format that includes material not under the CC BY-SA license or GFDL, you need to label the Geotubepedia content clearly, preferably by placing a notice at the beginning of the relevant content stating its licensing status. You also need to ensure that any third-party intellectual property you have included is clearly identified with separate copyright notices and is clearly distinguished from the CC BY-SA or GFDL licensed content.
If you use Geotubepedia at a university or other institution, you may need to make sure that your use complies with the institution's internet use policies and honor code. Institutions, especially educational ones, frequently have such codes and policies in place due to concerns about plagiarism.
For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to the Creative Commons Attribution-ShareAlike 3.0 Unported License. For more information, see Geotubepedia's guide on reusing content outside Geotubepedia.
== Summary ==
Geotubepedia's content is free, not simple. Our licenses ensure that the content will remain free and that the largest possible audience will benefit from these works. We believe that this is the right thing to do for our community, for volunteers, and for education. We also believe it's the right thing to do for the world.
However, please understand that you are always ultimately responsible for ensuring that what you are doing is legal. Always use your own best judgment, and consult a lawyer if you're unsure.
62083eec48363c472dd0bbcf0f4884f9807c18c5
498
497
2023-08-11T16:07:30Z
InsaneX
2
wikitext
text/x-wiki
The text of Geotubepedia is copyrighted (automatically, under the Berne Convention) by Geotubepedia editors and contributors and is formally licensed to the public under one or several liberal licenses. Most of Geotubepedia's text and many of its images are co-licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License (CC BY-SA) and the GNU Free Documentation License (GFDL) (unversioned, with no invariant sections, front-cover texts, or back-cover texts). Some text has been imported only under CC BY-SA and CC BY-SA-compatible license and cannot be reused under GFDL; such text will be identified on the page footer, in the page history, or on the discussion page of the article that utilizes the text. Every image has a description page that indicates the license under which it is released or, if it is non-free, the rationale under which it is used.
The licenses Geotubepedia uses grant free access to our content in the same sense that free software is licensed freely. Geotubepedia content can be copied, modified, and redistributed if and only if the copied version is made available on the same terms to others and acknowledgment of the authors of the Geotubepedia article used is included (a link back to the article is generally thought to satisfy the attribution requirement; see below for more details). Copied Geotubepedia content will therefore remain free under an appropriate license and can continue to be used by anyone subject to certain restrictions, most of which aim to ensure that freedom. This principle is known as copyleft in contrast to typical copyright licenses.
To this end:
* Permission is granted to copy, distribute and/or modify Geotubepedia's text under the terms of the Creative Commons Attribution-ShareAlike 3.0 Unported License and, unless otherwise noted, the GNU Free Documentation License, unversioned, with no invariant sections, front-cover texts, or back-cover texts.
* A copy of the Creative Commons Attribution-ShareAlike 3.0 Unported License is included in the section entitled "Geotubepedia:Text of Creative Commons Attribution-ShareAlike 3.0 Unported License"
* A copy of the GNU Free Documentation License is included in the section entitled "GNU Free Documentation License".
* Content on Geotubepedia is covered by disclaimers.
* The English text of the CC BY-SA and GFDL licenses is the only legally binding restriction between authors and users of Geotubepedia content. What follows is our interpretation of CC BY-SA and GFDL, as it pertains to the rights and obligations of users and contributors.
== Contributors' rights and obligations ==
If you contribute text directly to Geotubepedia, you thereby license it to the public for reuse under CC BY-SA and GFDL (unversioned, with no invariant sections, front-cover texts, or back-cover texts). Non-text media may be contributed under a variety of different licenses that support the general goal of allowing unrestricted re-use and re-distribution. See Guidelines for images and other media files, below.
If you want to import text that you have found elsewhere or that you have co-authored with others, you can only do so if it is available under terms that are compatible with the CC BY-SA license. You do not need to ensure or guarantee that the imported text is available under the GNU Free Documentation License, unless you are its sole author. Furthermore, please note that you cannot import information which is available only under the GFDL. In other words, you may only import text that is (a) single-licensed under terms compatible with the CC BY-SA license or (b) dual-licensed with the GFDL and another license with terms compatible with the CC BY-SA license. If you are the sole author of the material, you must license it under both CC BY-SA and GFDL.
If the material, text or media, has been previously published and you wish to donate it to Geotubepedia under appropriate license, you will need to verify copyright permission through one of our established procedures. See Geotubepedia:Donating copyrighted materials for details. If you are not a copyright holder, you will still need to verify copyright permission; see the Using copyrighted work from others section below.
You retain copyright to materials you contribute to Geotubepedia, text and media. Copyright is never transferred to Geotubepedia. You can later republish and relicense them in any way you like. However, you can never retract or alter the license for copies of materials that you place here; these copies will remain so licensed until they enter the public domain when your copyright expires (currently some decades after an author's death).
== Using copyrighted work from others ==
All creative works are copyrighted, by international agreement, unless either they fall into the public domain or their copyright is explicitly disclaimed. Generally, Geotubepedia must have permission to use copyrighted works. There are some circumstances under which copyrighted works may be legally utilized without permission; see Geotubepedia:Non-free content for specific details on when and how to utilize such material. However, it is our goal to be able to freely redistribute as much of Geotubepedia's material as possible, so original images and sound files licensed under CC BY-SA and GFDL (unversioned, with no invariant sections, front-cover texts, or back-cover texts) or in the public domain are greatly preferred to copyrighted media files used under fair use or otherwise.
If you want to import media (including text) that you have found elsewhere, and it does not meet the non-free content policy and guideline, you can only do so if it is public domain or available under terms that are compatible with the CC BY-SA license. If you import media under a compatible license which requires attribution, you must, in a reasonable fashion, credit the author(s). You must also in most cases verify that the material is compatibly licensed or public domain. If the original source of publication contains a copyright disclaimer or other indication that the material is free for use, a link to it on the media description page or the article's talk page may satisfy this requirement. If you obtain special permission to use a copyrighted work from the copyright holder under compatible terms, you must make a note of that fact (along with the relevant names and dates) and verify this through one of several processes. See Geotubepedia:Requesting copyright permission for the procedure for asking a copyright holder to grant a usable license for their work and for the processes for verifying that license has been granted.
Never use materials that infringe the copyrights of others. This could create legal liabilities and seriously hurt Geotubepedia. If in doubt, write the content yourself, thereby creating a new copyrighted work which can be included in Geotubepedia without trouble.
Note that copyright law governs the creative expression of ideas, not the ideas or information themselves. Therefore, it is legal to read an encyclopedia article or other work, reformulate the concepts in your own words, and submit it to Geotubepedia, so long as you do not follow the source too closely. However, it would still be ethical and recommended best practice to cite your original source.
== Texts with multiple authors ==
Given the wiki nature of Geotubepedia, any article may have dozens or even thousands of individual contributors. For legal purposes, the most significant contributors to an article are its main or named authors, who will have made substantial intellectual contributions to its content, and those who have contributed copyrighted text to it, either directly or through translation from another language. Anyone may list themselves as an editor on the discussion page of an article they have edited. A named editor of a Geotubepedia article has certain rights and responsibilities concerning that article; for details see the policy page. The copyrights for significant contributions to an article are held by their contributors; for details and for a definition of what constitutes a significant contribution, see the policy page.
== Reusing Geotubepedia content ==
Whenever you reuse or distribute Geotubepedia content, either commercially or non-commercially, you must provide attribution, though not in any way that suggests that Geotubepedia endorses you or your use. You must also include a copy of the Creative Commons Attribution-ShareAlike 3.0 Unported License with any content you distribute. If you make modifications or additions to the page you reuse, you must license them under the Creative Commons Attribution-ShareAlike 3.0 Unported License, or broadly compatible terms. Where you do use a work under its GFDL license, you must, if you distribute it in a manner that allows the use of digital technology, provide access to a "Transparent copy" of the work. The easiest way to ensure you are compliant with the GFDL, if you wish to use content under that license, is to link to the original source page on Geotubepedia.
If you reproduce Geotubepedia content in a format that includes material not under the CC BY-SA license or GFDL, you need to label the Geotubepedia content clearly, preferably by placing a notice at the beginning of the relevant content stating its licensing status. You also need to ensure that any third-party intellectual property you have included is clearly identified with separate copyright notices and is clearly distinguished from the CC BY-SA or GFDL licensed content.
If you use Geotubepedia at a university or other institution, you may need to make sure that your use complies with the institution's internet use policies and honor code. Institutions, especially educational ones, frequently have such codes and policies in place due to concerns about plagiarism.
For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to the Creative Commons Attribution-ShareAlike 3.0 Unported License. For more information, see Geotubepedia's guide on reusing content outside Geotubepedia.
== Summary ==
Geotubepedia's content is free, not simple. Our licenses ensure that the content will remain free and that the largest possible audience will benefit from these works. We believe that this is the right thing to do for our community, for volunteers, and for education. We also believe it's the right thing to do for the world.
However, please understand that you are always ultimately responsible for ensuring that what you are doing is legal. Always use your own best judgment, and consult a lawyer if you're unsure.
ec6ba969ad94d477bca2186f7b599445b704bdd7
500
498
2023-08-11T16:09:22Z
InsaneX
2
wikitext
text/x-wiki
The text of Geotubepedia is copyrighted (automatically, under the Berne Convention) by Geotubepedia editors and contributors and is formally licensed to the public under one or several liberal licenses. Most of Geotubepedia's text and many of its images are co-licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License (CC BY-SA) and the GNU Free Documentation License (GFDL) (unversioned, with no invariant sections, front-cover texts, or back-cover texts). Some text has been imported only under CC BY-SA and CC BY-SA-compatible license and cannot be reused under GFDL; such text will be identified on the page footer, in the page history, or on the discussion page of the article that utilizes the text. Every image has a description page that indicates the license under which it is released or, if it is non-free, the rationale under which it is used.
The licenses Geotubepedia uses grant free access to our content in the same sense that free software is licensed freely. Geotubepedia content can be copied, modified, and redistributed if and only if the copied version is made available on the same terms to others and acknowledgment of the authors of the Geotubepedia article used is included (a link back to the article is generally thought to satisfy the attribution requirement; see below for more details). Copied Geotubepedia content will therefore remain free under an appropriate license and can continue to be used by anyone subject to certain restrictions, most of which aim to ensure that freedom. This principle is known as copyleft in contrast to typical copyright licenses.
To this end:
* Permission is granted to copy, distribute and/or modify Geotubepedia's text under the terms of the Creative Commons Attribution-ShareAlike 3.0 Unported License and, unless otherwise noted, the GNU Free Documentation License, unversioned, with no invariant sections, front-cover texts, or back-cover texts.
* A copy of the Creative Commons Attribution-ShareAlike 3.0 Unported License is included in the section entitled "Geotubepedia:Text of Creative Commons Attribution-ShareAlike 3.0 Unported License"
* A copy of the GNU Free Documentation License is included in the section entitled "GNU Free Documentation License".
* Content on Geotubepedia is covered by disclaimers.
* The English text of the CC BY-SA and GFDL licenses is the only legally binding restriction between authors and users of Geotubepedia content. What follows is our interpretation of CC BY-SA and GFDL, as it pertains to the rights and obligations of users and contributors.
== Contributors' rights and obligations ==
If you contribute text directly to Geotubepedia, you thereby license it to the public for reuse under CC BY-SA and GFDL (unversioned, with no invariant sections, front-cover texts, or back-cover texts). Non-text media may be contributed under a variety of different licenses that support the general goal of allowing unrestricted re-use and re-distribution. See Guidelines for images and other media files, below.
If you want to import text that you have found elsewhere or that you have co-authored with others, you can only do so if it is available under terms that are compatible with the CC BY-SA license. You do not need to ensure or guarantee that the imported text is available under the GNU Free Documentation License, unless you are its sole author. Furthermore, please note that you cannot import information which is available only under the GFDL. In other words, you may only import text that is (a) single-licensed under terms compatible with the CC BY-SA license or (b) dual-licensed with the GFDL and another license with terms compatible with the CC BY-SA license. If you are the sole author of the material, you must license it under both CC BY-SA and GFDL.
If the material, text or media, has been previously published and you wish to donate it to Geotubepedia under appropriate license, you will need to verify copyright permission through one of our established procedures. See Geotubepedia:Donating copyrighted materials for details. If you are not a copyright holder, you will still need to verify copyright permission; see the Using copyrighted work from others section below.
You retain copyright to materials you contribute to Geotubepedia, text and media. Copyright is never transferred to Geotubepedia. You can later republish and relicense them in any way you like. However, you can never retract or alter the license for copies of materials that you place here; these copies will remain so licensed until they enter the public domain when your copyright expires (currently some decades after an author's death).
== Using copyrighted work from others ==
All creative works are copyrighted, by international agreement, unless either they fall into the public domain or their copyright is explicitly disclaimed. Generally, Geotubepedia must have permission to use copyrighted works. There are some circumstances under which copyrighted works may be legally utilized without permission; see Geotubepedia:Non-free content for specific details on when and how to utilize such material. However, it is our goal to be able to freely redistribute as much of Geotubepedia's material as possible, so original images and sound files licensed under CC BY-SA and GFDL (unversioned, with no invariant sections, front-cover texts, or back-cover texts) or in the public domain are greatly preferred to copyrighted media files used under fair use or otherwise.
If you want to import media (including text) that you have found elsewhere, and it does not meet the non-free content policy and guideline, you can only do so if it is public domain or available under terms that are compatible with the CC BY-SA license. If you import media under a compatible license which requires attribution, you must, in a reasonable fashion, credit the author(s). You must also in most cases verify that the material is compatibly licensed or public domain. If the original source of publication contains a copyright disclaimer or other indication that the material is free for use, a link to it on the media description page or the article's talk page may satisfy this requirement. If you obtain special permission to use a copyrighted work from the copyright holder under compatible terms, you must make a note of that fact (along with the relevant names and dates) and verify this through one of several processes. See Geotubepedia:Requesting copyright permission for the procedure for asking a copyright holder to grant a usable license for their work and for the processes for verifying that license has been granted.
Never use materials that infringe the copyrights of others. This could create legal liabilities and seriously hurt Geotubepedia. If in doubt, write the content yourself, thereby creating a new copyrighted work which can be included in Geotubepedia without trouble.
Note that copyright law governs the creative expression of ideas, not the ideas or information themselves. Therefore, it is legal to read an encyclopedia article or other work, reformulate the concepts in your own words, and submit it to Geotubepedia, so long as you do not follow the source too closely. However, it would still be ethical and recommended best practice to cite your original source.
== Texts with multiple authors ==
Given the wiki nature of Geotubepedia, any article may have dozens or even thousands of individual contributors. For legal purposes, the most significant contributors to an article are its main or named authors, who will have made substantial intellectual contributions to its content, and those who have contributed copyrighted text to it, either directly or through translation from another language. Anyone may list themselves as an editor on the discussion page of an article they have edited. A named editor of a Geotubepedia article has certain rights and responsibilities concerning that article; for details see the policy page. The copyrights for significant contributions to an article are held by their contributors; for details and for a definition of what constitutes a significant contribution, see the policy page.
== Reusing Geotubepedia content ==
Whenever you reuse or distribute Geotubepedia content, either commercially or non-commercially, you must provide attribution, though not in any way that suggests that Geotubepedia endorses you or your use. You must also include a copy of the Creative Commons Attribution-ShareAlike 3.0 Unported License with any content you distribute. If you make modifications or additions to the page you reuse, you must license them under the Creative Commons Attribution-ShareAlike 3.0 Unported License, or broadly compatible terms. Where you do use a work under its GFDL license, you must, if you distribute it in a manner that allows the use of digital technology, provide access to a "Transparent copy" of the work. The easiest way to ensure you are compliant with the GFDL, if you wish to use content under that license, is to link to the original source page on Geotubepedia.
If you reproduce Geotubepedia content in a format that includes material not under the CC BY-SA license or GFDL, you need to label the Geotubepedia content clearly, preferably by placing a notice at the beginning of the relevant content stating its licensing status. You also need to ensure that any third-party intellectual property you have included is clearly identified with separate copyright notices and is clearly distinguished from the CC BY-SA or GFDL licensed content.
If you use Geotubepedia at a university or other institution, you may need to make sure that your use complies with the institution's internet use policies and honor code. Institutions, especially educational ones, frequently have such codes and policies in place due to concerns about plagiarism.
For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to the Creative Commons Attribution-ShareAlike 3.0 Unported License. For more information, see Geotubepedia's guide on reusing content outside Geotubepedia.
== Summary ==
Geotubepedia's content is free, not simple. Our licenses ensure that the content will remain free and that the largest possible audience will benefit from these works. We believe that this is the right thing to do for our community, for volunteers, and for education. We also believe it's the right thing to do for the world.
However, please understand that you are always ultimately responsible for ensuring that what you are doing is legal. Always use your own best judgment, and consult a lawyer if you're unsure.
== See also ==
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:About|About Geotubepedia]]
* [[Geotubepedia:Help Desk|Help Desk]]
d94f911f349489f3bf9a6c01d70d4850e2e1f5c6
503
500
2023-08-11T16:11:14Z
InsaneX
2
/* See also */
wikitext
text/x-wiki
The text of Geotubepedia is copyrighted (automatically, under the Berne Convention) by Geotubepedia editors and contributors and is formally licensed to the public under one or several liberal licenses. Most of Geotubepedia's text and many of its images are co-licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License (CC BY-SA) and the GNU Free Documentation License (GFDL) (unversioned, with no invariant sections, front-cover texts, or back-cover texts). Some text has been imported only under CC BY-SA and CC BY-SA-compatible license and cannot be reused under GFDL; such text will be identified on the page footer, in the page history, or on the discussion page of the article that utilizes the text. Every image has a description page that indicates the license under which it is released or, if it is non-free, the rationale under which it is used.
The licenses Geotubepedia uses grant free access to our content in the same sense that free software is licensed freely. Geotubepedia content can be copied, modified, and redistributed if and only if the copied version is made available on the same terms to others and acknowledgment of the authors of the Geotubepedia article used is included (a link back to the article is generally thought to satisfy the attribution requirement; see below for more details). Copied Geotubepedia content will therefore remain free under an appropriate license and can continue to be used by anyone subject to certain restrictions, most of which aim to ensure that freedom. This principle is known as copyleft in contrast to typical copyright licenses.
To this end:
* Permission is granted to copy, distribute and/or modify Geotubepedia's text under the terms of the Creative Commons Attribution-ShareAlike 3.0 Unported License and, unless otherwise noted, the GNU Free Documentation License, unversioned, with no invariant sections, front-cover texts, or back-cover texts.
* A copy of the Creative Commons Attribution-ShareAlike 3.0 Unported License is included in the section entitled "Geotubepedia:Text of Creative Commons Attribution-ShareAlike 3.0 Unported License"
* A copy of the GNU Free Documentation License is included in the section entitled "GNU Free Documentation License".
* Content on Geotubepedia is covered by disclaimers.
* The English text of the CC BY-SA and GFDL licenses is the only legally binding restriction between authors and users of Geotubepedia content. What follows is our interpretation of CC BY-SA and GFDL, as it pertains to the rights and obligations of users and contributors.
== Contributors' rights and obligations ==
If you contribute text directly to Geotubepedia, you thereby license it to the public for reuse under CC BY-SA and GFDL (unversioned, with no invariant sections, front-cover texts, or back-cover texts). Non-text media may be contributed under a variety of different licenses that support the general goal of allowing unrestricted re-use and re-distribution. See Guidelines for images and other media files, below.
If you want to import text that you have found elsewhere or that you have co-authored with others, you can only do so if it is available under terms that are compatible with the CC BY-SA license. You do not need to ensure or guarantee that the imported text is available under the GNU Free Documentation License, unless you are its sole author. Furthermore, please note that you cannot import information which is available only under the GFDL. In other words, you may only import text that is (a) single-licensed under terms compatible with the CC BY-SA license or (b) dual-licensed with the GFDL and another license with terms compatible with the CC BY-SA license. If you are the sole author of the material, you must license it under both CC BY-SA and GFDL.
If the material, text or media, has been previously published and you wish to donate it to Geotubepedia under appropriate license, you will need to verify copyright permission through one of our established procedures. See Geotubepedia:Donating copyrighted materials for details. If you are not a copyright holder, you will still need to verify copyright permission; see the Using copyrighted work from others section below.
You retain copyright to materials you contribute to Geotubepedia, text and media. Copyright is never transferred to Geotubepedia. You can later republish and relicense them in any way you like. However, you can never retract or alter the license for copies of materials that you place here; these copies will remain so licensed until they enter the public domain when your copyright expires (currently some decades after an author's death).
== Using copyrighted work from others ==
All creative works are copyrighted, by international agreement, unless either they fall into the public domain or their copyright is explicitly disclaimed. Generally, Geotubepedia must have permission to use copyrighted works. There are some circumstances under which copyrighted works may be legally utilized without permission; see Geotubepedia:Non-free content for specific details on when and how to utilize such material. However, it is our goal to be able to freely redistribute as much of Geotubepedia's material as possible, so original images and sound files licensed under CC BY-SA and GFDL (unversioned, with no invariant sections, front-cover texts, or back-cover texts) or in the public domain are greatly preferred to copyrighted media files used under fair use or otherwise.
If you want to import media (including text) that you have found elsewhere, and it does not meet the non-free content policy and guideline, you can only do so if it is public domain or available under terms that are compatible with the CC BY-SA license. If you import media under a compatible license which requires attribution, you must, in a reasonable fashion, credit the author(s). You must also in most cases verify that the material is compatibly licensed or public domain. If the original source of publication contains a copyright disclaimer or other indication that the material is free for use, a link to it on the media description page or the article's talk page may satisfy this requirement. If you obtain special permission to use a copyrighted work from the copyright holder under compatible terms, you must make a note of that fact (along with the relevant names and dates) and verify this through one of several processes. See Geotubepedia:Requesting copyright permission for the procedure for asking a copyright holder to grant a usable license for their work and for the processes for verifying that license has been granted.
Never use materials that infringe the copyrights of others. This could create legal liabilities and seriously hurt Geotubepedia. If in doubt, write the content yourself, thereby creating a new copyrighted work which can be included in Geotubepedia without trouble.
Note that copyright law governs the creative expression of ideas, not the ideas or information themselves. Therefore, it is legal to read an encyclopedia article or other work, reformulate the concepts in your own words, and submit it to Geotubepedia, so long as you do not follow the source too closely. However, it would still be ethical and recommended best practice to cite your original source.
== Texts with multiple authors ==
Given the wiki nature of Geotubepedia, any article may have dozens or even thousands of individual contributors. For legal purposes, the most significant contributors to an article are its main or named authors, who will have made substantial intellectual contributions to its content, and those who have contributed copyrighted text to it, either directly or through translation from another language. Anyone may list themselves as an editor on the discussion page of an article they have edited. A named editor of a Geotubepedia article has certain rights and responsibilities concerning that article; for details see the policy page. The copyrights for significant contributions to an article are held by their contributors; for details and for a definition of what constitutes a significant contribution, see the policy page.
== Reusing Geotubepedia content ==
Whenever you reuse or distribute Geotubepedia content, either commercially or non-commercially, you must provide attribution, though not in any way that suggests that Geotubepedia endorses you or your use. You must also include a copy of the Creative Commons Attribution-ShareAlike 3.0 Unported License with any content you distribute. If you make modifications or additions to the page you reuse, you must license them under the Creative Commons Attribution-ShareAlike 3.0 Unported License, or broadly compatible terms. Where you do use a work under its GFDL license, you must, if you distribute it in a manner that allows the use of digital technology, provide access to a "Transparent copy" of the work. The easiest way to ensure you are compliant with the GFDL, if you wish to use content under that license, is to link to the original source page on Geotubepedia.
If you reproduce Geotubepedia content in a format that includes material not under the CC BY-SA license or GFDL, you need to label the Geotubepedia content clearly, preferably by placing a notice at the beginning of the relevant content stating its licensing status. You also need to ensure that any third-party intellectual property you have included is clearly identified with separate copyright notices and is clearly distinguished from the CC BY-SA or GFDL licensed content.
If you use Geotubepedia at a university or other institution, you may need to make sure that your use complies with the institution's internet use policies and honor code. Institutions, especially educational ones, frequently have such codes and policies in place due to concerns about plagiarism.
For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to the Creative Commons Attribution-ShareAlike 3.0 Unported License. For more information, see Geotubepedia's guide on reusing content outside Geotubepedia.
== Summary ==
Geotubepedia's content is free, not simple. Our licenses ensure that the content will remain free and that the largest possible audience will benefit from these works. We believe that this is the right thing to do for our community, for volunteers, and for education. We also believe it's the right thing to do for the world.
However, please understand that you are always ultimately responsible for ensuring that what you are doing is legal. Always use your own best judgment, and consult a lawyer if you're unsure.
== See also ==
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:About|About Geotubepedia]]
* [[Geotubepedia:Help Desk|Help Desk]]
[[Category:Geotubepedia documentation]]
5c64c1e45010e3efd6452cf8f297d071712e8251
Category:Geotubepedia documentation
14
210
504
2023-08-11T16:11:37Z
InsaneX
2
Created page with "The official documentation for Geotubepedia."
wikitext
text/x-wiki
The official documentation for Geotubepedia.
7834f6a59e161ef825cff5bec188b6188f4445ad
File:1c4f958c78db78f8ee89aef6c6501444.png
6
211
505
2023-08-11T16:25:27Z
InsaneX
2
Woodmark of Geotubpedia
wikitext
text/x-wiki
== Summary ==
Woodmark of Geotubpedia
e1a590e2107c8785054c98d613c1c3d39a6ccb82
File:UmarEdits Logo.jpg
6
168
507
350
2023-08-11T17:12:48Z
2601:243:1F00:3EF0:DD8B:24B6:C45D:D45E
0
wikitext
text/x-wiki
== Summary ==
Logo of UmarEdits
Muhammad Umar Irfan Urdu: محمد ابن عمر 2000Is A Geotuber From Pakistan And Saudi Arabia He Was Born In 2006 To A Pakistani Family From Lahore In The City of Riyadh. He Has 90K followers on YouTube.
cedadf2f3043dff6623823ed4ec2890cf0e53a3e
Cartoonabad
0
169
508
461
2023-08-11T17:27:51Z
InsaneX
2
wikitext
text/x-wiki
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
[[File:Cartoonabad_Logo.jpg|thumb|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [https://en.wikipedia.org/wiki/Hindi Hindi]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
d11751b455590ef9b26f3092e842f40bc142544d
509
508
2023-08-12T08:04:59Z
InsaneX
2
wikitext
text/x-wiki
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
[[File:Cartoonabad_Logo.jpg|thumb|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.<ref>https://youtube.com/</ref>
== Personal Life ==
Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [https://en.wikipedia.org/wiki/Hindi Hindi]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
== References ==
<references />
fb04d3aad060f52e285c9d731202e2484dda8c6b
510
509
2023-08-12T08:05:37Z
InsaneX
2
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [https://en.wikipedia.org/wiki/Hindi Hindi]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
5f295d2d05aff2f2eabc8e3620601d2f9d1e01a0
OfficialEditzPK
0
212
511
2023-08-12T08:31:39Z
InsaneX
2
Created page with "'''Abdul Ahad''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: عبدل احد) is a Dutch-Pakistani Geotuber, best recognized for his YouTube channel, '''OfficialEditzPK'''. As of the latest records, he has around 4k subscribers and has accumulated over 2.1 million views. == Early Life == Abdul Ahad was born on 13 June 2009 in [https://en.wikipedia.org/wiki/Rotterdam Rotterdam], [https://en.wikipedia.org/wiki/Netherlands Netherlands]. He lives in both Rotterdam and Harip..."
wikitext
text/x-wiki
'''Abdul Ahad''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: عبدل احد) is a Dutch-Pakistani Geotuber, best recognized for his YouTube channel, '''OfficialEditzPK'''. As of the latest records, he has around 4k subscribers and has accumulated over 2.1 million views.
== Early Life ==
Abdul Ahad was born on 13 June 2009 in [https://en.wikipedia.org/wiki/Rotterdam Rotterdam], [https://en.wikipedia.org/wiki/Netherlands Netherlands]. He lives in both Rotterdam and Haripur, Pakistan. Ahad candidly mentioned that in the earlier parts of his life, he felt challenged in many endeavors but found his niche as a proficient designer. He is a supporter of [ https://en.wikipedia.org/wiki/Pakistan_Tehreek-e-Insaf Pakistan Tehreek-e-Insaf] and its chairman, [https://en.wikipedia.org/wiki/Imran_Khan Imran Khan].
=== YouTube Career ===
Ahad recalls aspiring to have a YouTube channel when he was just 8 years old. However, due to the age restrictions in The Netherlands, which require individuals to be 16 or older to have a YouTube channel, his dream was postponed. Unknown to the option of altering the age details, he waited.
In 2022, during a stay in Pakistan, Ahad's cousin introduced him to the platform once again. In Pakistan, the minimum age to have a YouTube channel is 13, and with Ahad fitting the age bracket, he quickly established his presence. Abdul Ahad soon started creating content centered around Geography on his channel [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK].
== External Links ==
* [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK] on YouTube
cfed9190ad5d2226da44c08d6739dd52ca0dfb59
512
511
2023-08-12T08:31:51Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
'''Abdul Ahad''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: عبدل احد) is a Dutch-Pakistani Geotuber, best recognized for his YouTube channel, '''OfficialEditzPK'''. As of the latest records, he has around 4k subscribers and has accumulated over 2.1 million views.
== Early Life ==
Abdul Ahad was born on 13 June 2009 in [https://en.wikipedia.org/wiki/Rotterdam Rotterdam], [https://en.wikipedia.org/wiki/Netherlands Netherlands]. He lives in both Rotterdam and Haripur, Pakistan. Ahad candidly mentioned that in the earlier parts of his life, he felt challenged in many endeavors but found his niche as a proficient designer. He is a supporter of [ https://en.wikipedia.org/wiki/Pakistan_Tehreek-e-Insaf Pakistan Tehreek-e-Insaf] and its chairman, [https://en.wikipedia.org/wiki/Imran_Khan Imran Khan].
== YouTube Career ==
Ahad recalls aspiring to have a YouTube channel when he was just 8 years old. However, due to the age restrictions in The Netherlands, which require individuals to be 16 or older to have a YouTube channel, his dream was postponed. Unknown to the option of altering the age details, he waited.
In 2022, during a stay in Pakistan, Ahad's cousin introduced him to the platform once again. In Pakistan, the minimum age to have a YouTube channel is 13, and with Ahad fitting the age bracket, he quickly established his presence. Abdul Ahad soon started creating content centered around Geography on his channel [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK].
== External Links ==
* [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK] on YouTube
5646d5f045df0dcf50d1ae0a2c0b1a380668f041
513
512
2023-08-12T08:32:07Z
InsaneX
2
/* Early Life */
wikitext
text/x-wiki
'''Abdul Ahad''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: عبدل احد) is a Dutch-Pakistani Geotuber, best recognized for his YouTube channel, '''OfficialEditzPK'''. As of the latest records, he has around 4k subscribers and has accumulated over 2.1 million views.
== Early Life ==
Abdul Ahad was born on 13 June 2009 in [https://en.wikipedia.org/wiki/Rotterdam Rotterdam], [https://en.wikipedia.org/wiki/Netherlands Netherlands]. He lives in both Rotterdam and Haripur, Pakistan. Ahad candidly mentioned that in the earlier parts of his life, he felt challenged in many endeavors but found his niche as a proficient designer. He is a supporter of [https://en.wikipedia.org/wiki/Pakistan_Tehreek-e-Insaf Pakistan Tehreek-e-Insaf] and its chairman, [https://en.wikipedia.org/wiki/Imran_Khan Imran Khan].
== YouTube Career ==
Ahad recalls aspiring to have a YouTube channel when he was just 8 years old. However, due to the age restrictions in The Netherlands, which require individuals to be 16 or older to have a YouTube channel, his dream was postponed. Unknown to the option of altering the age details, he waited.
In 2022, during a stay in Pakistan, Ahad's cousin introduced him to the platform once again. In Pakistan, the minimum age to have a YouTube channel is 13, and with Ahad fitting the age bracket, he quickly established his presence. Abdul Ahad soon started creating content centered around Geography on his channel [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK].
== External Links ==
* [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK] on YouTube
033c5e979ab1b057d3374707bc2b6b707a3f46a3
519
513
2023-08-12T08:48:46Z
InsaneX
2
wikitext
text/x-wiki
[[File:Saif_Sheikh_Logo2.jpg|thumb|right|300px|Logo of OfficialEditzPK.]]
'''Abdul Ahad''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: عبدل احد) is a Dutch-Pakistani Geotuber, best recognized for his YouTube channel, '''OfficialEditzPK'''. As of the latest records, he has around 4k subscribers and has accumulated over 2.1 million views.
== Early Life ==
Abdul Ahad was born on 13 June 2009 in [https://en.wikipedia.org/wiki/Rotterdam Rotterdam], [https://en.wikipedia.org/wiki/Netherlands Netherlands]. He lives in both Rotterdam and Haripur, Pakistan. Ahad candidly mentioned that in the earlier parts of his life, he felt challenged in many endeavors but found his niche as a proficient designer. He is a supporter of [https://en.wikipedia.org/wiki/Pakistan_Tehreek-e-Insaf Pakistan Tehreek-e-Insaf] and its chairman, [https://en.wikipedia.org/wiki/Imran_Khan Imran Khan].
== YouTube Career ==
Ahad recalls aspiring to have a YouTube channel when he was just 8 years old. However, due to the age restrictions in The Netherlands, which require individuals to be 16 or older to have a YouTube channel, his dream was postponed. Unknown to the option of altering the age details, he waited.
In 2022, during a stay in Pakistan, Ahad's cousin introduced him to the platform once again. In Pakistan, the minimum age to have a YouTube channel is 13, and with Ahad fitting the age bracket, he quickly established his presence. Abdul Ahad soon started creating content centered around Geography on his channel [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK].
== External Links ==
* [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK] on YouTube
38263e2c0ad83368e4ee74349b383f2c68e70bce
520
519
2023-08-12T08:49:13Z
InsaneX
2
wikitext
text/x-wiki
[[File:OfficialEditzPK_Logo.jpg|thumb|right|300px|Logo of OfficialEditzPK.]]
'''Abdul Ahad''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: عبدل احد) is a Dutch-Pakistani Geotuber, best recognized for his YouTube channel, '''OfficialEditzPK'''. As of the latest records, he has around 4k subscribers and has accumulated over 2.1 million views.
== Early Life ==
Abdul Ahad was born on 13 June 2009 in [https://en.wikipedia.org/wiki/Rotterdam Rotterdam], [https://en.wikipedia.org/wiki/Netherlands Netherlands]. He lives in both Rotterdam and Haripur, Pakistan. Ahad candidly mentioned that in the earlier parts of his life, he felt challenged in many endeavors but found his niche as a proficient designer. He is a supporter of [https://en.wikipedia.org/wiki/Pakistan_Tehreek-e-Insaf Pakistan Tehreek-e-Insaf] and its chairman, [https://en.wikipedia.org/wiki/Imran_Khan Imran Khan].
== YouTube Career ==
Ahad recalls aspiring to have a YouTube channel when he was just 8 years old. However, due to the age restrictions in The Netherlands, which require individuals to be 16 or older to have a YouTube channel, his dream was postponed. Unknown to the option of altering the age details, he waited.
In 2022, during a stay in Pakistan, Ahad's cousin introduced him to the platform once again. In Pakistan, the minimum age to have a YouTube channel is 13, and with Ahad fitting the age bracket, he quickly established his presence. Abdul Ahad soon started creating content centered around Geography on his channel [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK].
== External Links ==
* [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK] on YouTube
95001517ecdf97c1d841485922fe62247d16a6d0
521
520
2023-08-12T08:49:35Z
InsaneX
2
wikitext
text/x-wiki
[[File:OfficialEditzPK_Logo.jpg|thumb|right|300px|Logo of OfficialEditzPK.]]
'''Abdul Ahad''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: عبدل احد) is a Dutch-Pakistani Geotuber, best recognized for his YouTube channel, '''OfficialEditzPK'''. As of the latest records, he has around 4k subscribers and has accumulated over 2.1 million views.
== Early Life ==
Abdul Ahad was born on 13 June 2009 in [https://en.wikipedia.org/wiki/Rotterdam Rotterdam], [https://en.wikipedia.org/wiki/Netherlands Netherlands]. He lives in both Rotterdam and Haripur, Pakistan. Ahad candidly mentioned that in the earlier parts of his life, he felt challenged in many endeavors but found his niche as a proficient designer. He is a supporter of [https://en.wikipedia.org/wiki/Pakistan_Tehreek-e-Insaf Pakistan Tehreek-e-Insaf] and its chairman, [https://en.wikipedia.org/wiki/Imran_Khan Imran Khan].
== YouTube Career ==
Ahad recalls aspiring to have a YouTube channel when he was just 8 years old. However, due to the age restrictions in The Netherlands, which require individuals to be 16 or older to have a YouTube channel, his dream was postponed. Unknown to the option of altering the age details, he waited.
In 2022, during a stay in Pakistan, Ahad's cousin introduced him to the platform once again. In Pakistan, the minimum age to have a YouTube channel is 13, and with Ahad fitting the age bracket, he quickly established his presence. Abdul Ahad soon started creating content centered around Geography on his channel [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK].
== External Links ==
* [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK] on YouTube
[[Category:List of Geotubers]]
e6c6d090b5e91029f454084c06e2d55690eb6fbe
522
521
2023-08-12T08:49:50Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:OfficialEditzPK_Logo.jpg|thumb|right|300px|Logo of OfficialEditzPK.]]
'''Abdul Ahad''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: عبدل احد) is a Dutch-Pakistani Geotuber, best recognized for his YouTube channel, '''OfficialEditzPK'''. As of the latest records, he has around 4k subscribers and has accumulated over 2.1 million views.
== Early Life ==
Abdul Ahad was born on 13 June 2009 in [https://en.wikipedia.org/wiki/Rotterdam Rotterdam], [https://en.wikipedia.org/wiki/Netherlands Netherlands]. He lives in both Rotterdam and Haripur, Pakistan. Ahad candidly mentioned that in the earlier parts of his life, he felt challenged in many endeavors but found his niche as a proficient designer. He is a supporter of [https://en.wikipedia.org/wiki/Pakistan_Tehreek-e-Insaf Pakistan Tehreek-e-Insaf] and its chairman, [https://en.wikipedia.org/wiki/Imran_Khan Imran Khan].
== YouTube Career ==
Ahad recalls aspiring to have a YouTube channel when he was just 8 years old. However, due to the age restrictions in The Netherlands, which require individuals to be 16 or older to have a YouTube channel, his dream was postponed. Unknown to the option of altering the age details, he waited.
In 2022, during a stay in Pakistan, Ahad's cousin introduced him to the platform once again. In Pakistan, the minimum age to have a YouTube channel is 13, and with Ahad fitting the age bracket, he quickly established his presence. Abdul Ahad soon started creating content centered around Geography on his channel [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK].
== External Links ==
* [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK on YouTube]
[[Category:List of Geotubers]]
2a976f4e545a190fa9fae5403fe276b0975e798a
Saif Sheikh Edits
0
172
514
467
2023-08-12T08:41:00Z
InsaneX
2
/* See Also */
wikitext
text/x-wiki
[[Category:List of Geotubers]]
[[File:Saif Sheikh Logo.jpg|thumb|right|300px|Logo of Saif Sheikh Edits.]]
'''Saif Sheikh''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سیف شیخ) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Saif Sheikh Edits'''.
== Personal Life ==
Saif was born on February 4th, 2009, in Lahore, Pakistan. Saif experienced a significant transition in his life when he moved to Chicago in late 2012. Adapting to a new culture and environment, Saif's experiences in both Lahore and Chicago have played a pivotal role in shaping his perspectives and content. Politically, Saif is a supporter of Imran Khan.
== YouTube Career ==
Saif's journey into the realm of YouTube and geography was inspired by Geotubers like TheGamingKing and UmarEdits. Their content struck a chord with Saif, motivating him to dive into the world of geography content creation. As a result, he commenced his own channel, ''Saif Sheikh Edits'', where he brings a unique blend of his experiences and knowledge to his audience.
== See Also ==
* [https://www.youtube.com/@Saif.Sheikh.ed1ts/ Saif Sheikh Edits on YouTube]
* [https://www.instagram.com/sh2005_4_4/?igshid=OGQ5ZDc2ODk2ZA%3D%3D Saif Sheikh Edits on Instagram]
245f9e6af7f2b247a4ef02726c2c247fbc0ab9a5
515
514
2023-08-12T08:41:18Z
InsaneX
2
/* See Also */
wikitext
text/x-wiki
[[Category:List of Geotubers]]
[[File:Saif Sheikh Logo.jpg|thumb|right|300px|Logo of Saif Sheikh Edits.]]
'''Saif Sheikh''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سیف شیخ) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Saif Sheikh Edits'''.
== Personal Life ==
Saif was born on February 4th, 2009, in Lahore, Pakistan. Saif experienced a significant transition in his life when he moved to Chicago in late 2012. Adapting to a new culture and environment, Saif's experiences in both Lahore and Chicago have played a pivotal role in shaping his perspectives and content. Politically, Saif is a supporter of Imran Khan.
== YouTube Career ==
Saif's journey into the realm of YouTube and geography was inspired by Geotubers like TheGamingKing and UmarEdits. Their content struck a chord with Saif, motivating him to dive into the world of geography content creation. As a result, he commenced his own channel, ''Saif Sheikh Edits'', where he brings a unique blend of his experiences and knowledge to his audience.
== External Links ==
* [https://www.youtube.com/@Saif.Sheikh.ed1ts/ Saif Sheikh Edits on YouTube]
* [https://www.instagram.com/sh2005_4_4/?igshid=OGQ5ZDc2ODk2ZA%3D%3D Saif Sheikh Edits on Instagram]
d6ffa619b2b0c3c345c24f819538f0a46dd943c9
517
515
2023-08-12T08:43:58Z
InsaneX
2
wikitext
text/x-wiki
[[Category:List of Geotubers]]
[[File:Saif_Sheikh_Logo2.jpg|thumb|right|300px|Logo of Saif Sheikh Edits.]]
'''Saif Sheikh''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سیف شیخ) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Saif Sheikh Edits'''.
== Personal Life ==
Saif was born on February 4th, 2009, in Lahore, Pakistan. Saif experienced a significant transition in his life when he moved to Chicago in late 2012. Adapting to a new culture and environment, Saif's experiences in both Lahore and Chicago have played a pivotal role in shaping his perspectives and content. Politically, Saif is a supporter of Imran Khan.
== YouTube Career ==
Saif's journey into the realm of YouTube and geography was inspired by Geotubers like TheGamingKing and UmarEdits. Their content struck a chord with Saif, motivating him to dive into the world of geography content creation. As a result, he commenced his own channel, ''Saif Sheikh Edits'', where he brings a unique blend of his experiences and knowledge to his audience.
== External Links ==
* [https://www.youtube.com/@Saif.Sheikh.ed1ts/ Saif Sheikh Edits on YouTube]
* [https://www.instagram.com/sh2005_4_4/?igshid=OGQ5ZDc2ODk2ZA%3D%3D Saif Sheikh Edits on Instagram]
e4c2a748b73ccc781fcf71eb944c703f98028c0e
518
517
2023-08-12T08:48:08Z
InsaneX
2
wikitext
text/x-wiki
[[Category:List of Geotubers]]
[[File:Saif_Sheikh_Logo2.jpg|thumb|right|300px|Logo of Saif Sheikh Edits.]]
'''Saif Sheikh''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سیف شیخ) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Saif Sheikh Edits'''.
== Personal Life ==
Saif was born on February 4th, 2009, in [https://en.wikipedia.org/wiki/Lahore Lahore], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. Saif experienced a significant transition in his life when he moved to [https://en.wikipedia.org/wiki/Chicago Chicago] in late 2012. Adapting to a new culture and environment, Saif's experiences in both Lahore and Chicago have played a pivotal role in shaping his perspectives and content. Politically, Saif is a supporter of [https://en.wikipedia.org/wiki/Imran_khan Imran Khan].
== YouTube Career ==
Saif's journey into the realm of YouTube and geography was inspired by Geotubers like TheGamingKing and UmarEdits. Their content struck a chord with Saif, motivating him to dive into the world of geography content creation. As a result, he commenced his own channel, ''Saif Sheikh Edits'', where he brings a unique blend of his experiences and knowledge to his audience.
== External Links ==
* [https://www.youtube.com/@Saif.Sheikh.ed1ts/ Saif Sheikh Edits on YouTube]
* [https://www.instagram.com/sh2005_4_4/?igshid=OGQ5ZDc2ODk2ZA%3D%3D Saif Sheikh Edits on Instagram]
9381ba29f5deb658adb789457e981a08753e2ebc
File:Saif Sheikh Logo2.jpg
6
213
516
2023-08-12T08:43:23Z
InsaneX
2
Logo of Saif Sheikh Edits
wikitext
text/x-wiki
== Summary ==
Logo of Saif Sheikh Edits
e8f309c558d45f0d0521018161d660dac62c9782
File:OfficialEditzPK Logo.jpg
6
214
523
2023-08-12T08:51:56Z
InsaneX
2
Logo of OfficialEditzPK
wikitext
text/x-wiki
== Summary ==
Logo of OfficialEditzPK
82a5dfc728788ba799223abf8a9ae3d9136159e6
Saif Sheikh Edits
0
172
524
518
2023-08-12T08:53:20Z
InsaneX
2
wikitext
text/x-wiki
[[File:Saif_Sheikh_Logo2.jpg|thumb|right|300px|Logo of Saif Sheikh Edits.]]
'''Saif Sheikh''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سیف شیخ) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Saif Sheikh Edits'''.
== Personal Life ==
Saif was born on February 4th, 2009, in [https://en.wikipedia.org/wiki/Lahore Lahore], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. Saif experienced a significant transition in his life when he moved to [https://en.wikipedia.org/wiki/Chicago Chicago] in late 2012. Adapting to a new culture and environment, Saif's experiences in both Lahore and Chicago have played a pivotal role in shaping his perspectives and content. Politically, Saif is a supporter of [https://en.wikipedia.org/wiki/Imran_khan Imran Khan].
== YouTube Career ==
Saif's journey into the realm of YouTube and geography was inspired by Geotubers like TheGamingKing and UmarEdits. Their content struck a chord with Saif, motivating him to dive into the world of geography content creation. As a result, he commenced his own channel, ''Saif Sheikh Edits'', where he brings a unique blend of his experiences and knowledge to his audience.
== External Links ==
* [https://www.youtube.com/@Saif.Sheikh.ed1ts/ Saif Sheikh Edits on YouTube]
* [https://www.instagram.com/sh2005_4_4/?igshid=OGQ5ZDc2ODk2ZA%3D%3D Saif Sheikh Edits on Instagram]
[[Category:List of Geotubers]]
744c74bbf74479c52214b1d5e1597ae3082990f6
OfficialEditzPK
0
212
525
522
2023-08-12T08:54:06Z
InsaneX
2
wikitext
text/x-wiki
[[File:OfficialEditzPK_Logo.jpg|thumb|right|300px|Logo of OfficialEditzPK.]]
'''Abdul Ahad''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: عبدل احد) is a Dutch-Pakistani Geotuber, best recognized for his YouTube channel, '''OfficialEditzPK'''. As of the latest records, he has around 4k subscribers and has accumulated over 2.1 million views.
== Early Life ==
Abdul Ahad was born on 13 June 2009 in [https://en.wikipedia.org/wiki/Rotterdam Rotterdam], [https://en.wikipedia.org/wiki/Netherlands Netherlands]. He lives in both Rotterdam and Haripur, Pakistan. Ahad candidly mentioned that in the earlier parts of his life, he felt challenged in many endeavors but found his niche as a proficient designer. He is a supporter of [https://en.wikipedia.org/wiki/Pakistan_Tehreek-e-Insaf Pakistan Tehreek-e-Insaf] and its chairman, [https://en.wikipedia.org/wiki/Imran_Khan Imran Khan].
== YouTube Career ==
Ahad recalls aspiring to have a YouTube channel when he was just 8 years old. However, due to the age restrictions in The Netherlands, which require individuals to be 16 or older to have a YouTube channel, his dream was postponed. Unknown to the option of altering the age details, he waited.
In 2022, during a stay in Pakistan, Ahad's cousin introduced him to the platform once again. In Pakistan, the minimum age to have a YouTube channel is 13, and with Ahad fitting the age bracket, he quickly established his presence. Abdul Ahad soon started creating content centered around Geography on his channel [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK].
== External Links ==
* [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
5553680eebe59b239f60abf42a50a985b2ea71d7
527
525
2023-08-12T08:59:13Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:OfficialEditzPK_Logo.jpg|thumb|right|300px|Logo of OfficialEditzPK.]]
'''Abdul Ahad''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: عبدل احد) is a Dutch-Pakistani Geotuber, best recognized for his YouTube channel, '''OfficialEditzPK'''. As of the latest records, he has around 4k subscribers and has accumulated over 2.1 million views.
== Early Life ==
Abdul Ahad was born on 13 June 2009 in [https://en.wikipedia.org/wiki/Rotterdam Rotterdam], [https://en.wikipedia.org/wiki/Netherlands Netherlands]. He lives in both Rotterdam and Haripur, Pakistan. Ahad candidly mentioned that in the earlier parts of his life, he felt challenged in many endeavors but found his niche as a proficient designer. He is a supporter of [https://en.wikipedia.org/wiki/Pakistan_Tehreek-e-Insaf Pakistan Tehreek-e-Insaf] and its chairman, [https://en.wikipedia.org/wiki/Imran_Khan Imran Khan].
== YouTube Career ==
Ahad recalls aspiring to have a YouTube channel when he was just 8 years old. However, due to the age restrictions in The Netherlands, which require individuals to be 16 or older to have a YouTube channel, his dream was postponed. Unknown to the option of altering the age details, he waited.
In 2022, during a stay in Pakistan, Ahad's cousin introduced him to the platform once again. In Pakistan, the minimum age to have a YouTube channel is 13, and with Ahad fitting the age bracket, he quickly established his presence. Abdul Ahad soon started creating content centered around Geography on his channel [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK].
== External Links ==
* [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK on YouTube]
* [https://socialblade.com/youtube/channel/UCX8FVxenRNAR027kRPhO-eg OfficialEditzPK on Social Blade]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
3163ec3d7ae25e9f2ad7739303ff002a868a47c2
551
527
2023-08-12T15:35:10Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:OfficialEditzPK_Logo.jpg|thumb|right|300px|Logo of OfficialEditzPK.]]
'''Abdul Ahad''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: عبدل احد) is a Dutch-Pakistani Geotuber, best recognized for his YouTube channel, '''OfficialEditzPK'''. As of the latest records, he has around 4k subscribers and has accumulated over 2.1 million views.
== Early Life ==
Abdul Ahad was born on 13 June 2009 in [https://en.wikipedia.org/wiki/Rotterdam Rotterdam], [https://en.wikipedia.org/wiki/Netherlands Netherlands]. He lives in both Rotterdam and Haripur, Pakistan. Ahad candidly mentioned that in the earlier parts of his life, he felt challenged in many endeavors but found his niche as a proficient designer. He is a supporter of [https://en.wikipedia.org/wiki/Pakistan_Tehreek-e-Insaf Pakistan Tehreek-e-Insaf] and its chairman, [https://en.wikipedia.org/wiki/Imran_Khan Imran Khan].
== YouTube Career ==
Ahad recalls aspiring to have a YouTube channel when he was just 8 years old. However, due to the age restrictions in The Netherlands, which require individuals to be 16 or older to have a YouTube channel, his dream was postponed. Unknown to the option of altering the age details, he waited.
In 2022, during a stay in Pakistan, Ahad's cousin introduced him to the platform once again. In Pakistan, the minimum age to have a YouTube channel is 13, and with Ahad fitting the age bracket, he quickly established his presence. Abdul Ahad soon started creating content centered around Geography on his channel [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK].
== External Links ==
* [https://www.youtube.com/@OfficialEditzPK/ OfficialEditzPK on YouTube]
* [https://socialblade.com/youtube/channel/UCX8FVxenRNAR027kRPhO-eg OfficialEditzPK on Social Blade]
* [https://twitter.com/OfficialEditzPK/ OfficialEditzPK on Twitter]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
bfead56508dc9d561bd1068094214f8dc679e7a1
Main Page
0
1
526
506
2023-08-12T08:54:56Z
InsaneX
2
/* Recent Changes */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content. Join our [https://discord.gg/aPXQ5ZMjH8 Discord Server] for more Information.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 12, 2023:''' [[OfficialEditzPK]] page was created!
* '''August 11, 2023:''' Geotubepedia was officially launched!
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
* '''August 10, 2023:''' Geotubepedia was created!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:Copyrights | Geotubpedia Copyrights]]
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Help Desk|Help Desk]]
a39537c4cad3edfd2e2f6b40bd696181c4287027
534
526
2023-08-12T13:49:35Z
InsaneX
2
/* Recent Changes */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content. Join our [https://discord.gg/aPXQ5ZMjH8 Discord Server] for more Information.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geography YouTube Channels]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 12, 2023:''' [[Glitch Editz]] page was created!
* '''August 12, 2023:''' [[OfficialEditzPK]] page was created!
* '''August 11, 2023:''' Geotubepedia was officially launched!
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:Copyrights | Geotubpedia Copyrights]]
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Help Desk|Help Desk]]
1734b3cc936092c8a8671f6de6e76ae6381de9e7
546
534
2023-08-12T15:07:27Z
InsaneX
2
/* Explore */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content. Join our [https://discord.gg/aPXQ5ZMjH8 Discord Server] for more Information.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geotubers]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 12, 2023:''' [[Glitch Editz]] page was created!
* '''August 12, 2023:''' [[OfficialEditzPK]] page was created!
* '''August 11, 2023:''' Geotubepedia was officially launched!
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
* '''August 10, 2023:''' [[Cartoonabad]] page was created!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:Copyrights | Geotubpedia Copyrights]]
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Help Desk|Help Desk]]
faadca397e06973c712eafd5bcf717ad089c5055
550
546
2023-08-12T15:16:38Z
InsaneX
2
/* Recent Changes */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content. Join our [https://discord.gg/aPXQ5ZMjH8 Discord Server] for more Information.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geotubers]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 12, 2023:''' [[Abdullah do it all]] page was created!
* '''August 12, 2023:''' [[Glitch Editz]] page was created!
* '''August 12, 2023:''' [[OfficialEditzPK]] page was created!
* '''August 11, 2023:''' Geotubepedia was officially launched!
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:Copyrights | Geotubpedia Copyrights]]
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Help Desk|Help Desk]]
a7cd6c89bad96727d9cbd22567e9baa3e02d86ed
File:Geotubpedia Logo.png
6
215
528
2023-08-12T09:23:35Z
InsaneX
2
Logo of Geotubepedia
wikitext
text/x-wiki
== Summary ==
Logo of Geotubepedia
e57af04e843447f762820aa45763c6709f932b5a
File:Geotubepedia Favicon.ico
6
216
529
2023-08-12T09:30:58Z
InsaneX
2
Favicon of Geotubepedia
wikitext
text/x-wiki
== Summary ==
Favicon of Geotubepedia
9c06ebb7e3990edeadf207506309f2bb9e679a54
Glitch Editz
0
217
530
2023-08-12T10:15:04Z
InsaneX
2
Created page with "'''Glitch Editz''' is an American Geotuber known for his videos on geography, history, politics, and military edits. As of the latest records, he has around 13.8k subscribers and has accumulated over 6.4 million views. == Personal Information == Glitch Editz was born on March 26, 2009, in Los Angeles, California, USA. He is currently 14 years old and still resides in Los Angeles. == YouTube Career == Glitch Editz launched his YouTube channel in January 2021, initially..."
wikitext
text/x-wiki
'''Glitch Editz''' is an American Geotuber known for his videos on geography, history, politics, and military edits. As of the latest records, he has around 13.8k subscribers and has accumulated over 6.4 million views.
== Personal Information ==
Glitch Editz was born on March 26, 2009, in Los Angeles, California, USA. He is currently 14 years old and still resides in Los Angeles.
== YouTube Career ==
Glitch Editz launched his YouTube channel in January 2021, initially focusing on content related to ''Minecraft'' on the Bedrock Edition, specifically within the Hive gaming server. He continued this theme until the channel reached 309 subscribers, after which he stopped uploading and deleted all of his content.
The channel remained inactive until he discovered geo-related content on YouTube shorts, which inspired him to shift his content focus. This led to the rebirth of his channel, and he began producing geography-based content on September 25, 2022. His wide-ranging content includes topics such as geography, history, politics, and military-themed edits.
When producing Nationalist Edits, Glitch Editz utilizes a range of software tools including CapCut, Picsart, and ibisPaint X, all on his iPad. For his "Country VS Country" edits, CapCut on the iPad is his tool of choice. For mapping-related content, he uses ibis Paint X and CapCut on his iPhone.
== Statistics ==
As of now, Glitch Editz's YouTube channel has amassed 13.8K subscribers and has garnered 6.4 million total views.
== External Links ==
* [https://www.youtube.com/c/GlitchEditz Glitch Editz on YouTube]
[[Category:Geotubers]]
84c2c0632894797f92651569229ba37a9d894141
532
530
2023-08-12T10:17:02Z
InsaneX
2
wikitext
text/x-wiki
'''Glitch Editz''' is an American Geotuber known for his videos on geography, history, politics, and military edits.
== Personal Information ==
Glitch Editz was born on March 26, 2009, in Los Angeles, California, USA. He is currently 14 years old and still resides in Los Angeles.
== YouTube Career ==
Glitch Editz launched his YouTube channel in January 2021, initially focusing on content related to ''Minecraft'' on the Bedrock Edition, specifically within the Hive gaming server. He continued this theme until the channel reached 309 subscribers, after which he stopped uploading and deleted all of his content.
The channel remained inactive until he discovered geo-related content on YouTube shorts, which inspired him to shift his content focus. This led to the rebirth of his channel, and he began producing geography-based content on September 25, 2022. His wide-ranging content includes topics such as geography, history, politics, and military-themed edits.
When producing Nationalist Edits, Glitch Editz utilizes a range of software tools including CapCut, Picsart, and ibisPaint X, all on his iPad. For his "Country VS Country" edits, CapCut on the iPad is his tool of choice. For mapping-related content, he uses ibis Paint X and CapCut on his iPhone.
== Statistics ==
As of now, Glitch Editz's YouTube channel has amassed 13.8K subscribers and has garnered 6.4 million total views.
== External Links ==
* [https://www.youtube.com/c/GlitchEditz Glitch Editz on YouTube]
[[Category:Geotubers]]
ef71623261aa19e95bb1b64daa10203276e20000
533
532
2023-08-12T10:17:30Z
InsaneX
2
wikitext
text/x-wiki
[[File:Glitch_Editz_Logo.jpg|thumb|300px|Logo of Glitch Editz.]]
'''Glitch Editz''' is an American Geotuber known for his videos on geography, history, politics, and military edits.
== Personal Information ==
Glitch Editz was born on March 26, 2009, in Los Angeles, California, USA. He is currently 14 years old and still resides in Los Angeles.
== YouTube Career ==
Glitch Editz launched his YouTube channel in January 2021, initially focusing on content related to ''Minecraft'' on the Bedrock Edition, specifically within the Hive gaming server. He continued this theme until the channel reached 309 subscribers, after which he stopped uploading and deleted all of his content.
The channel remained inactive until he discovered geo-related content on YouTube shorts, which inspired him to shift his content focus. This led to the rebirth of his channel, and he began producing geography-based content on September 25, 2022. His wide-ranging content includes topics such as geography, history, politics, and military-themed edits.
When producing Nationalist Edits, Glitch Editz utilizes a range of software tools including CapCut, Picsart, and ibisPaint X, all on his iPad. For his "Country VS Country" edits, CapCut on the iPad is his tool of choice. For mapping-related content, he uses ibis Paint X and CapCut on his iPhone.
== Statistics ==
As of now, Glitch Editz's YouTube channel has amassed 13.8K subscribers and has garnered 6.4 million total views.
== External Links ==
* [https://www.youtube.com/c/GlitchEditz Glitch Editz on YouTube]
[[Category:Geotubers]]
485e8355934b14791be18b4ea51d8e36f6eeec3c
535
533
2023-08-12T13:51:27Z
InsaneX
2
/* Personal Information */
wikitext
text/x-wiki
[[File:Glitch_Editz_Logo.jpg|thumb|300px|Logo of Glitch Editz.]]
'''Glitch Editz''' is an American Geotuber known for his videos on geography, history, politics, and military edits.
== Personal Information ==
Glitch Editz was born on March 26, 2009, in [https://en.wikipedia.org/wiki/Los_Angeles Los Angeles], [https://en.wikipedia.org/wiki/California California], [https://en.wikipedia.org/wiki/United_States USA]. He is currently 14 years old and still resides in Los Angeles.
== YouTube Career ==
Glitch Editz launched his YouTube channel in January 2021, initially focusing on content related to ''Minecraft'' on the Bedrock Edition, specifically within the Hive gaming server. He continued this theme until the channel reached 309 subscribers, after which he stopped uploading and deleted all of his content.
The channel remained inactive until he discovered geo-related content on YouTube shorts, which inspired him to shift his content focus. This led to the rebirth of his channel, and he began producing geography-based content on September 25, 2022. His wide-ranging content includes topics such as geography, history, politics, and military-themed edits.
When producing Nationalist Edits, Glitch Editz utilizes a range of software tools including CapCut, Picsart, and ibisPaint X, all on his iPad. For his "Country VS Country" edits, CapCut on the iPad is his tool of choice. For mapping-related content, he uses ibis Paint X and CapCut on his iPhone.
== Statistics ==
As of now, Glitch Editz's YouTube channel has amassed 13.8K subscribers and has garnered 6.4 million total views.
== External Links ==
* [https://www.youtube.com/c/GlitchEditz Glitch Editz on YouTube]
[[Category:Geotubers]]
e2a4be5cf0b4681a108146a4a3f21b548c641d7a
536
535
2023-08-12T13:51:42Z
InsaneX
2
/* Personal Information */
wikitext
text/x-wiki
[[File:Glitch_Editz_Logo.jpg|thumb|300px|Logo of Glitch Editz.]]
'''Glitch Editz''' is an American Geotuber known for his videos on geography, history, politics, and military edits.
== Personal Information ==
Glitch Editz was born on March 26, 2009, in [https://en.wikipedia.org/wiki/Los_Angeles Los Angeles], [https://en.wikipedia.org/wiki/California California], USA. He is currently 14 years old and still resides in Los Angeles.
== YouTube Career ==
Glitch Editz launched his YouTube channel in January 2021, initially focusing on content related to ''Minecraft'' on the Bedrock Edition, specifically within the Hive gaming server. He continued this theme until the channel reached 309 subscribers, after which he stopped uploading and deleted all of his content.
The channel remained inactive until he discovered geo-related content on YouTube shorts, which inspired him to shift his content focus. This led to the rebirth of his channel, and he began producing geography-based content on September 25, 2022. His wide-ranging content includes topics such as geography, history, politics, and military-themed edits.
When producing Nationalist Edits, Glitch Editz utilizes a range of software tools including CapCut, Picsart, and ibisPaint X, all on his iPad. For his "Country VS Country" edits, CapCut on the iPad is his tool of choice. For mapping-related content, he uses ibis Paint X and CapCut on his iPhone.
== Statistics ==
As of now, Glitch Editz's YouTube channel has amassed 13.8K subscribers and has garnered 6.4 million total views.
== External Links ==
* [https://www.youtube.com/c/GlitchEditz Glitch Editz on YouTube]
[[Category:Geotubers]]
804ed94b111e644d3b9fc46799ce388c9cb95c13
537
536
2023-08-12T13:53:48Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
[[File:Glitch_Editz_Logo.jpg|thumb|300px|Logo of Glitch Editz.]]
'''Glitch Editz''' is an American Geotuber known for his videos on geography, history, politics, and military edits.
== Personal Information ==
Glitch Editz was born on March 26, 2009, in [https://en.wikipedia.org/wiki/Los_Angeles Los Angeles], [https://en.wikipedia.org/wiki/California California], USA. He is currently 14 years old and still resides in Los Angeles.
== YouTube Career ==
Glitch Editz launched his YouTube channel in January 2021, initially focusing on content related to ''Minecraft'' on the Bedrock Edition, specifically within the Hive gaming server. He continued this theme until the channel reached 309 subscribers, after which he stopped uploading and deleted all of his content.
The channel remained inactive until he discovered geo-related content on [https://en.wikipedia.org/wiki/YouTube_Shorts YouTube Shorts], which inspired him to shift his content focus. This led to the rebirth of his channel, and he began producing geography-based content on September 25, 2022. His wide-ranging content includes topics such as geography, history, politics, and military-themed edits.
When producing Nationalist Edits, Glitch Editz utilizes a range of software tools including CapCut, Picsart, and ibisPaint X, all on his iPad. For his "Country VS Country" edits, CapCut on the iPad is his tool of choice. For mapping-related content, he uses ibis Paint X and CapCut on his iPhone.
== Statistics ==
As of now, Glitch Editz's YouTube channel has amassed 13.8K subscribers and has garnered 6.4 million total views.
== External Links ==
* [https://www.youtube.com/c/GlitchEditz Glitch Editz on YouTube]
[[Category:Geotubers]]
6864554f96dd3baef99914129facf5685adec259
538
537
2023-08-12T13:55:45Z
InsaneX
2
wikitext
text/x-wiki
[[File:Glitch_Editz_Logo.jpg|thumb|300px|Logo of Glitch Editz.]]
'''Glitch Editz''' is a well known American Geotuber known for his videos on geography, history, politics, and military edits.
== Personal Information ==
Glitch Editz was born on March 26, 2009, in [https://en.wikipedia.org/wiki/Los_Angeles Los Angeles], [https://en.wikipedia.org/wiki/California California], USA. He is currently 14 years old and still resides in Los Angeles.
== YouTube Career ==
Glitch Editz launched his YouTube channel in January 2021, initially focusing on content related to ''Minecraft'' on the Bedrock Edition, specifically within the Hive gaming server. He continued this theme until the channel reached 309 subscribers, after which he stopped uploading and deleted all of his content.
The channel remained inactive until he discovered geo-related content on [https://en.wikipedia.org/wiki/YouTube_Shorts YouTube Shorts], which inspired him to shift his content focus. This led to the rebirth of his channel, and he began producing geography-based content on September 25, 2022. His wide-ranging content includes topics such as geography, history, politics, and military-themed edits.
When producing Nationalist Edits, Glitch Editz utilizes a range of software tools including CapCut, Picsart, and ibisPaint X, all on his iPad. For his "Country VS Country" edits, CapCut on the iPad is his tool of choice. For mapping-related content, he uses ibis Paint X and CapCut on his iPhone.
== Statistics ==
As of now, Glitch Editz's YouTube channel has amassed 13.8K subscribers and has garnered 6.4 million total views.
== External Links ==
* [https://www.youtube.com/c/GlitchEditz Glitch Editz on YouTube]
[[Category:Geotubers]]
09986f32acc7207fa2c4a9afbcecdd511bdc5217
547
538
2023-08-12T15:08:14Z
InsaneX
2
wikitext
text/x-wiki
[[File:Glitch_Editz_Logo.jpg|thumb|300px|Logo of Glitch Editz.]]
'''Glitch Editz''' is a well known American Geotuber known for his videos on geography, history, politics, and military edits.
== Personal Information ==
Glitch Editz was born on March 26, 2009, in [https://en.wikipedia.org/wiki/Los_Angeles Los Angeles], [https://en.wikipedia.org/wiki/California California], USA. He is currently 14 years old and still resides in Los Angeles.
== YouTube Career ==
Glitch Editz launched his YouTube channel in January 2021, initially focusing on content related to ''Minecraft'' on the Bedrock Edition, specifically within the Hive gaming server. He continued this theme until the channel reached 309 subscribers, after which he stopped uploading and deleted all of his content.
The channel remained inactive until he discovered geo-related content on [https://en.wikipedia.org/wiki/YouTube_Shorts YouTube Shorts], which inspired him to shift his content focus. This led to the rebirth of his channel, and he began producing geography-based content on September 25, 2022. His wide-ranging content includes topics such as geography, history, politics, and military-themed edits.
When producing Nationalist Edits, Glitch Editz utilizes a range of software tools including CapCut, Picsart, and ibisPaint X, all on his iPad. For his "Country VS Country" edits, CapCut on the iPad is his tool of choice. For mapping-related content, he uses ibis Paint X and CapCut on his iPhone.
== Statistics ==
As of now, Glitch Editz's YouTube channel has amassed 13.8K subscribers and has garnered 6.4 million total views.
== External Links ==
* [https://www.youtube.com/c/GlitchEditz Glitch Editz on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
6033d12dca5d7281d5de28944e956040a1cc5c0e
555
547
2023-08-12T16:42:40Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:Glitch_Editz_Logo.jpg|thumb|300px|Logo of Glitch Editz.]]
'''Glitch Editz''' is a well known American Geotuber known for his videos on geography, history, politics, and military edits.
== Personal Information ==
Glitch Editz was born on March 26, 2009, in [https://en.wikipedia.org/wiki/Los_Angeles Los Angeles], [https://en.wikipedia.org/wiki/California California], USA. He is currently 14 years old and still resides in Los Angeles.
== YouTube Career ==
Glitch Editz launched his YouTube channel in January 2021, initially focusing on content related to ''Minecraft'' on the Bedrock Edition, specifically within the Hive gaming server. He continued this theme until the channel reached 309 subscribers, after which he stopped uploading and deleted all of his content.
The channel remained inactive until he discovered geo-related content on [https://en.wikipedia.org/wiki/YouTube_Shorts YouTube Shorts], which inspired him to shift his content focus. This led to the rebirth of his channel, and he began producing geography-based content on September 25, 2022. His wide-ranging content includes topics such as geography, history, politics, and military-themed edits.
When producing Nationalist Edits, Glitch Editz utilizes a range of software tools including CapCut, Picsart, and ibisPaint X, all on his iPad. For his "Country VS Country" edits, CapCut on the iPad is his tool of choice. For mapping-related content, he uses ibis Paint X and CapCut on his iPhone.
== Statistics ==
As of now, Glitch Editz's YouTube channel has amassed 13.8K subscribers and has garnered 6.4 million total views.
== External Links ==
* [https://www.youtube.com/@glitch_editz/ Glitch Editz on YouTube]
* [https://www.tiktok.com/@zglitch_editz Glitch Editz on TikTok]
* [https://open.spotify.com/user/hwuokva73rytudbtu5sqra0k1 Glitch Editz on Spotify]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
2a775914fa8e84c59966ecd0e73186ec4b491f28
556
555
2023-08-12T17:11:51Z
InsaneX
2
wikitext
text/x-wiki
[[File:Glitch_Editz_Logo.jpg|thumb|300px|Logo of Glitch Editz.]]
'''Glitch Editz''' is a well known American Geotuber known for his videos on geography, history, politics, and military edits.
== Personal Information ==
Glitch Editz was born on 2009, in [https://en.wikipedia.org/wiki/Los_Angeles Los Angeles], [https://en.wikipedia.org/wiki/California California], USA. He is currently 14 years old and still resides in Los Angeles.
== YouTube Career ==
Glitch Editz launched his YouTube channel in January 2021, initially focusing on content related to ''Minecraft'' on the Bedrock Edition, specifically within the Hive gaming server. He continued this theme until the channel reached 309 subscribers, after which he stopped uploading and deleted all of his content.
The channel remained inactive until he discovered geo-related content on [https://en.wikipedia.org/wiki/YouTube_Shorts YouTube Shorts], which inspired him to shift his content focus. This led to the rebirth of his channel, and he began producing geography-based content on September 25, 2022. His wide-ranging content includes topics such as geography, history, politics, and military-themed edits.
When producing Nationalist Edits, Glitch Editz utilizes a range of software tools including CapCut, Picsart, and ibisPaint X, all on his iPad. For his "Country VS Country" edits, CapCut on the iPad is his tool of choice. For mapping-related content, he uses ibis Paint X and CapCut on his iPhone.
== Statistics ==
As of now, Glitch Editz's YouTube channel has amassed 13.8K subscribers and has garnered 6.4 million total views.
== External Links ==
* [https://www.youtube.com/@glitch_editz/ Glitch Editz on YouTube]
* [https://www.tiktok.com/@zglitch_editz Glitch Editz on TikTok]
* [https://open.spotify.com/user/hwuokva73rytudbtu5sqra0k1 Glitch Editz on Spotify]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
c86c3f6dc3cc6c5f0e2814362d9eec610080ab31
File:Glitch Editz Logo.jpg
6
218
531
2023-08-12T10:16:32Z
InsaneX
2
Logo of Glitch Editz
wikitext
text/x-wiki
== Summary ==
Logo of Glitch Editz
67389f55322e769f46ba6e6236154bd1fe91ec30
Abdullah do it all
0
219
539
2023-08-12T14:41:46Z
InsaneX
2
Created page with "'''Muhammad Abdullah Bin Nasir''' is a Bahraini Pakistani teenager known for his YouTube channel, "Abdullah do it all." Born and residing in Lahore, Pakistan, Abdullah has gained significant attention in the "Geo Community" for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits. ==Early Life== Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various s..."
wikitext
text/x-wiki
'''Muhammad Abdullah Bin Nasir''' is a Bahraini Pakistani teenager known for his YouTube channel, "Abdullah do it all." Born and residing in Lahore, Pakistan, Abdullah has gained significant attention in the "Geo Community" for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of Islam, and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on YouTube started in 2018 with the channel primarily focused on gaming content, especially around the game "Geometry Dash." Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber "World.military.king1," Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software Capcut to Alight Motion in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* Adobe After Effects
* Adobe Premiere Pro
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the Pakistan Youtube Shorts Editors Club (P.Y.S.E.C) alliance, further emphasizing his influence and commitment to the Geotuber community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
5878aa2b0fd0e43ac3b8936281384d533cd66200
540
539
2023-08-12T14:42:20Z
InsaneX
2
wikitext
text/x-wiki
'''Muhammad Abdullah Bin Nasir''' is a Bahraini Pakistani teenager known for his YouTube channel, '''Abdullah do it all'''. Born and residing in Lahore, Pakistan, Abdullah has gained significant attention in the "Geo Community" for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of Islam, and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on YouTube started in 2018 with the channel primarily focused on gaming content, especially around the game "Geometry Dash." Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber "World.military.king1," Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software Capcut to Alight Motion in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* Adobe After Effects
* Adobe Premiere Pro
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the Pakistan Youtube Shorts Editors Club (P.Y.S.E.C) alliance, further emphasizing his influence and commitment to the Geotuber community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
600ecd253024fe34e5448f84ed6b93cda1b5094f
541
540
2023-08-12T14:43:01Z
InsaneX
2
wikitext
text/x-wiki
'''Muhammad Abdullah Bin Nasir''' is a Bahraini Pakistani teenager known for his YouTube channel, '''Abdullah do it all'''. Born and residing in Lahore, Pakistan, Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of Islam, and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on YouTube started in 2018 with the channel primarily focused on gaming content, especially around the game "Geometry Dash." Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber "World.military.king1," Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software Capcut to Alight Motion in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* Adobe After Effects
* Adobe Premiere Pro
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the Pakistan Youtube Shorts Editors Club (P.Y.S.E.C) alliance, further emphasizing his influence and commitment to the Geotuber community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
c6f5d262bdb561e434f9eb57665e34467dec6488
542
541
2023-08-12T15:02:37Z
InsaneX
2
wikitext
text/x-wiki
'''Muhammad Abdullah Bin Nasir''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: محمد عبداللہ بن ناصر) is a Bahraini Pakistani teenager known for his YouTube channel, '''Abdullah do it all'''. Born and residing in [https://en.wikipedia.org/wiki/Lahore Lahore], [https://en.wikipedia.org/wiki/Pakistan Pakistan], Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [https://en.wikipedia.org/wiki/Islam Islam], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on YouTube started in 2018 with the channel primarily focused on gaming content, especially around the game [https://en.wikipedia.org/wiki/Geometry_Dash Geometry Dash]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber "World.military.king1", Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software Capcut to Alight Motion in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* Adobe After Effects
* Adobe Premiere Pro
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the Pakistan Youtube Shorts Editors Club (P.Y.S.E.C) alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
0b38ba6d94703dca4cbf85abc1b42126b940bc33
545
542
2023-08-12T15:06:40Z
InsaneX
2
wikitext
text/x-wiki
[[File:AbdullahDoItAll_Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Bin Nasir''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: محمد عبداللہ بن ناصر) is a Bahraini Pakistani teenager known for his YouTube channel, '''Abdullah do it all'''. Born and residing in [https://en.wikipedia.org/wiki/Lahore Lahore], [https://en.wikipedia.org/wiki/Pakistan Pakistan], Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [https://en.wikipedia.org/wiki/Islam Islam], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on YouTube started in 2018 with the channel primarily focused on gaming content, especially around the game [https://en.wikipedia.org/wiki/Geometry_Dash Geometry Dash]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber "World.military.king1", Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software Capcut to Alight Motion in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* Adobe After Effects
* Adobe Premiere Pro
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the Pakistan Youtube Shorts Editors Club (P.Y.S.E.C) alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
a6dddef14c8e76c0128b2ab5c5798d6eed23f227
549
545
2023-08-12T15:10:34Z
InsaneX
2
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Bin Nasir''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: محمد عبداللہ بن ناصر) is a Bahraini Pakistani teenager known for his YouTube channel, '''Abdullah do it all'''. Born and residing in [https://en.wikipedia.org/wiki/Lahore Lahore], [https://en.wikipedia.org/wiki/Pakistan Pakistan], Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [https://en.wikipedia.org/wiki/Islam Islam], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on YouTube started in 2018 with the channel primarily focused on gaming content, especially around the game [https://en.wikipedia.org/wiki/Geometry_Dash Geometry Dash]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber "World.military.king1", Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software Capcut to Alight Motion in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* Adobe After Effects
* Adobe Premiere Pro
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the Pakistan Youtube Shorts Editors Club (P.Y.S.E.C) alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
f0350b1f8c50f9a44209afe5698e8f4df0a16151
File:AbdullahDoItAll-Logo.jpg
6
222
548
2023-08-12T15:09:29Z
InsaneX
2
Logo of Abdullah do it all.
wikitext
text/x-wiki
== Summary ==
Logo of Abdullah do it all.
42b698bcb0650250c664397a03d2aedf29049172
Cartoonabad
0
169
552
510
2023-08-12T15:42:52Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [https://en.wikipedia.org/wiki/Hindi Hindi]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube] (Main channel)
* [https://www.youtube.com/@Cartoonabad Cartoonabad (second channel) on YouTube]
* [https://www.youtube.com/@Cartoonabad_OG Cartoonabad (third channel) on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
8f87fe226860e27cbc24fd50d503b59bd47efb9a
553
552
2023-08-12T15:43:09Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [https://en.wikipedia.org/wiki/Hindi Hindi]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.youtube.com/@Cartoonabad Cartoonabad (second channel) on YouTube]
* [https://www.youtube.com/@Cartoonabad_OG Cartoonabad (third channel) on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
82283c74acb0f434e8696ab4483de580babc02b2
554
553
2023-08-12T15:43:22Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [https://en.wikipedia.org/wiki/Hindi Hindi]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.youtube.com/@Cartoonabad Cartoonabad (Second channel) on YouTube]
* [https://www.youtube.com/@Cartoonabad_OG Cartoonabad (Third channel) on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
43bd2c011f8b4f532754d95875ed4ee0fd64d579
Your Average Norwegian Viking
0
223
557
2023-08-12T17:14:09Z
InsaneX
2
Created page with "'''Oliver Edwards''' is a Norwegian-American Geotuber, popularly known as '''Your Average Norwegian Viking''' on YouTube, renowned for his geographical content. Born in [https://en.wikipedia.org/wiki/Oslo Oslo], [https://en.wikipedia.org/wiki/Norway Norway], on March 25th, 2010, Edwards, under his alias ''Your Average Norwegian Viking'', has swiftly risen to prominence within the Geo Community. ==Early Life== Oliver Edwards was born in [https://en.wikipedia.org/wiki/Osl..."
wikitext
text/x-wiki
'''Oliver Edwards''' is a Norwegian-American Geotuber, popularly known as '''Your Average Norwegian Viking''' on YouTube, renowned for his geographical content. Born in [https://en.wikipedia.org/wiki/Oslo Oslo], [https://en.wikipedia.org/wiki/Norway Norway], on March 25th, 2010, Edwards, under his alias ''Your Average Norwegian Viking'', has swiftly risen to prominence within the Geo Community.
==Early Life==
Oliver Edwards was born in [https://en.wikipedia.org/wiki/Oslo Oslo], where he continues to reside. During his younger years, he developed a deep passion for soccer, editing, memes, songs, and dubbing. These diverse interests, combined with his multicultural Norwegian-American background, played a foundational role in shaping his YouTube journey.
==YouTube Career==
Edwards' foray into YouTube was primarily inspired by fellow Geotubers and friends he made on Discord. Initially, under his moniker "Your Average Norwegian Viking", he embarked on a journey to produce meme content, dub songs into various languages, and engage in other creative projects. These endeavors garnered a substantial amount of attention and built a foundation for his content creation skills.
However, as his journey progressed, Edwards pivoted his focus solely to geotubing. This shift towards geographical content reflects his evolving passions and the desire to create educational content for his audience. Today, his channel stands as a testament to his dedication and expertise in the realm of geography.
==Editing Tools==
Oliver Edwards employs a mix of software tools to bring his visions to life:
* '''Capcut''': Used primarily for general edits.
* '''Alight Motion''': The go-to tool for map edits and animations.
* '''ibis Paint X''' and '''PicsArt''': Utilized for creating and editing pictures that feature in his videos.
==External Links==
* [https://www.youtube.com/@brownie3478 Your Average Norwegian Viking on YouTube]
991250500595096a52715a417d74b5c630710bf8
559
557
2023-08-12T17:16:44Z
InsaneX
2
wikitext
text/x-wiki
'''Oliver Edwards''' is a Norwegian-American Geotuber, known as '''Your Average Norwegian Viking''' on YouTube, renowned for his geographical content. Born in [https://en.wikipedia.org/wiki/Oslo Oslo], [https://en.wikipedia.org/wiki/Norway Norway], on March 25th, 2010, Edwards, under his alias ''Your Average Norwegian Viking'', has swiftly risen to prominence within the Geo Community.
==Early Life==
Oliver Edwards was born in [https://en.wikipedia.org/wiki/Oslo Oslo], where he continues to reside. During his younger years, he developed a deep passion for soccer, editing, memes, songs, and dubbing. These diverse interests, combined with his multicultural Norwegian-American background, played a foundational role in shaping his YouTube journey.
==YouTube Career==
Edwards' foray into YouTube was primarily inspired by fellow Geotubers and friends he made on Discord. Initially, under his moniker "Your Average Norwegian Viking", he embarked on a journey to produce meme content, dub songs into various languages, and engage in other creative projects. These endeavors garnered a substantial amount of attention and built a foundation for his content creation skills.
However, as his journey progressed, Edwards pivoted his focus solely to geotubing. This shift towards geographical content reflects his evolving passions and the desire to create educational content for his audience. Today, his channel stands as a testament to his dedication and expertise in the realm of geography.
==Editing Tools==
Oliver Edwards employs a mix of software tools to bring his visions to life:
* '''Capcut''': Used primarily for general edits.
* '''Alight Motion''': The go-to tool for map edits and animations.
* '''ibis Paint X''' and '''PicsArt''': Utilized for creating and editing pictures that feature in his videos.
==External Links==
* [https://www.youtube.com/@brownie3478 Your Average Norwegian Viking on YouTube]
3514c835be7cb32d0ef6729d1494e4f921e4d9ac
560
559
2023-08-12T17:17:11Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
'''Oliver Edwards''' is a Norwegian-American Geotuber, known as '''Your Average Norwegian Viking''' on YouTube, renowned for his geographical content. Born in [https://en.wikipedia.org/wiki/Oslo Oslo], [https://en.wikipedia.org/wiki/Norway Norway], on March 25th, 2010, Edwards, under his alias ''Your Average Norwegian Viking'', has swiftly risen to prominence within the Geo Community.
==Early Life==
Oliver Edwards was born in [https://en.wikipedia.org/wiki/Oslo Oslo], where he continues to reside. During his younger years, he developed a deep passion for soccer, editing, memes, songs, and dubbing. These diverse interests, combined with his multicultural Norwegian-American background, played a foundational role in shaping his YouTube journey.
==YouTube Career==
Edwards' foray into YouTube was primarily inspired by fellow Geotubers and friends he made on Discord. Initially, under his moniker ''Your Average Norwegian Viking'', he embarked on a journey to produce meme content, dub songs into various languages, and engage in other creative projects. These endeavors garnered a substantial amount of attention and built a foundation for his content creation skills.
However, as his journey progressed, Edwards pivoted his focus solely to geotubing. This shift towards geographical content reflects his evolving passions and the desire to create educational content for his audience. Today, his channel stands as a testament to his dedication and expertise in the realm of geography.
==Editing Tools==
Oliver Edwards employs a mix of software tools to bring his visions to life:
* '''Capcut''': Used primarily for general edits.
* '''Alight Motion''': The go-to tool for map edits and animations.
* '''ibis Paint X''' and '''PicsArt''': Utilized for creating and editing pictures that feature in his videos.
==External Links==
* [https://www.youtube.com/@brownie3478 Your Average Norwegian Viking on YouTube]
be7e175e2ca1ff9698447556269b56b5f89c5bd4
561
560
2023-08-12T17:18:08Z
InsaneX
2
wikitext
text/x-wiki
[[File:Your_Average_Norwegian_Viking_Logo.jpg|thumb|300px|Logo of Your Average Norwegian Viking.]]
'''Oliver Edwards''' is a Norwegian-American Geotuber, known as '''Your Average Norwegian Viking''' on YouTube, renowned for his geographical content. Born in [https://en.wikipedia.org/wiki/Oslo Oslo], [https://en.wikipedia.org/wiki/Norway Norway], on March 25th, 2010, Edwards, under his alias ''Your Average Norwegian Viking'', has swiftly risen to prominence within the Geo Community.
==Early Life==
Oliver Edwards was born in [https://en.wikipedia.org/wiki/Oslo Oslo], where he continues to reside. During his younger years, he developed a deep passion for soccer, editing, memes, songs, and dubbing. These diverse interests, combined with his multicultural Norwegian-American background, played a foundational role in shaping his YouTube journey.
==YouTube Career==
Edwards' foray into YouTube was primarily inspired by fellow Geotubers and friends he made on Discord. Initially, under his moniker ''Your Average Norwegian Viking'', he embarked on a journey to produce meme content, dub songs into various languages, and engage in other creative projects. These endeavors garnered a substantial amount of attention and built a foundation for his content creation skills.
However, as his journey progressed, Edwards pivoted his focus solely to geotubing. This shift towards geographical content reflects his evolving passions and the desire to create educational content for his audience. Today, his channel stands as a testament to his dedication and expertise in the realm of geography.
==Editing Tools==
Oliver Edwards employs a mix of software tools to bring his visions to life:
* '''Capcut''': Used primarily for general edits.
* '''Alight Motion''': The go-to tool for map edits and animations.
* '''ibis Paint X''' and '''PicsArt''': Utilized for creating and editing pictures that feature in his videos.
==External Links==
* [https://www.youtube.com/@brownie3478 Your Average Norwegian Viking on YouTube]
ed618d878e82ddc294467201d53f3f599643930b
562
561
2023-08-12T17:23:38Z
InsaneX
2
wikitext
text/x-wiki
[[File:Your_Average_Norwegian_Viking_Logo.jpg|thumb|300px|Logo of Your Average Norwegian Viking.]]
'''Your Average Norwegian Viking''' is a Norwegian-American Geotuber, renowned for his geographical content. Born in [https://en.wikipedia.org/wiki/Oslo Oslo], [https://en.wikipedia.org/wiki/Norway Norway], on March 25th, 2010, Edwards, under his alias ''Your Average Norwegian Viking'', has swiftly risen to prominence within the Geo Community.
==Early Life==
Oliver Edwards was born in [https://en.wikipedia.org/wiki/Oslo Oslo], where he continues to reside. During his younger years, he developed a deep passion for soccer, editing, memes, songs, and dubbing. These diverse interests, combined with his multicultural Norwegian-American background, played a foundational role in shaping his YouTube journey.
==YouTube Career==
Edwards' foray into YouTube was primarily inspired by fellow Geotubers and friends he made on Discord. Initially, under his moniker ''Your Average Norwegian Viking'', he embarked on a journey to produce meme content, dub songs into various languages, and engage in other creative projects. These endeavors garnered a substantial amount of attention and built a foundation for his content creation skills.
However, as his journey progressed, Edwards pivoted his focus solely to geotubing. This shift towards geographical content reflects his evolving passions and the desire to create educational content for his audience. Today, his channel stands as a testament to his dedication and expertise in the realm of geography.
==Editing Tools==
Oliver Edwards employs a mix of software tools to bring his visions to life:
* '''Capcut''': Used primarily for general edits.
* '''Alight Motion''': The go-to tool for map edits and animations.
* '''ibis Paint X''' and '''PicsArt''': Utilized for creating and editing pictures that feature in his videos.
==External Links==
* [https://www.youtube.com/@brownie3478 Your Average Norwegian Viking on YouTube]
3710bfaad13c3c42f1e2e0d3c68d4148606588a4
File:Your Average Norwegian Viking Logo.jpg
6
224
558
2023-08-12T17:15:45Z
InsaneX
2
Logo of Your Average Norwegian Viking
wikitext
text/x-wiki
== Summary ==
Logo of Your Average Norwegian Viking
ae86e08a203ee224e084a1688c322781f1d72812
User:That muslim kid
2
226
564
2023-08-12T18:35:03Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:That muslim kid
3
227
565
2023-08-12T18:35:03Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:Mr Édits]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 18:35, 12 August 2023
269d3ff9e1b55b6913fd13ca329b64f403d3a431
Mr Editz
0
228
566
2023-08-12T18:39:41Z
That muslim kid
9
Created page with "Mr edits"
wikitext
text/x-wiki
Mr edits
95396d824ee34e3bfbc14db2272c59893dc37aac
567
566
2023-08-12T19:43:24Z
That muslim kid
9
small changes here and there
wikitext
text/x-wiki
== Basic info==
Muhammad Noumaan Subtain Ahmed Butt (Urdu:محمد نعمان سبطین احمد بٹ Arabic:محمد نعمان سبطين احمد بات) is a Saudi-born Pakistani GeoTuber, and Taekwondo enthusiast. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==''Early Life and Background''==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
=='''Content Creation and Taekwondo'''==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
=='''Education and Achievements'''==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
=='''Online Community and Contributions'''==
'''Noumaan is an active member of geo alliances like Pysec and IRpG. He shares his experiences and knowledge with fellow creators, contributing positively to the community. His close friendships with content creators like UmarEditz, Based Saudi Bangladeshi, and Master Pakistani Ball highlight his collaborative spirit.'''
=='''Geotubing and YouTube Journey'''==
Noumaan's interest in becoming a "Geotuber" was inspired by UmarEditz. Joining Pysec fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
1c93ff49880e1c53233a1c1439841578f2d7bc03
568
567
2023-08-13T06:54:20Z
InsaneX
2
/* Basic info */
wikitext
text/x-wiki
Muhammad Noumaan Subtain Ahmed Butt (Urdu:محمد نعمان سبطین احمد بٹ Arabic:محمد نعمان سبطين احمد بات) is a Saudi-born Pakistani GeoTuber, and Taekwondo enthusiast. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==''Early Life and Background''==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
=='''Content Creation and Taekwondo'''==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
=='''Education and Achievements'''==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
=='''Online Community and Contributions'''==
'''Noumaan is an active member of geo alliances like Pysec and IRpG. He shares his experiences and knowledge with fellow creators, contributing positively to the community. His close friendships with content creators like UmarEditz, Based Saudi Bangladeshi, and Master Pakistani Ball highlight his collaborative spirit.'''
=='''Geotubing and YouTube Journey'''==
Noumaan's interest in becoming a "Geotuber" was inspired by UmarEditz. Joining Pysec fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
c0bce303bf5243dd467c35bd88b9c2e15cb5d85d
569
568
2023-08-13T06:54:40Z
InsaneX
2
wikitext
text/x-wiki
Muhammad Noumaan Subtain Ahmed Butt (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-born Pakistani GeoTuber, and Taekwondo enthusiast. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==''Early Life and Background''==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
=='''Content Creation and Taekwondo'''==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
=='''Education and Achievements'''==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
=='''Online Community and Contributions'''==
'''Noumaan is an active member of geo alliances like Pysec and IRpG. He shares his experiences and knowledge with fellow creators, contributing positively to the community. His close friendships with content creators like UmarEditz, Based Saudi Bangladeshi, and Master Pakistani Ball highlight his collaborative spirit.'''
=='''Geotubing and YouTube Journey'''==
Noumaan's interest in becoming a "Geotuber" was inspired by UmarEditz. Joining Pysec fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
f77591d90c6547da5fc2d8e2a22d05a65dfd4706
570
569
2023-08-13T06:55:32Z
InsaneX
2
/* Early Life and Background */
wikitext
text/x-wiki
Muhammad Noumaan Subtain Ahmed Butt (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-born Pakistani GeoTuber, and Taekwondo enthusiast. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life and Background==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
=='''Content Creation and Taekwondo'''==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
=='''Education and Achievements'''==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
=='''Online Community and Contributions'''==
'''Noumaan is an active member of geo alliances like Pysec and IRpG. He shares his experiences and knowledge with fellow creators, contributing positively to the community. His close friendships with content creators like UmarEditz, Based Saudi Bangladeshi, and Master Pakistani Ball highlight his collaborative spirit.'''
=='''Geotubing and YouTube Journey'''==
Noumaan's interest in becoming a "Geotuber" was inspired by UmarEditz. Joining Pysec fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
2b828aea359038e4105cc218be925e80b6fdde44
571
570
2023-08-13T06:56:56Z
InsaneX
2
wikitext
text/x-wiki
Muhammad Noumaan Subtain Ahmed Butt (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-born Pakistani GeoTuber, and Taekwondo enthusiast. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life and Background==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Online Community and Contributions==
'''Noumaan is an active member of geo alliances like Pysec and IRpG. He shares his experiences and knowledge with fellow creators, contributing positively to the community. His close friendships with content creators like UmarEditz, Based Saudi Bangladeshi, and Master Pakistani Ball highlight his collaborative spirit.'''
==Geotubing and YouTube Journey==
Noumaan's interest in becoming a "Geotuber" was inspired by UmarEditz. Joining Pysec fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
62302a6f378d153ff70ca91a26fead1832f2a359
572
571
2023-08-13T06:57:13Z
InsaneX
2
wikitext
text/x-wiki
Muhammad Noumaan Subtain Ahmed Butt (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-Pakistani GeoTuber, and Taekwondo enthusiast. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life and Background==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Online Community and Contributions==
'''Noumaan is an active member of geo alliances like Pysec and IRpG. He shares his experiences and knowledge with fellow creators, contributing positively to the community. His close friendships with content creators like UmarEditz, Based Saudi Bangladeshi, and Master Pakistani Ball highlight his collaborative spirit.'''
==Geotubing and YouTube Journey==
Noumaan's interest in becoming a "Geotuber" was inspired by UmarEditz. Joining Pysec fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
ed5c52d2ca12db967c8a1419c9de0025a357b80a
573
572
2023-08-13T07:07:29Z
InsaneX
2
/* Online Community and Contributions */
wikitext
text/x-wiki
Muhammad Noumaan Subtain Ahmed Butt (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-Pakistani GeoTuber, and Taekwondo enthusiast. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life and Background==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Alliances==
Noumaan is an active member of the alliances ''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'' and ''Islamic Republic of Pakistan and Youtubers (I.R.P.G)''. He shares his experiences and knowledge with fellow creators, contributing positively to the community. Forming close friendships with content creators like [[Umar Edits]], Based Saudi Bangladeshi, and Master Pakistani Ball, he showcases his collaborative spirit.
==Geotubing and YouTube Journey==
Noumaan's interest in becoming a "Geotuber" was inspired by UmarEditz. Joining Pysec fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
f0d4e89b86eb1709a84886b39a2557fb4e858754
574
573
2023-08-13T07:09:29Z
InsaneX
2
/* Geotubing and YouTube Journey */
wikitext
text/x-wiki
Muhammad Noumaan Subtain Ahmed Butt (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-Pakistani GeoTuber, and Taekwondo enthusiast. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life and Background==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Alliances==
Noumaan is an active member of the alliances ''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'' and ''Islamic Republic of Pakistan and Youtubers (I.R.P.G)''. He shares his experiences and knowledge with fellow creators, contributing positively to the community. Forming close friendships with content creators like [[Umar Edits]], Based Saudi Bangladeshi, and Master Pakistani Ball, he showcases his collaborative spirit.
==Geotubing and YouTube Journey==
Noumaan's interest in becoming a Geotuber was inspired by Umar Edits. Joining P.Y.S.E.C fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
124a8ac1fcf44729a627cd2105f6a0747941e262
575
574
2023-08-13T07:09:50Z
InsaneX
2
/* Geotubing and YouTube Journey */
wikitext
text/x-wiki
Muhammad Noumaan Subtain Ahmed Butt (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-Pakistani GeoTuber, and Taekwondo enthusiast. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life and Background==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Alliances==
Noumaan is an active member of the alliances ''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'' and ''Islamic Republic of Pakistan and Youtubers (I.R.P.G)''. He shares his experiences and knowledge with fellow creators, contributing positively to the community. Forming close friendships with content creators like [[Umar Edits]], Based Saudi Bangladeshi, and Master Pakistani Ball, he showcases his collaborative spirit.
== YouTube Career ==
Noumaan's interest in becoming a Geotuber was inspired by Umar Edits. Joining P.Y.S.E.C fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
4430a4ecf25c1cd84e913b0be54d7b3919ea36ca
Mr Editz
0
228
576
575
2023-08-13T07:11:56Z
InsaneX
2
wikitext
text/x-wiki
'''Muhammad Noumaan Subtain Ahmed Butt''' (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-Pakistani GeoTuber, known for his YouTube channel '''Mr Edits'''. He is also an enthusiastic practitioner of Taekwondo. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life and Background==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Alliances==
Noumaan is an active member of the alliances ''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'' and ''Islamic Republic of Pakistan and Youtubers (I.R.P.G)''. He shares his experiences and knowledge with fellow creators, contributing positively to the community. Forming close friendships with content creators like [[Umar Edits]], Based Saudi Bangladeshi, and Master Pakistani Ball, he showcases his collaborative spirit.
== YouTube Career ==
Noumaan's interest in becoming a Geotuber was inspired by Umar Edits. Joining P.Y.S.E.C fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
42d03195c4494dca1bae838509109192ed7bf77c
577
576
2023-08-13T07:12:22Z
InsaneX
2
wikitext
text/x-wiki
'''Muhammad Noumaan Subtain Ahmed Butt''' (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-Pakistani GeoTuber, known for his YouTube channel '''Mr Edits'''. He is also an enthusiastic practitioner of Taekwondo. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life and Background==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Alliances==
Noumaan is an active member of the alliances ''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'' and ''Islamic Republic of Pakistan and Youtubers (I.R.P.G)''. He shares his experiences and knowledge with fellow creators, contributing positively to the community. Forming close friendships with content creators like [[Umar Edits]], Based Saudi Bangladeshi, and Master Pakistani Ball, he showcases his collaborative spirit.
== YouTube Career ==
Noumaan's interest in becoming a Geotuber was inspired by Umar Edits. Joining P.Y.S.E.C fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
== External links ==
f4acd6b3c950e5ecebfad26663d546052f0141ba
578
577
2023-08-13T07:12:32Z
InsaneX
2
/* Early Life and Background */
wikitext
text/x-wiki
'''Muhammad Noumaan Subtain Ahmed Butt''' (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-Pakistani GeoTuber, known for his YouTube channel '''Mr Edits'''. He is also an enthusiastic practitioner of Taekwondo. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Alliances==
Noumaan is an active member of the alliances ''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'' and ''Islamic Republic of Pakistan and Youtubers (I.R.P.G)''. He shares his experiences and knowledge with fellow creators, contributing positively to the community. Forming close friendships with content creators like [[Umar Edits]], Based Saudi Bangladeshi, and Master Pakistani Ball, he showcases his collaborative spirit.
== YouTube Career ==
Noumaan's interest in becoming a Geotuber was inspired by Umar Edits. Joining P.Y.S.E.C fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
== External links ==
69e0aaaa862ddcd4f39f691d76d24530dac304db
579
578
2023-08-13T07:13:06Z
InsaneX
2
/* External links */
wikitext
text/x-wiki
'''Muhammad Noumaan Subtain Ahmed Butt''' (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-Pakistani GeoTuber, known for his YouTube channel '''Mr Edits'''. He is also an enthusiastic practitioner of Taekwondo. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Alliances==
Noumaan is an active member of the alliances ''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'' and ''Islamic Republic of Pakistan and Youtubers (I.R.P.G)''. He shares his experiences and knowledge with fellow creators, contributing positively to the community. Forming close friendships with content creators like [[Umar Edits]], Based Saudi Bangladeshi, and Master Pakistani Ball, he showcases his collaborative spirit.
== YouTube Career ==
Noumaan's interest in becoming a Geotuber was inspired by Umar Edits. Joining P.Y.S.E.C fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
== External Links ==
84323861496149c3371eb4e4b18f0d74079174ef
580
579
2023-08-13T07:13:44Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
'''Muhammad Noumaan Subtain Ahmed Butt''' (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-Pakistani GeoTuber, known for his YouTube channel '''Mr Edits'''. He is also an enthusiastic practitioner of Taekwondo. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Alliances==
Noumaan is an active member of the alliances ''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'' and ''Islamic Republic of Pakistan and Youtubers (I.R.P.G)''. He shares his experiences and knowledge with fellow creators, contributing positively to the community. Forming close friendships with content creators like [[Umar Edits]], Based Saudi Bangladeshi, and Master Pakistani Ball, he showcases his collaborative spirit.
== YouTube Career ==
Noumaan's interest in becoming a Geotuber was inspired by Umar Edits. Joining P.Y.S.E.C fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
== External Links ==
* [https://www.youtube.com/@mr-Editz_ Mr Edits on YouTube]
368d4793dd46a95fdeed2cf05218436d091cb55d
581
580
2023-08-13T07:14:03Z
InsaneX
2
wikitext
text/x-wiki
'''Muhammad Noumaan Subtain Ahmed Butt''' (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-Pakistani Geotuber, known for his YouTube channel '''Mr Edits'''. He is also an enthusiastic practitioner of Taekwondo. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Alliances==
Noumaan is an active member of the alliances ''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'' and ''Islamic Republic of Pakistan and Youtubers (I.R.P.G)''. He shares his experiences and knowledge with fellow creators, contributing positively to the community. Forming close friendships with content creators like [[Umar Edits]], Based Saudi Bangladeshi, and Master Pakistani Ball, he showcases his collaborative spirit.
== YouTube Career ==
Noumaan's interest in becoming a Geotuber was inspired by Umar Edits. Joining P.Y.S.E.C fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
== External Links ==
* [https://www.youtube.com/@mr-Editz_ Mr Edits on YouTube]
1d589614374e8a971d76988f0156ec24b41e0203
583
581
2023-08-13T07:14:58Z
InsaneX
2
wikitext
text/x-wiki
'''Muhammad Noumaan Subtain Ahmed Butt''' (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-Pakistani Geotuber, known for his YouTube channel '''Mr Editz'''. He is also an enthusiastic practitioner of Taekwondo. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Alliances==
Noumaan is an active member of the alliances ''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'' and ''Islamic Republic of Pakistan and Youtubers (I.R.P.G)''. He shares his experiences and knowledge with fellow creators, contributing positively to the community. Forming close friendships with content creators like [[Umar Edits]], Based Saudi Bangladeshi, and Master Pakistani Ball, he showcases his collaborative spirit.
== YouTube Career ==
Noumaan's interest in becoming a Geotuber was inspired by Umar Edits. Joining P.Y.S.E.C fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
== External Links ==
* [https://www.youtube.com/@mr-Editz_ Mr Editz on YouTube]
4efd6c374ebc13a85800ccb41a0940e3a06f622a
584
583
2023-08-13T07:16:02Z
InsaneX
2
wikitext
text/x-wiki
[[File:Mr_Editz_Logo.jpg|thumb|300px|Logo of Mr Editz.]]
'''Muhammad Noumaan Subtain Ahmed Butt''' (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-Pakistani Geotuber, known for his YouTube channel '''Mr Editz'''. He is also an enthusiastic practitioner of Taekwondo. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Alliances==
Noumaan is an active member of the alliances ''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'' and ''Islamic Republic of Pakistan and Youtubers (I.R.P.G)''. He shares his experiences and knowledge with fellow creators, contributing positively to the community. Forming close friendships with content creators like [[Umar Edits]], Based Saudi Bangladeshi, and Master Pakistani Ball, he showcases his collaborative spirit.
== YouTube Career ==
Noumaan's interest in becoming a Geotuber was inspired by Umar Edits. Joining P.Y.S.E.C fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
== External Links ==
* [https://www.youtube.com/@mr-Editz_ Mr Editz on YouTube]
e964bf0ae1dfd85e3daf9a2e399074e99ef4a934
585
584
2023-08-13T07:16:32Z
InsaneX
2
wikitext
text/x-wiki
[[File:Mr_Editz_Logo.jpg|thumb|300px|Logo of Mr Editz.]]
'''Muhammad Noumaan Subtain Ahmed Butt''' (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-Pakistani Geotuber, known for his YouTube channel '''Mr Editz'''. He is also an enthusiastic practitioner of Taekwondo. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Alliances==
Noumaan is an active member of the alliances ''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'' and ''Islamic Republic of Pakistan and Youtubers (I.R.P.G)''. He shares his experiences and knowledge with fellow creators, contributing positively to the community. Forming close friendships with content creators like [[Umar Edits]], Based Saudi Bangladeshi, and Master Pakistani Ball, he showcases his collaborative spirit.
== YouTube Career ==
Noumaan's interest in becoming a Geotuber was inspired by Umar Edits. Joining P.Y.S.E.C fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
== External Links ==
* [https://www.youtube.com/@mr-Editz_ Mr Editz on YouTube]
[[Category:List of Geotubers]]
f884f2fbda9392967d720838e241d0790b032e58
586
585
2023-08-13T07:22:25Z
InsaneX
2
wikitext
text/x-wiki
[[File:Mr_Edits_Logo.jpg|thumb|300px|Logo of Mr Editz.]]
'''Muhammad Noumaan Subtain Ahmed Butt''' (Urdu:محمد نعمان سبطین احمد بٹ) is a Saudi-Pakistani Geotuber, known for his YouTube channel '''Mr Editz'''. He is also an enthusiastic practitioner of Taekwondo. Born on September 12, 2007, in Jeddah, Saudi Arabia, he is known for his editing skills and engaging content.
==Early Life==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to Lahore, Pakistan. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz Ul Quran School, where he completed his Nazra Quran with Tajveed. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Alliances==
Noumaan is an active member of the alliances ''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'' and ''Islamic Republic of Pakistan and Youtubers (I.R.P.G)''. He shares his experiences and knowledge with fellow creators, contributing positively to the community. Forming close friendships with content creators like [[Umar Edits]], Based Saudi Bangladeshi, and Master Pakistani Ball, he showcases his collaborative spirit.
== YouTube Career ==
Noumaan's interest in becoming a Geotuber was inspired by Umar Edits. Joining P.Y.S.E.C fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
== External Links ==
* [https://www.youtube.com/@mr-Editz_ Mr Editz on YouTube]
[[Category:List of Geotubers]]
2b73c6f7f7ed9f6883c75b92e1775bf26bccf77f
588
586
2023-08-13T07:34:16Z
InsaneX
2
wikitext
text/x-wiki
[[File:Mr_Edits_Logo.jpg|thumb|300px|Logo of Mr Editz.]]
'''Muhammad Noumaan Subtain Ahmed Butt''' ([https://en.wikipedia.org/wiki/Urdu Urdu]:محمد نعمان سبطین احمد بٹ) is a Saudi-Pakistani Geotuber, known for his YouTube channel '''Mr Editz'''. He is also an enthusiastic practitioner of [https://en.wikipedia.org/wiki/Taekwondo Taekwondo]. Born on September 12, 2007, in [https://en.wikipedia.org/wiki/Jeddah Jeddah], [https://en.wikipedia.org/wiki/Saudi_Arabia Saudi Arabia], he is known for his editing skills and engaging content.
==Early Life==
Noumaan was born in Jeddah, Saudi Arabia, and later moved to [https://en.wikipedia.org/wiki/Lahore Lahore], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. As the eldest sibling in his family, he developed a passion for video editing at an early age. His editing journey began on KineMaster, and he later transitioned to Capcut and currently uses Alight Motion.
==Content Creation and Taekwondo==
Noumaan's YouTube channel showcases his editing prowess and shares insights into his personal life. Apart from his online presence, he is also a Taekwondo practitioner, holding the rank of a White Belt and excelling in simple kicks. His dedication to both editing and Taekwondo demonstrates his versatility and commitment.
==Education and Achievements==
Noumaan's educational journey took him from schools in Saudi Arabia to Pakistan. He attended Talal School in Jeddah, Al Barakah School, PISJ, and Iqra Hifz-Ul-Quran School, where he completed his Nazra Quran with [https://en.wikipedia.org/wiki/Tajwid#:~:text=In%20Arabic%2C%20the%20term%20tajw%C4%ABd,colored%20letters%20to%20facilitate%20tajweed. Tajvid]. Later, he continued his education at Hassan Public School in Lahore, which played a significant role in shaping his character.
==Alliances==
Noumaan is an active member of the alliances ''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'' and ''Islamic Republic of Pakistan and Youtubers (I.R.P.G)''. He shares his experiences and knowledge with fellow creators, contributing positively to the community. Forming close friendships with content creators like [[Umar Edits]], Based Saudi Bangladeshi, and Master Pakistani Ball, he showcases his collaborative spirit.
== YouTube Career ==
Noumaan's interest in becoming a Geotuber was inspired by Umar Edits. Joining P.Y.S.E.C fueled his desire to enhance his content and skills, resulting in a remarkable growth of 180 subscribers and 20,000 views within a week. [https://www.youtube.com/@mr-Editz_ His YouTube channel], reflects his dedication and creative endeavors.
== External Links ==
* [https://www.youtube.com/@mr-Editz_ Mr Editz on YouTube]
[[Category:List of Geotubers]]
2140bdf2cf8a3c9efc7638322616ae873610102c
File:Mr Edits Logo.jpg
6
229
582
2023-08-13T07:14:26Z
InsaneX
2
Logo of Mr Edits.
wikitext
text/x-wiki
== Summary ==
Logo of Mr Edits.
d048ab402286f4abb903a6e1b82f93194a83f85d
Abdullah do it all
0
219
587
549
2023-08-13T07:29:04Z
InsaneX
2
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: محمد عبداللہ ناصر) is a Bahraini Pakistani teenager known for his YouTube channel, '''Abdullah do it all'''. Born and residing in [https://en.wikipedia.org/wiki/Lahore Lahore], [https://en.wikipedia.org/wiki/Pakistan Pakistan], Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [https://en.wikipedia.org/wiki/Islam Islam], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on YouTube started in 2018 with the channel primarily focused on gaming content, especially around the game [https://en.wikipedia.org/wiki/Geometry_Dash Geometry Dash]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber "World.military.king1", Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software Capcut to Alight Motion in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* Adobe After Effects
* Adobe Premiere Pro
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the Pakistan Youtube Shorts Editors Club (P.Y.S.E.C) alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
0364c339c4cd6804cd3a53b02ce115a69b477061
Braslezian
0
230
589
2023-08-13T07:48:55Z
InsaneX
2
Created page with "'''Braslezian''' is a Brazilian Geotuber known for his content primarily focused on comparing countries, empires, and other geographical elements. His work on YouTube began after being inspired by other creators in the Geotuber community, most notably The Cornunist. == Biography == Braslezian was born on October 1st, 2011, in [https://en.wikipedia.org/wiki/Brazil Brazil]. He discovered his passion for geography-related content on YouTube, which later drove him to create..."
wikitext
text/x-wiki
'''Braslezian''' is a Brazilian Geotuber known for his content primarily focused on comparing countries, empires, and other geographical elements. His work on YouTube began after being inspired by other creators in the Geotuber community, most notably The Cornunist.
== Biography ==
Braslezian was born on October 1st, 2011, in [https://en.wikipedia.org/wiki/Brazil Brazil]. He discovered his passion for geography-related content on YouTube, which later drove him to create his own videos.
== YouTube Career ==
Braslezian's journey into the world of Geotubing started when he began watching videos related to geography, countryball animations, and edits. One of the first channels that he watched using his account was ''Cornunist''. Influenced by the Cornunist's content, Braslezian produced his debut video. Over the course of his YouTube career, he has utilized software such as ''Capcut'' for most of his video edits. However, he occasionally experiments and makes edits with ''Adobe Premiere Pro''.
== Alliances ==
Braslezian is a part of the ''S.A.T.O'' and ''Nationalitia'' alliances within the Geo community.
== External Links ==
* [https://www.youtube.com/c/Braslezian Braslezian's YouTube Channel]
[[Category: List of Geotubers]]
01586d64abfe8c1be027150c27f8ae1d3cf3f092
590
589
2023-08-13T07:49:59Z
InsaneX
2
wikitext
text/x-wiki
'''Braslezian''' is a Brazilian Geotuber known for his content primarily focused on comparing countries, empires, and other geographical elements. His work on YouTube began after being inspired by other creators in the Geotuber community, most notably The Cornunist. As of August 13th, the channel boasts 524 subscribers and has accumulated over 134K views.
== Biography ==
Braslezian was born on October 1st, 2011, in [https://en.wikipedia.org/wiki/Brazil Brazil]. He discovered his passion for geography-related content on YouTube, which later drove him to create his own videos.
== YouTube Career ==
Braslezian's journey into the world of Geotubing started when he began watching videos related to geography, countryball animations, and edits. One of the first channels that he watched using his account was ''Cornunist''. Influenced by the Cornunist's content, Braslezian produced his debut video. Over the course of his YouTube career, he has utilized software such as ''Capcut'' for most of his video edits. However, he occasionally experiments and makes edits with ''Adobe Premiere Pro''.
== Alliances ==
Braslezian is a part of the ''S.A.T.O'' and ''Nationalitia'' alliances within the Geo community.
== External Links ==
* [https://www.youtube.com/c/Braslezian Braslezian's YouTube Channel]
[[Category: List of Geotubers]]
3cfa5e50fbcb756c1557d6d4003c706f86f3f33c
592
590
2023-08-13T07:51:41Z
InsaneX
2
wikitext
text/x-wiki
[[File:Braslezian_Logo.jpg|thumb|300px|Logo of Braslezian.]]
'''Braslezian''' is a Brazilian Geotuber known for his content primarily focused on comparing countries, empires, and other geographical elements. His work on YouTube began after being inspired by other creators in the Geotuber community, most notably The Cornunist. As of August 13th, the channel boasts 524 subscribers and has accumulated over 134K views.
== Biography ==
Braslezian was born on October 1st, 2011, in [https://en.wikipedia.org/wiki/Brazil Brazil]. He discovered his passion for geography-related content on YouTube, which later drove him to create his own videos.
== YouTube Career ==
Braslezian's journey into the world of Geotubing started when he began watching videos related to geography, countryball animations, and edits. One of the first channels that he watched using his account was ''Cornunist''. Influenced by the Cornunist's content, Braslezian produced his debut video. Over the course of his YouTube career, he has utilized software such as ''Capcut'' for most of his video edits. However, he occasionally experiments and makes edits with ''Adobe Premiere Pro''.
== Alliances ==
Braslezian is a part of the ''S.A.T.O'' and ''Nationalitia'' alliances within the Geo community.
== External Links ==
* [https://www.youtube.com/c/Braslezian Braslezian's YouTube Channel]
[[Category: List of Geotubers]]
4242a8207615d86f00d68f5ea0b33ec12e8f9612
605
592
2023-08-13T15:02:55Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:Braslezian_Logo.jpg|thumb|300px|Logo of Braslezian.]]
'''Braslezian''' is a Brazilian Geotuber known for his content primarily focused on comparing countries, empires, and other geographical elements. His work on YouTube began after being inspired by other creators in the Geotuber community, most notably The Cornunist. As of August 13th, the channel boasts 524 subscribers and has accumulated over 134K views.
== Biography ==
Braslezian was born on October 1st, 2011, in [https://en.wikipedia.org/wiki/Brazil Brazil]. He discovered his passion for geography-related content on YouTube, which later drove him to create his own videos.
== YouTube Career ==
Braslezian's journey into the world of Geotubing started when he began watching videos related to geography, countryball animations, and edits. One of the first channels that he watched using his account was ''Cornunist''. Influenced by the Cornunist's content, Braslezian produced his debut video. Over the course of his YouTube career, he has utilized software such as ''Capcut'' for most of his video edits. However, he occasionally experiments and makes edits with ''Adobe Premiere Pro''.
== Alliances ==
Braslezian is a part of the ''S.A.T.O'' and ''Nationalitia'' alliances within the Geo community.
== External Links ==
* [https://www.youtube.com/@Braslezian Braslezian's YouTube Channel]
[[Category: List of Geotubers]]
ca48b876a513ad083c5f2049736f534e2b03b559
606
605
2023-08-13T15:48:59Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:Braslezian_Logo.jpg|thumb|300px|Logo of Braslezian.]]
'''Braslezian''' is a Brazilian Geotuber known for his content primarily focused on comparing countries, empires, and other geographical elements. His work on YouTube began after being inspired by other creators in the Geotuber community, most notably The Cornunist. As of August 13th, the channel boasts 524 subscribers and has accumulated over 134K views.
== Biography ==
Braslezian was born on October 1st, 2011, in [https://en.wikipedia.org/wiki/Brazil Brazil]. He discovered his passion for geography-related content on YouTube, which later drove him to create his own videos.
== YouTube Career ==
Braslezian's journey into the world of Geotubing started when he began watching videos related to geography, countryball animations, and edits. One of the first channels that he watched using his account was ''Cornunist''. Influenced by the Cornunist's content, Braslezian produced his debut video. Over the course of his YouTube career, he has utilized software such as ''Capcut'' for most of his video edits. However, he occasionally experiments and makes edits with ''Adobe Premiere Pro''.
== Alliances ==
Braslezian is a part of the ''S.A.T.O'' and ''Nationalitia'' alliances within the Geo community.
== External Links ==
* [https://www.youtube.com/@Braslezian Braslezian on YouTube]
* [https://discord.gg/7W6x9JhAMs Braslezian's Discord Server]
[[Category: List of Geotubers]]
5e521b825f809511db790a0e319295b1252c8fa8
File:Braslezian Logo.jpg
6
231
591
2023-08-13T07:51:05Z
InsaneX
2
Logo of Braslezian.
wikitext
text/x-wiki
== Summary ==
Logo of Braslezian.
7eb395fbf7805b5eb1881fbb0f8e09d3d51ad3fc
File:Greatlake Editz Logo.jpg
6
232
593
2023-08-13T07:58:20Z
InsaneX
2
Logo of Greatlake Editz
wikitext
text/x-wiki
== Summary ==
Logo of Greatlake Editz
8f04702c47bcc6540a953ce8e5b0eaeb2ffb5e09
Greatlake Editz
0
233
594
2023-08-13T08:06:06Z
InsaneX
2
Created page with "[[File:Greatlake_Editz_Logo.jpg|thumb|300px|Logo of Greatlake Editz.]] '''Seth A. Mercier''' is a Italian-German Geotuber, known for his YouTube channel '''greatlake_editz''' based in Detroit, Michigan, USA. He has channeled his enthusiasm for geography into a burgeoning YouTube career. == Biography == Seth A. Mercier was born on January 8th, 2007, in Detroit, Michigan, USA. Though residing in the USA, he has German and Italian roots, which he proudly acknowledges. ==..."
wikitext
text/x-wiki
[[File:Greatlake_Editz_Logo.jpg|thumb|300px|Logo of Greatlake Editz.]]
'''Seth A. Mercier''' is a Italian-German Geotuber, known for his YouTube channel '''greatlake_editz''' based in Detroit, Michigan, USA. He has channeled his enthusiasm for geography into a burgeoning YouTube career.
== Biography ==
Seth A. Mercier was born on January 8th, 2007, in Detroit, Michigan, USA. Though residing in the USA, he has German and Italian roots, which he proudly acknowledges.
== YouTube Career ==
Seth's inclination toward geography manifested as an avid viewership of geography-centric content on YouTube. This pastime soon translated into an ambition to become a Geotuber. Despite his fervor, Seth initially faced challenges due to his unfamiliarity with video editing. This obstacle was overcome when someone took the initiative to tutor him in the editing process. Seth now creates a variety of content encompassing geography, flags, military, countries, and politics. He has also expressed a potential interest in branching out to movie, TV show, and sports-themed edits in the future.
=== Softwares ===
Seth primarily resorts to ''Capcut'' and ''ibis Paint X'' for his video editing needs.
=== External Links ===
* [https://youtube.com/@greatlake_editz Greatlake Editz on YouTube]
* [https://discord.com/invite/r6gtBBHSTh Greatlake Editz's Discord Server]
[[Category: Geotubers]]
[[Category: American YouTubers]]
473fbb0d01ea8651e2095caeaa504c2aec6dd722
595
594
2023-08-13T08:06:16Z
InsaneX
2
/* Softwares */
wikitext
text/x-wiki
[[File:Greatlake_Editz_Logo.jpg|thumb|300px|Logo of Greatlake Editz.]]
'''Seth A. Mercier''' is a Italian-German Geotuber, known for his YouTube channel '''greatlake_editz''' based in Detroit, Michigan, USA. He has channeled his enthusiasm for geography into a burgeoning YouTube career.
== Biography ==
Seth A. Mercier was born on January 8th, 2007, in Detroit, Michigan, USA. Though residing in the USA, he has German and Italian roots, which he proudly acknowledges.
== YouTube Career ==
Seth's inclination toward geography manifested as an avid viewership of geography-centric content on YouTube. This pastime soon translated into an ambition to become a Geotuber. Despite his fervor, Seth initially faced challenges due to his unfamiliarity with video editing. This obstacle was overcome when someone took the initiative to tutor him in the editing process. Seth now creates a variety of content encompassing geography, flags, military, countries, and politics. He has also expressed a potential interest in branching out to movie, TV show, and sports-themed edits in the future.
== Softwares ==
Seth primarily resorts to ''Capcut'' and ''ibis Paint X'' for his video editing needs.
=== External Links ===
* [https://youtube.com/@greatlake_editz Greatlake Editz on YouTube]
* [https://discord.com/invite/r6gtBBHSTh Greatlake Editz's Discord Server]
[[Category: Geotubers]]
[[Category: American YouTubers]]
8e4c051fde196f7c3d081865219bb89573489fba
596
595
2023-08-13T08:06:36Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:Greatlake_Editz_Logo.jpg|thumb|300px|Logo of Greatlake Editz.]]
'''Seth A. Mercier''' is a Italian-German Geotuber, known for his YouTube channel '''greatlake_editz''' based in Detroit, Michigan, USA. He has channeled his enthusiasm for geography into a burgeoning YouTube career.
== Biography ==
Seth A. Mercier was born on January 8th, 2007, in Detroit, Michigan, USA. Though residing in the USA, he has German and Italian roots, which he proudly acknowledges.
== YouTube Career ==
Seth's inclination toward geography manifested as an avid viewership of geography-centric content on YouTube. This pastime soon translated into an ambition to become a Geotuber. Despite his fervor, Seth initially faced challenges due to his unfamiliarity with video editing. This obstacle was overcome when someone took the initiative to tutor him in the editing process. Seth now creates a variety of content encompassing geography, flags, military, countries, and politics. He has also expressed a potential interest in branching out to movie, TV show, and sports-themed edits in the future.
== Softwares ==
Seth primarily resorts to ''Capcut'' and ''ibis Paint X'' for his video editing needs.
== External Links ==
* [https://youtube.com/@greatlake_editz Greatlake Editz on YouTube]
* [https://discord.com/invite/r6gtBBHSTh Greatlake Editz's Discord Server]
[[Category: List of Geotubers]]
a2ead57a05be6d9d9ef48a91db4ac299ec6c502e
597
596
2023-08-13T08:06:54Z
InsaneX
2
/* Softwares */
wikitext
text/x-wiki
[[File:Greatlake_Editz_Logo.jpg|thumb|300px|Logo of Greatlake Editz.]]
'''Seth A. Mercier''' is a Italian-German Geotuber, known for his YouTube channel '''greatlake_editz''' based in Detroit, Michigan, USA. He has channeled his enthusiasm for geography into a burgeoning YouTube career.
== Biography ==
Seth A. Mercier was born on January 8th, 2007, in Detroit, Michigan, USA. Though residing in the USA, he has German and Italian roots, which he proudly acknowledges.
== YouTube Career ==
Seth's inclination toward geography manifested as an avid viewership of geography-centric content on YouTube. This pastime soon translated into an ambition to become a Geotuber. Despite his fervor, Seth initially faced challenges due to his unfamiliarity with video editing. This obstacle was overcome when someone took the initiative to tutor him in the editing process. Seth now creates a variety of content encompassing geography, flags, military, countries, and politics. He has also expressed a potential interest in branching out to movie, TV show, and sports-themed edits in the future.
== External Links ==
* [https://youtube.com/@greatlake_editz Greatlake Editz on YouTube]
* [https://discord.com/invite/r6gtBBHSTh Greatlake Editz's Discord Server]
[[Category: List of Geotubers]]
934aaab6ab841e073dc6b0f424a55362672fece2
598
597
2023-08-13T08:07:03Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
[[File:Greatlake_Editz_Logo.jpg|thumb|300px|Logo of Greatlake Editz.]]
'''Seth A. Mercier''' is a Italian-German Geotuber, known for his YouTube channel '''greatlake_editz''' based in Detroit, Michigan, USA. He has channeled his enthusiasm for geography into a burgeoning YouTube career.
== Biography ==
Seth A. Mercier was born on January 8th, 2007, in Detroit, Michigan, USA. Though residing in the USA, he has German and Italian roots, which he proudly acknowledges.
== YouTube Career ==
Seth's inclination toward geography manifested as an avid viewership of geography-centric content on YouTube. This pastime soon translated into an ambition to become a Geotuber. Despite his fervor, Seth initially faced challenges due to his unfamiliarity with video editing. This obstacle was overcome when someone took the initiative to tutor him in the editing process. Seth now creates a variety of content encompassing geography, flags, military, countries, and politics. He has also expressed a potential interest in branching out to movie, TV show, and sports-themed edits in the future. Seth primarily resorts to ''Capcut'' and ''ibis Paint X'' for his video editing needs.
== External Links ==
* [https://youtube.com/@greatlake_editz Greatlake Editz on YouTube]
* [https://discord.com/invite/r6gtBBHSTh Greatlake Editz's Discord Server]
[[Category: List of Geotubers]]
ea26f1e421caca92ebd466c8933a1cff1cd9b168
599
598
2023-08-13T08:42:19Z
InsaneX
2
wikitext
text/x-wiki
[[File:Greatlake_Editz_Logo.jpg|thumb|300px|Logo of Greatlake Editz.]]
'''Seth A. Mercier''' is a Italian-German Geotuber, known for his YouTube channel '''greatlake_editz''' based in Detroit, Michigan, USA. He has channeled his enthusiasm for geography into a burgeoning YouTube career.
== Biography ==
Seth A. Mercier was born on January 8th, 2007, in [https://en.wikipedia.org/wiki/Detroit Detroit], [https://en.wikipedia.org/wiki/Michigan Michigan], USA. Though residing in the USA, he has German and Italian roots, which he proudly acknowledges.
== YouTube Career ==
Seth's inclination toward [https://en.wikipedia.org/wiki/Geography geography] manifested as an avid viewership of geography-centric content on YouTube. This pastime soon translated into an ambition to become a Geotuber. Despite his fervor, Seth initially faced challenges due to his unfamiliarity with video editing. This obstacle was overcome when someone took the initiative to tutor him in the editing process. Seth now creates a variety of content encompassing geography, flags, military, countries, and politics. He has also expressed a potential interest in branching out to movie, TV show, and sports-themed edits in the future. Seth primarily resorts to ''Capcut'' and ''ibis Paint X'' for his video editing needs.
== External Links ==
* [https://youtube.com/@greatlake_editz Greatlake Editz on YouTube]
* [https://discord.com/invite/r6gtBBHSTh Greatlake Editz's Discord Server]
[[Category: List of Geotubers]]
debafacdc21147c3b52b24c8f4d00a19ea6cce52
611
599
2023-08-13T17:01:43Z
InsaneX
2
wikitext
text/x-wiki
[[File:Greatlake_Editz_Logo.jpg|thumb|300px|Logo of Greatlake Editz.]]
'''Seth A. Mercier''' is a Italian-German Geotuber, known for his YouTube channel '''greatlake_editz''' based in Detroit, Michigan, USA. He has channeled his enthusiasm for geography into a burgeoning YouTube career.
== Biography ==
Seth A. Mercier was born on January 8th, 2007, in [https://en.wikipedia.org/wiki/Detroit Detroit], [https://en.wikipedia.org/wiki/Michigan Michigan], USA. He currently lives in [https://en.wikipedia.org/wiki/Eastpointe,_Michigan Eastpointe], [https://en.wikipedia.org/wiki/Michigan Michigan]. Though residing in the USA, he has German and Italian roots, which he proudly acknowledges.
== YouTube Career ==
Seth's inclination toward [https://en.wikipedia.org/wiki/Geography geography] manifested as an avid viewership of geography-centric content on YouTube. This pastime soon translated into an ambition to become a Geotuber. Despite his fervor, Seth initially faced challenges due to his unfamiliarity with video editing. This obstacle was overcome when someone took the initiative to tutor him in the editing process. Seth now creates a variety of content encompassing geography, flags, military, countries, and politics. He has also expressed a potential interest in branching out to movie, TV show, and sports-themed edits in the future. Seth primarily resorts to ''Capcut'' and ''ibis Paint X'' for his video editing needs.
== External Links ==
* [https://youtube.com/@greatlake_editz Greatlake Editz on YouTube]
* [https://discord.com/invite/r6gtBBHSTh Greatlake Editz's Discord Server]
[[Category: List of Geotubers]]
29d3d483a2af4c443bd0513805fa739188b94426
ArizonaBallYT
0
234
600
2023-08-13T08:57:38Z
InsaneX
2
Created page with "'''ArizonaBallYT''' is an American Geotuber well known for creating videos mainly related to Geography, comparing countries, empires, and other geographical themes. As of the latest update, ArizonaBallYT has amassed a following of 8.57K subscribers and a total of 4.44 million views on his YouTube channel. == Early Life == ArizonaBallYT was born in [https://en.wikipedia.org/wiki/Aurora,_Colorado Aurora], [https://en.wikipedia.org/wiki/Colorado Colorado], USA. At the age..."
wikitext
text/x-wiki
'''ArizonaBallYT''' is an American Geotuber well known for creating videos mainly related to Geography, comparing countries, empires, and other geographical themes. As of the latest update, ArizonaBallYT has amassed a following of 8.57K subscribers and a total of 4.44 million views on his YouTube channel.
== Early Life ==
ArizonaBallYT was born in [https://en.wikipedia.org/wiki/Aurora,_Colorado Aurora], [https://en.wikipedia.org/wiki/Colorado Colorado], USA. At the age of 3, he moved to [https://en.wikipedia.org/wiki/Mexico Mexico] and lived there until he was 9. He then relocated to [https://en.wikipedia.org/wiki/Phoenix,_Arizona Phoenix], [https://en.wikipedia.org/wiki/Arizona Arizona], USA. Adapting to the new environment within the USA after living in Mexico was a unique experience for him, which he describes as "kinda awkward".
== YouTube Career ==
ArizonaBallYT initially began his YouTube journey as an animator, focusing on Countryball videos. However, with only about 9 subscribers garnered from this endeavor, he decided to pivot to creating geography-related content. This change in content proved to be a turning point for his channel. Not only did he feel more passionate and positive about uploading, but it also led to him growing a substantial subscriber base and making many friends within the community.
== Softwares Used ==
* '''CapCut'''
* '''Alight Motion'''
* '''Ibis Paint X'''
== External Links ==
* [https://www.youtube.com/channel/UC4AcoWHC2zpYcRshihP_8DA ArizonaBallYT on YouTube]
d672d494d8c0b99ba9727f0f6b5a1199c4fc2190
602
600
2023-08-13T08:59:23Z
InsaneX
2
wikitext
text/x-wiki
[[File:ArizonaBallYT_Logo.jpg|thumb|300px|Logo of ArizonaBallYT.]]
'''ArizonaBallYT''' is an American Geotuber well known for creating videos mainly related to Geography, comparing countries, empires, and other geographical themes. As of the latest update, ArizonaBallYT has amassed a following of 8.57K subscribers and a total of 4.44 million views on his YouTube channel.
== Early Life ==
ArizonaBallYT was born in [https://en.wikipedia.org/wiki/Aurora,_Colorado Aurora], [https://en.wikipedia.org/wiki/Colorado Colorado], USA. At the age of 3, he moved to [https://en.wikipedia.org/wiki/Mexico Mexico] and lived there until he was 9. He then relocated to [https://en.wikipedia.org/wiki/Phoenix,_Arizona Phoenix], [https://en.wikipedia.org/wiki/Arizona Arizona], USA. Adapting to the new environment within the USA after living in Mexico was a unique experience for him, which he describes as "kinda awkward".
== YouTube Career ==
ArizonaBallYT initially began his YouTube journey as an animator, focusing on Countryball videos. However, with only about 9 subscribers garnered from this endeavor, he decided to pivot to creating geography-related content. This change in content proved to be a turning point for his channel. Not only did he feel more passionate and positive about uploading, but it also led to him growing a substantial subscriber base and making many friends within the community.
== Softwares Used ==
* '''CapCut'''
* '''Alight Motion'''
* '''Ibis Paint X'''
== External Links ==
* [https://www.youtube.com/channel/UC4AcoWHC2zpYcRshihP_8DA ArizonaBallYT on YouTube]
983d1664cfafd3256889370ae618d027e2a21bef
File:ArizonaBallYT Logo.jpg
6
235
601
2023-08-13T08:58:21Z
InsaneX
2
Logo of ArizonaBallYT
wikitext
text/x-wiki
== Summary ==
Logo of ArizonaBallYT
7524595222490ff439dcb113c13838a1533bff95
User:Algeria Mapping
2
236
603
2023-08-13T13:45:45Z
Algeria Mapping
15
Channel Was Created On January 14 2021
wikitext
text/x-wiki
Algeria Mapping
8f469c996e48edc850d7c980e408967f9de56f25
User talk:Algeria Mapping
3
237
604
2023-08-13T15:02:20Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:Algeria Mapping]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 15:02, 13 August 2023
4020be5cfa059121803b2e9cf7474495871516ab
World.Military.Reality
0
238
607
2023-08-13T16:34:26Z
InsaneX
2
Created page with "'''Abdullah Tahir''' (Urdu: عبداللہ طاہر) is a Pakistani Geotuber known for his [https://en.wikipedia.org/wiki/YouTube YouTube] channel '''World.Military.Reality'''. The channel was launched on October 1, 2022, and within nine months has garnered nearly 17,000 subscribers and close to 3.5 million views. World.Military.Reality has gained significant attention in the Geo community due to its distinctive takes on history, geography, and geopolitical topics. == E..."
wikitext
text/x-wiki
'''Abdullah Tahir''' (Urdu: عبداللہ طاہر) is a Pakistani Geotuber known for his [https://en.wikipedia.org/wiki/YouTube YouTube] channel '''World.Military.Reality'''. The channel was launched on October 1, 2022, and within nine months has garnered nearly 17,000 subscribers and close to 3.5 million views. World.Military.Reality has gained significant attention in the Geo community due to its distinctive takes on history, geography, and geopolitical topics.
== Early Life ==
Abdullah was born in [https://en.wikipedia.org/wiki/Islamabad Islamabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. From an early age, he exhibited a keen interest in military, geography, history, and [https://en.wikipedia.org/wiki/Geopolitics geopolitics].
== YouTube Career ==
Abdullah began his YouTube journey in 2019, focusing primarily on gaming content, especially centered around [https://en.wikipedia.org/wiki/Roblox Roblox]. From 2019 to 2021, despite numerous video uploads, the channel could only manage to amass around 100 subscribers and about 50,000 views.
In 2022, after being introduced to the Geo community and watching content from other Geotubers, Abdullah's passion was rekindled. On October 1, 2023, following a break, he initiated his third YouTube channel dedicated to geopolitics and military-related subjects. Abdullah started by using CapCut for video editing but soon moved to Alight Motion to further enhance his editing capabilities. This transition played a pivotal role in uplifting the quality of his content, resulting in a significant growth spurt for his channel. Such rapid growth affirmed Abdullah's standing in the Geo community, identifying him as a notable Geotuber.
== Editing Styles and Tools ==
Abdullah's distinct editing style and unique subject choices have not only made him popular but have also inspired others to emulate his content. He utilizes a combination of software tools to bring his creative visions to life:
* CapCut
* Alight Motion
* ibis Paint X
* Pixel lab
* [https://en.wikipedia.org/wiki/Adobe_Lightroom Adobe Lightroom]
== External Links ==
* [https://youtube.com/@World.Military.Reality World.Military.Reality on YouTube]
* [https://www.tiktok.com/@world.military.reality._?_t=8enj7uQlkj2&_r=1 World.Military.Reality on TikTok]
* [https://instagram.com/abdullah.3xe?igshid=MzRlODBiNWFlZA== World.Military.Reality on Instagram]
6955136209221a00911a5edc69a6638f27b8ab9d
609
607
2023-08-13T16:35:57Z
InsaneX
2
wikitext
text/x-wiki
[[File:World.Military.Reality_Logo.jpg|thumb|300px|Logo of World.Military.Reality.]]
'''Abdullah Tahir''' (Urdu: عبداللہ طاہر) is a Pakistani Geotuber known for his [https://en.wikipedia.org/wiki/YouTube YouTube] channel '''World.Military.Reality'''. The channel was launched on October 1, 2022, and within nine months has garnered nearly 17,000 subscribers and close to 3.5 million views. World.Military.Reality has gained significant attention in the Geo community due to its distinctive takes on history, geography, and geopolitical topics.
== Early Life ==
Abdullah was born in [https://en.wikipedia.org/wiki/Islamabad Islamabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. From an early age, he exhibited a keen interest in military, geography, history, and [https://en.wikipedia.org/wiki/Geopolitics geopolitics].
== YouTube Career ==
Abdullah began his YouTube journey in 2019, focusing primarily on gaming content, especially centered around [https://en.wikipedia.org/wiki/Roblox Roblox]. From 2019 to 2021, despite numerous video uploads, the channel could only manage to amass around 100 subscribers and about 50,000 views.
In 2022, after being introduced to the Geo community and watching content from other Geotubers, Abdullah's passion was rekindled. On October 1, 2023, following a break, he initiated his third YouTube channel dedicated to geopolitics and military-related subjects. Abdullah started by using CapCut for video editing but soon moved to Alight Motion to further enhance his editing capabilities. This transition played a pivotal role in uplifting the quality of his content, resulting in a significant growth spurt for his channel. Such rapid growth affirmed Abdullah's standing in the Geo community, identifying him as a notable Geotuber.
== Editing Styles and Tools ==
Abdullah's distinct editing style and unique subject choices have not only made him popular but have also inspired others to emulate his content. He utilizes a combination of software tools to bring his creative visions to life:
* CapCut
* Alight Motion
* ibis Paint X
* Pixel lab
* [https://en.wikipedia.org/wiki/Adobe_Lightroom Adobe Lightroom]
== External Links ==
* [https://youtube.com/@World.Military.Reality World.Military.Reality on YouTube]
* [https://www.tiktok.com/@world.military.reality._?_t=8enj7uQlkj2&_r=1 World.Military.Reality on TikTok]
* [https://instagram.com/abdullah.3xe?igshid=MzRlODBiNWFlZA== World.Military.Reality on Instagram]
fd0e5b36df278188edc524b01d6ca417baf607ea
610
609
2023-08-13T16:55:38Z
InsaneX
2
wikitext
text/x-wiki
[[File:World.Military.Reality_Logo.jpg|thumb|300px|Logo of World.Military.Reality.]]
'''Abdullah Tahir''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: عبداللہ طاہر) is a Pakistani Geotuber known for his [https://en.wikipedia.org/wiki/YouTube YouTube] channel '''World.Military.Reality'''. The channel was launched on October 1, 2022, and within nine months has garnered nearly 17,000 subscribers and close to 3.5 million views. World.Military.Reality has gained significant attention in the Geo community due to its distinctive takes on history, geography, and geopolitical topics.
== Early Life ==
Abdullah was born in [https://en.wikipedia.org/wiki/Islamabad Islamabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. From an early age, he exhibited a keen interest in military, geography, history, and [https://en.wikipedia.org/wiki/Geopolitics geopolitics].
== YouTube Career ==
Abdullah began his YouTube journey in 2019, focusing primarily on gaming content, especially centered around [https://en.wikipedia.org/wiki/Roblox Roblox]. From 2019 to 2021, despite numerous video uploads, the channel could only manage to amass around 100 subscribers and about 50,000 views.
In 2022, after being introduced to the Geo community and watching content from other Geotubers, Abdullah's passion was rekindled. On October 1, 2023, following a break, he initiated his third YouTube channel dedicated to geopolitics and military-related subjects. Abdullah started by using CapCut for video editing but soon moved to Alight Motion to further enhance his editing capabilities. This transition played a pivotal role in uplifting the quality of his content, resulting in a significant growth spurt for his channel. Such rapid growth affirmed Abdullah's standing in the Geo community, identifying him as a notable Geotuber.
== Editing Styles and Tools ==
Abdullah's distinct editing style and unique subject choices have not only made him popular but have also inspired others to emulate his content. He utilizes a combination of software tools to bring his creative visions to life:
* CapCut
* Alight Motion
* ibis Paint X
* Pixel lab
* [https://en.wikipedia.org/wiki/Adobe_Lightroom Adobe Lightroom]
== External Links ==
* [https://youtube.com/@World.Military.Reality World.Military.Reality on YouTube]
* [https://www.tiktok.com/@world.military.reality._?_t=8enj7uQlkj2&_r=1 World.Military.Reality on TikTok]
* [https://instagram.com/abdullah.3xe?igshid=MzRlODBiNWFlZA== World.Military.Reality on Instagram]
2319dfdf30a74d2e190e00e7720792f5363109e8
617
610
2023-08-13T17:29:20Z
InsaneX
2
wikitext
text/x-wiki
[[File:World.Military.Reality_Logo.jpg|thumb|300px|Logo of World.Military.Reality.]]
'''Abdullah Tahir''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: عبداللہ طاہر) is a Pakistani Geotuber known for his [https://en.wikipedia.org/wiki/YouTube YouTube] channel '''World.Military.Reality'''. The channel was launched on October 1, 2022, and within nine months has garnered nearly 17,000 subscribers and close to 3.5 million views. World.Military.Reality has gained significant attention in the Geo community due to its distinctive takes on history, geography, and geopolitical topics.
== Early Life ==
Abdullah was born in [https://en.wikipedia.org/wiki/Islamabad Islamabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. From an early age, he exhibited a keen interest in military, geography, history, and [https://en.wikipedia.org/wiki/Geopolitics geopolitics].
== YouTube Career ==
Abdullah began his YouTube journey in 2019, focusing primarily on gaming content, especially centered around [https://en.wikipedia.org/wiki/Roblox Roblox]. From 2019 to 2021, despite numerous video uploads, the channel could only manage to amass around 100 subscribers and about 50,000 views.
In 2022, after being introduced to the Geo community and watching content from other Geotubers, Abdullah's passion was rekindled. On October 1, 2023, following a break, he initiated his third YouTube channel dedicated to geopolitics and military-related subjects. Abdullah started by using CapCut for video editing but soon moved to Alight Motion to further enhance his editing capabilities. This transition played a pivotal role in uplifting the quality of his content, resulting in a significant growth spurt for his channel. Such rapid growth affirmed Abdullah's standing in the Geo community, identifying him as a notable Geotuber.
== Editing Styles and Tools ==
Abdullah's distinct editing style and unique subject choices have not only made him popular but have also inspired others to emulate his content. He utilizes a combination of software tools to bring his creative visions to life:
* CapCut
* Alight Motion
* ibis Paint X
* Pixel lab
* [https://en.wikipedia.org/wiki/Adobe_Lightroom Adobe Lightroom]
== External Links ==
* [https://youtube.com/@World.Military.Reality World.Military.Reality on YouTube]
* [https://www.tiktok.com/@world.military.reality._?_t=8enj7uQlkj2&_r=1 World.Military.Reality on TikTok]
* [https://instagram.com/abdullah.3xe?igshid=MzRlODBiNWFlZA== World.Military.Reality on Instagram]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
7b403a4c0c77a49962c34931fe0d8479ba4f3e11
File:World.Military.Reality Logo.jpg
6
239
608
2023-08-13T16:35:17Z
InsaneX
2
Logo of World.Military.Reality
wikitext
text/x-wiki
== Summary ==
Logo of World.Military.Reality
5e04f9340063d60caa20f579d9be495dc2278b3d
Based.Saudi.Bangladeshi.21
0
240
612
2023-08-13T17:23:31Z
InsaneX
2
Created page with "== Ahmed Salman == '''Ahmed Salman''' (Arabic: أحمد سلمان; Bangla: আহমেদ সালমান) is a Geotuber prominently known for his [https://en.wikipedia.org/wiki/YouTube YouTube] channel '''Based.Saudi.Bangladeshi.21'''. Born on May 6, 2009, in [https://en.wikipedia.org/wiki/Taif Taif], [https://en.wikipedia.org/wiki/Mecca_Province Mecca province], [https://en.wikipedia.org/wiki/Saudi_Arabia Saudi Arabia], he relocated to [https://en.wikipedia.org/wi..."
wikitext
text/x-wiki
== Ahmed Salman ==
'''Ahmed Salman''' (Arabic: أحمد سلمان; Bangla: আহমেদ সালমান) is a Geotuber prominently known for his [https://en.wikipedia.org/wiki/YouTube YouTube] channel '''Based.Saudi.Bangladeshi.21'''. Born on May 6, 2009, in [https://en.wikipedia.org/wiki/Taif Taif], [https://en.wikipedia.org/wiki/Mecca_Province Mecca province], [https://en.wikipedia.org/wiki/Saudi_Arabia Saudi Arabia], he relocated to [https://en.wikipedia.org/wiki/Dhaka Dhaka], [https://en.wikipedia.org/wiki/Bangladesh Bangladesh], in September 2021 and later moved permanently to [https://en.wikipedia.org/wiki/Sirajganj_District Sirajganj], [https://en.wikipedia.org/wiki/Rajshahi_District Rajshahi District], [https://en.wikipedia.org/wiki/Bangladesh Bangladesh], in March 2023.
== Early Life and Background ==
Ahmed's initial exposure to YouTube was in 2019 when he launched his first channel. Despite gaining 25k views and 258 subscribers, he deleted the channel due to familial pressures. With his family's subsequent consent, Ahmed launched his second YouTube channel on October 3, 2022. He drew inspiration from the YouTuber Based Iraqi 21, now popularly referred to as Iraqi Muslim, naming his channel in a similar vein. Ahmed possesses a profound interest in politics and history, advocating for the [https://en.wikipedia.org/wiki/Bangladesh_Nationalist_Party BNP (Bangladesh Nationalist Party)] in Bangladesh and supporting [https://en.wikipedia.org/wiki/Monarchy monarchy] in Saudi Arabia.
== YouTube and Instagram Presence ==
While Ahmed's YouTube career began with a setback, his determination led him to a second venture in 2022, heavily inspired by other content creators. On [https://en.wikipedia.org/wiki/Instagram Instagram], Ahmed, under the username '''b6se9.a5med.tan8iro''', initially achieved recognition when one of his anime-related posts, specifically about [https://en.wikipedia.org/wiki/Demon_Slayer:_Kimetsu_no_Yaiba Demon Slayer], accumulated 354k views. While he primarily focuses on geo content, his passion for anime, particularly Demon Slayer, often translates into his Instagram posts where he shares edited anime content. Ahmed frequently engages on Instagram, making him quite accessible to his followers. Surprised by the reach of his anime post, Ahmed's following has since grown to almost 500.
== Editing Styles and Tools ==
Initially, Ahmed began his editing journey using InShot. However, as he sought to improve and diversify his editing skills, he transitioned to software like CapCut and is currently acquainting himself with Alight Motion.
== Alliances ==
Ahmed Salman is an active member of multiple alliances within the Geo community. These alliances foster collaboration among their members, allowing for the creation of joint edits and shared geo-content. His memberships include:
* '''Pakistan Geotuber Alliance (P.A.G)'''
* '''United Alliance of Geotuber (U.A.G)'''
* '''United States Geotuber Alliance (U.S.G.A)'''
* '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'''
== External Links ==
* [https://youtube.com/@Based.Saudi.Bangladeshi.21 YouTube]
* [https://instagram.com/ahmed.salman21 Instagram]
81764ce64199342687d182b59abde30124aaded3
613
612
2023-08-13T17:24:14Z
InsaneX
2
/* Ahmed Salman */
wikitext
text/x-wiki
'''Ahmed Salman''' ([https://en.wikipedia.org/wiki/Arabic Arabic]: أحمد سلمان; [https://en.wikipedia.org/wiki/Bangla Bangla]: আহমেদ সালমান) is a Geotuber prominently known for his [https://en.wikipedia.org/wiki/YouTube YouTube] channel '''Based.Saudi.Bangladeshi.21'''. Born on May 6, 2009, in [https://en.wikipedia.org/wiki/Taif Taif], [https://en.wikipedia.org/wiki/Mecca_Province Mecca province], [https://en.wikipedia.org/wiki/Saudi_Arabia Saudi Arabia], he relocated to [https://en.wikipedia.org/wiki/Dhaka Dhaka], [https://en.wikipedia.org/wiki/Bangladesh Bangladesh], in September 2021 and later moved permanently to [https://en.wikipedia.org/wiki/Sirajganj_District Sirajganj], [https://en.wikipedia.org/wiki/Rajshahi_District Rajshahi District], [https://en.wikipedia.org/wiki/Bangladesh Bangladesh], in March 2023.
== Early Life and Background ==
Ahmed's initial exposure to YouTube was in 2019 when he launched his first channel. Despite gaining 25k views and 258 subscribers, he deleted the channel due to familial pressures. With his family's subsequent consent, Ahmed launched his second YouTube channel on October 3, 2022. He drew inspiration from the YouTuber Based Iraqi 21, now popularly referred to as Iraqi Muslim, naming his channel in a similar vein. Ahmed possesses a profound interest in politics and history, advocating for the [https://en.wikipedia.org/wiki/Bangladesh_Nationalist_Party BNP (Bangladesh Nationalist Party)] in Bangladesh and supporting [https://en.wikipedia.org/wiki/Monarchy monarchy] in Saudi Arabia.
== YouTube and Instagram Presence ==
While Ahmed's YouTube career began with a setback, his determination led him to a second venture in 2022, heavily inspired by other content creators. On [https://en.wikipedia.org/wiki/Instagram Instagram], Ahmed, under the username '''b6se9.a5med.tan8iro''', initially achieved recognition when one of his anime-related posts, specifically about [https://en.wikipedia.org/wiki/Demon_Slayer:_Kimetsu_no_Yaiba Demon Slayer], accumulated 354k views. While he primarily focuses on geo content, his passion for anime, particularly Demon Slayer, often translates into his Instagram posts where he shares edited anime content. Ahmed frequently engages on Instagram, making him quite accessible to his followers. Surprised by the reach of his anime post, Ahmed's following has since grown to almost 500.
== Editing Styles and Tools ==
Initially, Ahmed began his editing journey using InShot. However, as he sought to improve and diversify his editing skills, he transitioned to software like CapCut and is currently acquainting himself with Alight Motion.
== Alliances ==
Ahmed Salman is an active member of multiple alliances within the Geo community. These alliances foster collaboration among their members, allowing for the creation of joint edits and shared geo-content. His memberships include:
* '''Pakistan Geotuber Alliance (P.A.G)'''
* '''United Alliance of Geotuber (U.A.G)'''
* '''United States Geotuber Alliance (U.S.G.A)'''
* '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'''
== External Links ==
* [https://youtube.com/@Based.Saudi.Bangladeshi.21 YouTube]
* [https://instagram.com/ahmed.salman21 Instagram]
2653075da6d83e18b26bda16dd4af1739b24b256
614
613
2023-08-13T17:24:49Z
InsaneX
2
wikitext
text/x-wiki
'''Ahmed Salman''' ([https://en.wikipedia.org/wiki/Arabic Arabic]: أحمد سلمان; [https://en.wikipedia.org/wiki/Bengali_language Bangla]: আহমেদ সালমান) is a Geotuber prominently known for his [https://en.wikipedia.org/wiki/YouTube YouTube] channel '''Based.Saudi.Bangladeshi.21'''. Born on May 6, 2009, in [https://en.wikipedia.org/wiki/Taif Taif], [https://en.wikipedia.org/wiki/Mecca_Province Mecca province], [https://en.wikipedia.org/wiki/Saudi_Arabia Saudi Arabia], he relocated to [https://en.wikipedia.org/wiki/Dhaka Dhaka], [https://en.wikipedia.org/wiki/Bangladesh Bangladesh], in September 2021 and later moved permanently to [https://en.wikipedia.org/wiki/Sirajganj_District Sirajganj], [https://en.wikipedia.org/wiki/Rajshahi_District Rajshahi District], [https://en.wikipedia.org/wiki/Bangladesh Bangladesh], in March 2023.
== Early Life and Background ==
Ahmed's initial exposure to YouTube was in 2019 when he launched his first channel. Despite gaining 25k views and 258 subscribers, he deleted the channel due to familial pressures. With his family's subsequent consent, Ahmed launched his second YouTube channel on October 3, 2022. He drew inspiration from the YouTuber Based Iraqi 21, now popularly referred to as Iraqi Muslim, naming his channel in a similar vein. Ahmed possesses a profound interest in politics and history, advocating for the [https://en.wikipedia.org/wiki/Bangladesh_Nationalist_Party BNP (Bangladesh Nationalist Party)] in Bangladesh and supporting [https://en.wikipedia.org/wiki/Monarchy monarchy] in Saudi Arabia.
== YouTube and Instagram Presence ==
While Ahmed's YouTube career began with a setback, his determination led him to a second venture in 2022, heavily inspired by other content creators. On [https://en.wikipedia.org/wiki/Instagram Instagram], Ahmed, under the username '''b6se9.a5med.tan8iro''', initially achieved recognition when one of his anime-related posts, specifically about [https://en.wikipedia.org/wiki/Demon_Slayer:_Kimetsu_no_Yaiba Demon Slayer], accumulated 354k views. While he primarily focuses on geo content, his passion for anime, particularly Demon Slayer, often translates into his Instagram posts where he shares edited anime content. Ahmed frequently engages on Instagram, making him quite accessible to his followers. Surprised by the reach of his anime post, Ahmed's following has since grown to almost 500.
== Editing Styles and Tools ==
Initially, Ahmed began his editing journey using InShot. However, as he sought to improve and diversify his editing skills, he transitioned to software like CapCut and is currently acquainting himself with Alight Motion.
== Alliances ==
Ahmed Salman is an active member of multiple alliances within the Geo community. These alliances foster collaboration among their members, allowing for the creation of joint edits and shared geo-content. His memberships include:
* '''Pakistan Geotuber Alliance (P.A.G)'''
* '''United Alliance of Geotuber (U.A.G)'''
* '''United States Geotuber Alliance (U.S.G.A)'''
* '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'''
== External Links ==
* [https://youtube.com/@Based.Saudi.Bangladeshi.21 YouTube]
* [https://instagram.com/ahmed.salman21 Instagram]
ee534a26c37c8d4bc9b2cb5bd3f84c20c468747d
616
614
2023-08-13T17:28:54Z
InsaneX
2
wikitext
text/x-wiki
[[File:Based.saudi.bangladeshi.21_Logo.jpg|thumb|300px|Logo of Based.Saudi.Bangladeshi.21.]]
'''Ahmed Salman''' ([https://en.wikipedia.org/wiki/Arabic Arabic]: أحمد سلمان; [https://en.wikipedia.org/wiki/Bengali_language Bangla]: আহমেদ সালমান) is a Geotuber prominently known for his [https://en.wikipedia.org/wiki/YouTube YouTube] channel '''Based.Saudi.Bangladeshi.21'''. Born on May 6, 2009, in [https://en.wikipedia.org/wiki/Taif Taif], [https://en.wikipedia.org/wiki/Mecca_Province Mecca province], [https://en.wikipedia.org/wiki/Saudi_Arabia Saudi Arabia], he relocated to [https://en.wikipedia.org/wiki/Dhaka Dhaka], [https://en.wikipedia.org/wiki/Bangladesh Bangladesh], in September 2021 and later moved permanently to [https://en.wikipedia.org/wiki/Sirajganj_District Sirajganj], [https://en.wikipedia.org/wiki/Rajshahi_District Rajshahi District], [https://en.wikipedia.org/wiki/Bangladesh Bangladesh], in March 2023.
== Early Life and Background ==
Ahmed's initial exposure to YouTube was in 2019 when he launched his first channel. Despite gaining 25k views and 258 subscribers, he deleted the channel due to familial pressures. With his family's subsequent consent, Ahmed launched his second YouTube channel on October 3, 2022. He drew inspiration from the YouTuber Based Iraqi 21, now popularly referred to as Iraqi Muslim, naming his channel in a similar vein. Ahmed possesses a profound interest in politics and history, advocating for the [https://en.wikipedia.org/wiki/Bangladesh_Nationalist_Party BNP (Bangladesh Nationalist Party)] in Bangladesh and supporting [https://en.wikipedia.org/wiki/Monarchy monarchy] in Saudi Arabia.
== YouTube and Instagram Presence ==
While Ahmed's YouTube career began with a setback, his determination led him to a second venture in 2022, heavily inspired by other content creators. On [https://en.wikipedia.org/wiki/Instagram Instagram], Ahmed, under the username '''b6se9.a5med.tan8iro''', initially achieved recognition when one of his anime-related posts, specifically about [https://en.wikipedia.org/wiki/Demon_Slayer:_Kimetsu_no_Yaiba Demon Slayer], accumulated 354k views. While he primarily focuses on geo content, his passion for anime, particularly Demon Slayer, often translates into his Instagram posts where he shares edited anime content. Ahmed frequently engages on Instagram, making him quite accessible to his followers. Surprised by the reach of his anime post, Ahmed's following has since grown to almost 500.
== Editing Styles and Tools ==
Initially, Ahmed began his editing journey using InShot. However, as he sought to improve and diversify his editing skills, he transitioned to software like CapCut and is currently acquainting himself with Alight Motion.
== Alliances ==
Ahmed Salman is an active member of multiple alliances within the Geo community. These alliances foster collaboration among their members, allowing for the creation of joint edits and shared geo-content. His memberships include:
* '''Pakistan Geotuber Alliance (P.A.G)'''
* '''United Alliance of Geotuber (U.A.G)'''
* '''United States Geotuber Alliance (U.S.G.A)'''
* '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'''
== External Links ==
* [https://youtube.com/@Based.Saudi.Bangladeshi.21 YouTube]
* [https://instagram.com/ahmed.salman21 Instagram]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
bb337d7efc26472fcf67d4607c43e4c760e0b8c4
618
616
2023-08-13T17:31:52Z
InsaneX
2
/* YouTube and Instagram Presence */
wikitext
text/x-wiki
[[File:Based.saudi.bangladeshi.21_Logo.jpg|thumb|300px|Logo of Based.Saudi.Bangladeshi.21.]]
'''Ahmed Salman''' ([https://en.wikipedia.org/wiki/Arabic Arabic]: أحمد سلمان; [https://en.wikipedia.org/wiki/Bengali_language Bangla]: আহমেদ সালমান) is a Geotuber prominently known for his [https://en.wikipedia.org/wiki/YouTube YouTube] channel '''Based.Saudi.Bangladeshi.21'''. Born on May 6, 2009, in [https://en.wikipedia.org/wiki/Taif Taif], [https://en.wikipedia.org/wiki/Mecca_Province Mecca province], [https://en.wikipedia.org/wiki/Saudi_Arabia Saudi Arabia], he relocated to [https://en.wikipedia.org/wiki/Dhaka Dhaka], [https://en.wikipedia.org/wiki/Bangladesh Bangladesh], in September 2021 and later moved permanently to [https://en.wikipedia.org/wiki/Sirajganj_District Sirajganj], [https://en.wikipedia.org/wiki/Rajshahi_District Rajshahi District], [https://en.wikipedia.org/wiki/Bangladesh Bangladesh], in March 2023.
== Early Life and Background ==
Ahmed's initial exposure to YouTube was in 2019 when he launched his first channel. Despite gaining 25k views and 258 subscribers, he deleted the channel due to familial pressures. With his family's subsequent consent, Ahmed launched his second YouTube channel on October 3, 2022. He drew inspiration from the YouTuber Based Iraqi 21, now popularly referred to as Iraqi Muslim, naming his channel in a similar vein. Ahmed possesses a profound interest in politics and history, advocating for the [https://en.wikipedia.org/wiki/Bangladesh_Nationalist_Party BNP (Bangladesh Nationalist Party)] in Bangladesh and supporting [https://en.wikipedia.org/wiki/Monarchy monarchy] in Saudi Arabia.
== YouTube and Instagram Presence ==
While Ahmed's YouTube career began with a setback, his determination led him to a second venture in 2022, heavily inspired by other content creators. On [https://en.wikipedia.org/wiki/Instagram Instagram], Ahmed, under the name '''سلمان أحمد''', initially achieved recognition when one of his anime-related posts, specifically about [https://en.wikipedia.org/wiki/Demon_Slayer:_Kimetsu_no_Yaiba Demon Slayer], accumulated 354k views. While he primarily focuses on geo content, his passion for anime, particularly Demon Slayer, often translates into his Instagram posts where he shares edited anime content. Ahmed frequently engages on Instagram, making him quite accessible to his followers. Surprised by the reach of his anime post, Ahmed's following has since grown to almost 500.
== Editing Styles and Tools ==
Initially, Ahmed began his editing journey using InShot. However, as he sought to improve and diversify his editing skills, he transitioned to software like CapCut and is currently acquainting himself with Alight Motion.
== Alliances ==
Ahmed Salman is an active member of multiple alliances within the Geo community. These alliances foster collaboration among their members, allowing for the creation of joint edits and shared geo-content. His memberships include:
* '''Pakistan Geotuber Alliance (P.A.G)'''
* '''United Alliance of Geotuber (U.A.G)'''
* '''United States Geotuber Alliance (U.S.G.A)'''
* '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'''
== External Links ==
* [https://youtube.com/@Based.Saudi.Bangladeshi.21 YouTube]
* [https://instagram.com/ahmed.salman21 Instagram]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
5f7b2a16c9975c2dc4a57c22c2e80439b8aef415
619
618
2023-08-13T18:10:41Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:Based.saudi.bangladeshi.21_Logo.jpg|thumb|300px|Logo of Based.Saudi.Bangladeshi.21.]]
'''Ahmed Salman''' ([https://en.wikipedia.org/wiki/Arabic Arabic]: أحمد سلمان; [https://en.wikipedia.org/wiki/Bengali_language Bangla]: আহমেদ সালমান) is a Geotuber prominently known for his [https://en.wikipedia.org/wiki/YouTube YouTube] channel '''Based.Saudi.Bangladeshi.21'''. Born on May 6, 2009, in [https://en.wikipedia.org/wiki/Taif Taif], [https://en.wikipedia.org/wiki/Mecca_Province Mecca province], [https://en.wikipedia.org/wiki/Saudi_Arabia Saudi Arabia], he relocated to [https://en.wikipedia.org/wiki/Dhaka Dhaka], [https://en.wikipedia.org/wiki/Bangladesh Bangladesh], in September 2021 and later moved permanently to [https://en.wikipedia.org/wiki/Sirajganj_District Sirajganj], [https://en.wikipedia.org/wiki/Rajshahi_District Rajshahi District], [https://en.wikipedia.org/wiki/Bangladesh Bangladesh], in March 2023.
== Early Life and Background ==
Ahmed's initial exposure to YouTube was in 2019 when he launched his first channel. Despite gaining 25k views and 258 subscribers, he deleted the channel due to familial pressures. With his family's subsequent consent, Ahmed launched his second YouTube channel on October 3, 2022. He drew inspiration from the YouTuber Based Iraqi 21, now popularly referred to as Iraqi Muslim, naming his channel in a similar vein. Ahmed possesses a profound interest in politics and history, advocating for the [https://en.wikipedia.org/wiki/Bangladesh_Nationalist_Party BNP (Bangladesh Nationalist Party)] in Bangladesh and supporting [https://en.wikipedia.org/wiki/Monarchy monarchy] in Saudi Arabia.
== YouTube and Instagram Presence ==
While Ahmed's YouTube career began with a setback, his determination led him to a second venture in 2022, heavily inspired by other content creators. On [https://en.wikipedia.org/wiki/Instagram Instagram], Ahmed, under the name '''سلمان أحمد''', initially achieved recognition when one of his anime-related posts, specifically about [https://en.wikipedia.org/wiki/Demon_Slayer:_Kimetsu_no_Yaiba Demon Slayer], accumulated 354k views. While he primarily focuses on geo content, his passion for anime, particularly Demon Slayer, often translates into his Instagram posts where he shares edited anime content. Ahmed frequently engages on Instagram, making him quite accessible to his followers. Surprised by the reach of his anime post, Ahmed's following has since grown to almost 500.
== Editing Styles and Tools ==
Initially, Ahmed began his editing journey using InShot. However, as he sought to improve and diversify his editing skills, he transitioned to software like CapCut and is currently acquainting himself with Alight Motion.
== Alliances ==
Ahmed Salman is an active member of multiple alliances within the Geo community. These alliances foster collaboration among their members, allowing for the creation of joint edits and shared geo-content. His memberships include:
* '''Pakistan Geotuber Alliance (P.A.G)'''
* '''United Alliance of Geotuber (U.A.G)'''
* '''United States Geotuber Alliance (U.S.G.A)'''
* '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'''
== External Links ==
* [https://youtube.com/@Based.Saudi.Bangladeshi.21 Based.Saudi.Bangladeshi.21 on YouTube]
* [https://instagram.com/ahmed.salman21 Based.Saudi.Bangladeshi.21 on Instagram]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
a580f80d5b5df5848f382ccc5f0a929f17ba37b4
File:Based.saudi.bangladeshi.21 Logo.jpg
6
241
615
2023-08-13T17:27:23Z
InsaneX
2
Logo of Based.Saudi.Bangladeshi.21
wikitext
text/x-wiki
== Summary ==
Logo of Based.Saudi.Bangladeshi.21
2efe013886913748b3ebafc51a1d505b2aa9c05e
Illinois editz
0
242
620
2023-08-13T18:54:23Z
That muslim kid
9
Created page with "==Asher W. B== Asher W. B (better recognized as illnois editz) as is an American Geotuber who was born on October 14th, 2010, in [https://en.wikipedia.org/wiki/Dixon,_Illinois Dixon, Illinois]. When he was a kid, he really wanted to be a YouTuber. ==Early Life== Asher grew up on a farm in [https://en.wikipedia.org/wiki/Dixon,_Illinois Dixon, Illinois], and he liked two things a lot: taking care of plants in the garden and playing video games. He thought it would be cool..."
wikitext
text/x-wiki
==Asher W. B==
Asher W. B (better recognized as illnois editz) as is an American Geotuber who was born on October 14th, 2010, in [https://en.wikipedia.org/wiki/Dixon,_Illinois Dixon, Illinois]. When he was a kid, he really wanted to be a YouTuber.
==Early Life==
Asher grew up on a farm in [https://en.wikipedia.org/wiki/Dixon,_Illinois Dixon, Illinois], and he liked two things a lot: taking care of plants in the garden and playing video games. He thought it would be cool to share his life and interests with others on YouTube.
==YouTube Story==
Asher started his YouTube career on January 10th, 2023. At first, he made videos about aerospace and video games content on his channel. Later, he changed his focus to making edits. People liked these edits a lot, and now, his channel sits at 125 subscribers and 39k views as of 13th August
==Making Videos==
To make his videos, Asher mainly uses [https://www.capcut.com/ CapCut] to edit his videos. He also uses [https://picsart.com Picsart] and [https://ibispaint.com/?lang=en-US ibis paint]
==Things Asher Likes==
Besides making videos, Asher enjoys taking care of his garden and playing Roblox and other video games. These are his favorite things to do when he's not busy making videos.
==External links==
[https://open.spotify.com/user/31niogssejtqh5iudk3ytdqusncq?si=uTiMbJWHSIiUKPkWbbnlwA spotify]
[https://youtube.com/@Illinois_ball Youtube]
[http://roblox.com/users/4402186822/profile Roblox]
2947ef7884e0748c44725a9841f0f8cec389f92a
621
620
2023-08-13T18:55:37Z
InsaneX
2
wikitext
text/x-wiki
Asher W. B (better recognized as illnois editz) as is an American Geotuber who was born on October 14th, 2010, in [https://en.wikipedia.org/wiki/Dixon,_Illinois Dixon, Illinois]. When he was a kid, he really wanted to be a YouTuber.
==Early Life==
Asher grew up on a farm in [https://en.wikipedia.org/wiki/Dixon,_Illinois Dixon, Illinois], and he liked two things a lot: taking care of plants in the garden and playing video games. He thought it would be cool to share his life and interests with others on YouTube.
==YouTube Story==
Asher started his YouTube career on January 10th, 2023. At first, he made videos about aerospace and video games content on his channel. Later, he changed his focus to making edits. People liked these edits a lot, and now, his channel sits at 125 subscribers and 39k views as of 13th August
==Making Videos==
To make his videos, Asher mainly uses [https://www.capcut.com/ CapCut] to edit his videos. He also uses [https://picsart.com Picsart] and [https://ibispaint.com/?lang=en-US ibis paint]
==Things Asher Likes==
Besides making videos, Asher enjoys taking care of his garden and playing Roblox and other video games. These are his favorite things to do when he's not busy making videos.
==External links==
[https://open.spotify.com/user/31niogssejtqh5iudk3ytdqusncq?si=uTiMbJWHSIiUKPkWbbnlwA spotify]
[https://youtube.com/@Illinois_ball Youtube]
[http://roblox.com/users/4402186822/profile Roblox]
678ef2ebd512188a2fd9e4959ee0483d10d983f8
Illinois Editz
0
243
622
2023-08-14T12:01:51Z
InsaneX
2
Created page with "'''Asher W.B.''' is an American Geotuber best known for his channel '''Illinois Editz''' which mainly focuses on geography-related edits. == Early Life == Asher W.B. was born on October 14, 2010, in [https://en.wikipedia.org/wiki/Dixon%2C_Illinois Dixon], [https://en.wikipedia.org/wiki/Illinois Illinois]. He grew up in Dixon, Illinois, where he harbored dreams of becoming a successful YouTuber. He lived and worked on a farm, which significantly influenced his early life..."
wikitext
text/x-wiki
'''Asher W.B.''' is an American Geotuber best known for his channel '''Illinois Editz''' which mainly focuses on geography-related edits.
== Early Life ==
Asher W.B. was born on October 14, 2010, in [https://en.wikipedia.org/wiki/Dixon%2C_Illinois Dixon], [https://en.wikipedia.org/wiki/Illinois Illinois]. He grew up in Dixon, Illinois, where he harbored dreams of becoming a successful YouTuber. He lived and worked on a farm, which significantly influenced his early life experiences.
== YouTube Career ==
Asher W.B. launched his YouTube channel on January 10, 2023. Initially, the channel was intended to focus on aerospace and gaming content. However, a shift in content to geographic edits led to a surge in views and subscribers. Beyond his editing and aerospace interests, Asher also has a passion for gardening and gaming.
== Editing Software ==
Asher W.B. primarily utilizes ''CapCut'' for video editing. For graphic designs and additional editing, he employs tools like ''Picsart'' and ''ibis Paint X''.
== Alliances ==
Asher W.B. is the founder of the '''League of American GeoTubers (L.A.G)''', an alliance that promotes collaboration among Geotubers based in the U.S.
== External Links ==
* [https://www.youtube.com/@Illinois_ball Illinois Editz on YouTube]
[[Category:List of Geotubers]]
e6025596093cca5d50d033f0fc273615111c4750
623
622
2023-08-14T12:02:29Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
'''Asher W.B.''' is an American Geotuber best known for his channel '''Illinois Editz''' which mainly focuses on geography-related edits.
== Early Life ==
Asher W.B. was born on October 14, 2010, in [https://en.wikipedia.org/wiki/Dixon%2C_Illinois Dixon], [https://en.wikipedia.org/wiki/Illinois Illinois]. He grew up in Dixon, Illinois, where he harbored dreams of becoming a successful YouTuber. He lived and worked on a farm, which significantly influenced his early life experiences.
== YouTube Career ==
Asher W.B. launched his [https://en.wikipedia.org/wiki/youtube YouTube channel] on January 10, 2023. Initially, the channel was intended to focus on aerospace and gaming content. However, a shift in content to geographic edits led to a surge in views and subscribers. Beyond his editing and aerospace interests, Asher also has a passion for gardening and gaming.
== Editing Software ==
Asher W.B. primarily utilizes ''CapCut'' for video editing. For graphic designs and additional editing, he employs tools like ''Picsart'' and ''ibis Paint X''.
== Alliances ==
Asher W.B. is the founder of the '''League of American GeoTubers (L.A.G)''', an alliance that promotes collaboration among Geotubers based in the U.S.
== External Links ==
* [https://www.youtube.com/@Illinois_ball Illinois Editz on YouTube]
[[Category:List of Geotubers]]
adb02ad15826ef2b3a9a1d7fc991bbca6afa7434
624
623
2023-08-14T12:07:51Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
'''Asher W.B.''' is an American Geotuber best known for his channel '''Illinois Editz''' which mainly focuses on geography-related edits.
== Early Life ==
Asher W.B. was born on October 14, 2010, in [https://en.wikipedia.org/wiki/Dixon%2C_Illinois Dixon], [https://en.wikipedia.org/wiki/Illinois Illinois]. He grew up in Dixon, Illinois, where he harbored dreams of becoming a successful YouTuber. He lived and worked on a farm, which significantly influenced his early life experiences.
== YouTube Career ==
Asher W.B. launched his [https://en.wikipedia.org/wiki/youtube YouTube channel] on January 10, 2023. Initially, the channel was intended to focus on aerospace and gaming content. However, a shift in content to geographic edits led to a surge in views and subscribers. Beyond his editing and aerospace interests, Asher also has a passion for gardening and gaming.
== Editing Software ==
Asher W.B. primarily utilizes ''CapCut'' for video editing. For graphic designs and additional editing, he employs tools like ''Picsart'' and ''ibis Paint X''.
== Alliances ==
Asher W.B. is the founder of the '''League of American GeoTubers (L.A.G)''', an alliance that promotes collaboration among Geotubers based in the U.S.
== External Links ==
* [https://www.youtube.com/@Illinois_ball Illinois Editz on YouTube]
* [https://open.spotify.com/user/31niogssejtqh5iudk3ytdqusncq?si=uTiMbJWHSIiUKPkWbbnlwA&nd=1 Illinois Editz on Spotify]
* [https://www.roblox.com/users/4402186822/profile Illinois Editz on Roblox]
[[Category:List of Geotubers]]
fdd1742bf26e2170a9838e69131139375e4ec1c0
File:Illinois Editz Logo.jpg
6
244
625
2023-08-14T12:08:50Z
InsaneX
2
Logo of Illinois Editz
wikitext
text/x-wiki
== Summary ==
Logo of Illinois Editz
25e483968ed69d65af8f0d1c97fed2acdc85ac83
Illinois Editz
0
243
626
624
2023-08-14T12:09:34Z
InsaneX
2
wikitext
text/x-wiki
[[File:Illinois_Editz_Logo.jpg|thumb|300px|Logo of Illinois Editz.]]
'''Asher W.B.''' is an American Geotuber best known for his channel '''Illinois Editz''' which mainly focuses on geography-related edits.
== Early Life ==
Asher W.B. was born on October 14, 2010, in [https://en.wikipedia.org/wiki/Dixon%2C_Illinois Dixon], [https://en.wikipedia.org/wiki/Illinois Illinois]. He grew up in Dixon, Illinois, where he harbored dreams of becoming a successful YouTuber. He lived and worked on a farm, which significantly influenced his early life experiences.
== YouTube Career ==
Asher W.B. launched his [https://en.wikipedia.org/wiki/youtube YouTube channel] on January 10, 2023. Initially, the channel was intended to focus on aerospace and gaming content. However, a shift in content to geographic edits led to a surge in views and subscribers. Beyond his editing and aerospace interests, Asher also has a passion for gardening and gaming.
== Editing Software ==
Asher W.B. primarily utilizes ''CapCut'' for video editing. For graphic designs and additional editing, he employs tools like ''Picsart'' and ''ibis Paint X''.
== Alliances ==
Asher W.B. is the founder of the '''League of American GeoTubers (L.A.G)''', an alliance that promotes collaboration among Geotubers based in the U.S.
== External Links ==
* [https://www.youtube.com/@Illinois_ball Illinois Editz on YouTube]
* [https://open.spotify.com/user/31niogssejtqh5iudk3ytdqusncq?si=uTiMbJWHSIiUKPkWbbnlwA&nd=1 Illinois Editz on Spotify]
* [https://www.roblox.com/users/4402186822/profile Illinois Editz on Roblox]
[[Category:List of Geotubers]]
02873c6bcc71e55809169259526f629dcd102f02
636
626
2023-08-14T15:33:48Z
Illinois editz
18
wikitext
text/x-wiki
[[File:Illinois_Editz_Logo.jpg|thumb|300px|Logo of Illinois Editz.]]
'''Asher W.B.''' is an American Geotuber best known for his channel '''Illinois Editz''' which mainly focuses on geography-related edits.
== Early Life ==
Asher W.B. was born on October 14, 2010, in [https://en.wikipedia.org/wiki/Dixon%2C_Illinois Dixon], [https://en.wikipedia.org/wiki/Illinois Illinois]. He grew up in Dixon, Illinois, where he harbored dreams of becoming a successful YouTuber. He lives and worked on a farm, which significantly influenced his early life experiences.
== YouTube Career ==
Asher W.B. launched his [https://en.wikipedia.org/wiki/youtube YouTube channel] on January 10, 2023. Initially, the channel was intended to focus on aerospace and gaming content. However, a shift in content to geographic edits led to a surge in views and subscribers. Beyond his editing and aerospace interests, Asher also has a passion for gardening and gaming.
== Editing Software ==
Asher W.B. primarily utilizes ''CapCut'' for video editing. For graphic designs and additional editing, he employs tools like ''Picsart'' and ''ibis Paint X''.
== Alliances ==
Asher W.B. is the founder of the '''League of American GeoTubers (L.A.G)''', an alliance that promotes collaboration among Geotubers based in the U.S.
== External Links ==
* [https://www.youtube.com/@Illinois_ball Illinois Editz on YouTube]
* [https://open.spotify.com/user/31niogssejtqh5iudk3ytdqusncq?si=uTiMbJWHSIiUKPkWbbnlwA&nd=1 Illinois Editz on Spotify]
* [https://www.roblox.com/users/4402186822/profile Illinois Editz on Roblox]
[[Category:List of Geotubers]]
c3caf8df83e628f9247e23f0d8906372db6b24c3
639
636
2023-08-15T04:10:45Z
Illinois editz
18
wikitext
text/x-wiki
[[File:Illinois_Editz_Logo.jpg|thumb|300px|Logo of Illinois Editz.]]
'''Asher W.B.''' is an American Geotuber best known for his channel '''Illinois Editz''' which mainly focuses on geography-related edits.
== Early Life ==
Asher W.B. was born on October 14, 2010, in [https://en.wikipedia.org/wiki/Dixon%2C_Illinois Dixon], [https://en.wikipedia.org/wiki/Illinois Illinois]. He grew up in Dixon, Illinois, where he harbored dreams of becoming a successful YouTuber. He lives and works on a farm, which significantly influenced his early life experiences.
== YouTube Career ==
Asher W.B. launched his [https://en.wikipedia.org/wiki/youtube YouTube channel] on January 10, 2023. Initially, the channel was intended to focus on aerospace and gaming content. However, a shift in content to geographic edits led to a surge in views and subscribers. Beyond his editing and aerospace interests, Asher also has a passion for gardening and gaming.
== Editing Software ==
Asher W.B. primarily utilizes ''CapCut'' for video editing. For graphic designs and additional editing, he employs tools like ''Picsart'' and ''ibis Paint X''.
== Alliances ==
Asher W.B. is the founder of the '''League of American GeoTubers (L.A.G)''', an alliance that promotes collaboration among Geotubers based in the U.S.
== External Links ==
* [https://www.youtube.com/@Illinois_ball Illinois Editz on YouTube]
* [https://open.spotify.com/user/31niogssejtqh5iudk3ytdqusncq?si=uTiMbJWHSIiUKPkWbbnlwA&nd=1 Illinois Editz on Spotify]
* [https://www.roblox.com/users/4402186822/profile Illinois Editz on Roblox]
[[Category:List of Geotubers]]
b9b9b015982270a97ca09d3dda68668b22e4e34c
File:AHZ Logo.jpg
6
245
627
2023-08-14T13:05:41Z
InsaneX
2
Logo of AHZ
wikitext
text/x-wiki
== Summary ==
Logo of AHZ
9192d49b3d3b6e67f352a0fd9f42a76cf9147f0d
AHZ
0
246
628
2023-08-14T13:06:31Z
InsaneX
2
Created page with "[[File:AHZ_Logo.jpg|thumb|300px|Logo of AHZ.]] '''Ahmet''' is an Azerbaijani Geotuber known for his YouTube channel '''AHZ'''. Born in 2007 in [https://en.wikipedia.org/wiki/Azerbaijan Azerbaijan], Ahmet later moved to [https://en.wikipedia.org/wiki/Canada Canada]. == Early Life == Ahmet's early life was marked by challenges, as he was born into a low-income family in Azerbaijan. Despite these hardships, Ahmet found solace and passion in the digital world. == YouTube C..."
wikitext
text/x-wiki
[[File:AHZ_Logo.jpg|thumb|300px|Logo of AHZ.]]
'''Ahmet''' is an Azerbaijani Geotuber known for his YouTube channel '''AHZ'''. Born in 2007 in [https://en.wikipedia.org/wiki/Azerbaijan Azerbaijan], Ahmet later moved to [https://en.wikipedia.org/wiki/Canada Canada].
== Early Life ==
Ahmet's early life was marked by challenges, as he was born into a low-income family in Azerbaijan. Despite these hardships, Ahmet found solace and passion in the digital world.
== YouTube Career ==
Ahmet's journey on [https://en.wikipedia.org/wiki/YouTube YouTube] began as a mapper, inspired by creators like Balkan Mapping. However, his interests soon shifted to the Geotuber community, intrigued by the advanced edits and creative potential. In his videos, Ahmet primarily creates Islamic and [https://en.wikipedia.org/wiki/Turanism Turanist] edits, reflecting his personal beliefs as both an Islamist and a pan-Turanist. To create these edits, he often uses software tools like ''Capcut'' and ''Picsart''.
Ahmet's contributions and unique style have earned him a dedicated following, boasting 19.3K subscribers and nearly 8.8 million views on his channel.
== Alliances ==
Ahmet is an active member of the '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)''', an alliance within the Geo community that focuses on collaborative content creation.
== External Links ==
* [https://youtube.com/@ahz_editz.53 AHZ on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
9e5eac83377339c90e239f0b52634301ed7bb6be
IcyBall Geostuffs
0
247
629
2023-08-14T13:46:38Z
InsaneX
2
Created page with "'''Landen''' is an American Geotuber known for his channel '''IcyBall Geostuffs'''. Born on September 11, 2009, in [https://en.wikipedia.org/wiki/Riverside,_California Riverside, [https://en.wikipedia.org/wiki/California California], he currently resides in [https://en.wikipedia.org/wiki/Anaheim,_California Anaheim], [https://en.wikipedia.org/wiki/Anaheim,_California California]. == Early Life == From a young age, Landen took immense pride in his ethnic backgrounds, par..."
wikitext
text/x-wiki
'''Landen''' is an American Geotuber known for his channel '''IcyBall Geostuffs'''. Born on September 11, 2009, in [https://en.wikipedia.org/wiki/Riverside,_California Riverside, [https://en.wikipedia.org/wiki/California California], he currently resides in [https://en.wikipedia.org/wiki/Anaheim,_California Anaheim], [https://en.wikipedia.org/wiki/Anaheim,_California California].
== Early Life ==
From a young age, Landen took immense pride in his ethnic backgrounds, particularly his Polish and Persian ancestries. This interest in cultural and ethnic heritage would later translate into a profound fascination with geography.
== YouTube Career ==
Landen's journey into the realm of geography began in the 6th grade, roughly around late 2021 to early 2022. While working on a history project about [https://en.wikipedia.org/wiki/Ancient_Greece Ancient Greece], he chanced upon the strategic strait known as the [https://en.wikipedia.org/wiki/Dardanelles Dardanelles]. As he delved deeper into [https://en.wikipedia.org/wiki/Encyclop%C3%A6dia_Britannica,_Inc. Britannica] and [https://en.wikipedia.org/wiki/Wikipedia Wikipedia], a spark of curiosity led him to explore geography further.
By August 2022, Landen had become an avid viewer of the geo community on YouTube. Inspired by what he saw, he decided to contribute to this community and started his own channel, ''IcyBall Mapping'', in October 2022. Initially, he focused on mapping TTS videos using MapChart. Today, known as ''IcyBall Geostuffs'', Landen creates a diverse range of geographical content.
For his edits, Landen relies on a set of software tools including ''CapCut'', ''Alight Motion'' occasionally, ''ibis Paint X'', and ''Picsart''. He makes CvCs (country vs. country comparisons) and Nationalist Edits on his iPad, while he uses his iPhone for Mapping Videos. Landen's contributions and unique style have earned him a dedicated following, boasting 37.1K subscribers and more than 15.4 million views on his channel.
== Alliances ==
Landen plays an active role in the geo community, being the co-founder of the '''League of Californian Geotubers (L.C.G)'''. He is also a member of the '''League of American Geotubers (L.A.G)'''.
== External Links ==
* [https://youtube.com/@IcyBall.Geostuffs IcyBall Geostuffs on YouTube]
* [www.tiktok.com/@icyball.geostuffs IcyBall Geostuffs on TikTok]
* [https://open.spotify.com/user/31z5m4knlqiude3t2nzzedmlih7u?si=SV96CHwpT2iUsfpogBT84A IcyBall Geostuffs on Spotify]
2172314cff420dc19b75bff3ba6463a85d4e93ef
630
629
2023-08-14T13:47:18Z
InsaneX
2
wikitext
text/x-wiki
'''Landen''' is an American Geotuber known for his channel '''IcyBall Geostuffs'''. Born on September 11, 2009, in [https://en.wikipedia.org/wiki/Riverside,_California Riverside], [https://en.wikipedia.org/wiki/California California], he currently resides in [https://en.wikipedia.org/wiki/Anaheim,_California Anaheim], [https://en.wikipedia.org/wiki/Anaheim,_California California].
== Early Life ==
From a young age, Landen took immense pride in his ethnic backgrounds, particularly his Polish and Persian ancestries. This interest in cultural and ethnic heritage would later translate into a profound fascination with geography.
== YouTube Career ==
Landen's journey into the realm of geography began in the 6th grade, roughly around late 2021 to early 2022. While working on a history project about [https://en.wikipedia.org/wiki/Ancient_Greece Ancient Greece], he chanced upon the strategic strait known as the [https://en.wikipedia.org/wiki/Dardanelles Dardanelles]. As he delved deeper into [https://en.wikipedia.org/wiki/Encyclop%C3%A6dia_Britannica,_Inc. Britannica] and [https://en.wikipedia.org/wiki/Wikipedia Wikipedia], a spark of curiosity led him to explore geography further.
By August 2022, Landen had become an avid viewer of the geo community on YouTube. Inspired by what he saw, he decided to contribute to this community and started his own channel, ''IcyBall Mapping'', in October 2022. Initially, he focused on mapping TTS videos using MapChart. Today, known as ''IcyBall Geostuffs'', Landen creates a diverse range of geographical content.
For his edits, Landen relies on a set of software tools including ''CapCut'', ''Alight Motion'' occasionally, ''ibis Paint X'', and ''Picsart''. He makes CvCs (country vs. country comparisons) and Nationalist Edits on his iPad, while he uses his iPhone for Mapping Videos. Landen's contributions and unique style have earned him a dedicated following, boasting 37.1K subscribers and more than 15.4 million views on his channel.
== Alliances ==
Landen plays an active role in the geo community, being the co-founder of the '''League of Californian Geotubers (L.C.G)'''. He is also a member of the '''League of American Geotubers (L.A.G)'''.
== External Links ==
* [https://youtube.com/@IcyBall.Geostuffs IcyBall Geostuffs on YouTube]
* [www.tiktok.com/@icyball.geostuffs IcyBall Geostuffs on TikTok]
* [https://open.spotify.com/user/31z5m4knlqiude3t2nzzedmlih7u?si=SV96CHwpT2iUsfpogBT84A IcyBall Geostuffs on Spotify]
3d85694505ca405a43ef03d84a93732aee75cc73
632
630
2023-08-14T13:48:22Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
'''Landen''' is an American Geotuber known for his channel '''IcyBall Geostuffs'''. Born on September 11, 2009, in [https://en.wikipedia.org/wiki/Riverside,_California Riverside], [https://en.wikipedia.org/wiki/California California], he currently resides in [https://en.wikipedia.org/wiki/Anaheim,_California Anaheim], [https://en.wikipedia.org/wiki/Anaheim,_California California].
== Early Life ==
From a young age, Landen took immense pride in his ethnic backgrounds, particularly his Polish and Persian ancestries. This interest in cultural and ethnic heritage would later translate into a profound fascination with geography.
== YouTube Career ==
Landen's journey into the realm of geography began in the 6th grade, roughly around late 2021 to early 2022. While working on a history project about [https://en.wikipedia.org/wiki/Ancient_Greece Ancient Greece], he chanced upon the strategic strait known as the [https://en.wikipedia.org/wiki/Dardanelles Dardanelles]. As he delved deeper into [https://en.wikipedia.org/wiki/Encyclop%C3%A6dia_Britannica,_Inc. Britannica] and [https://en.wikipedia.org/wiki/Wikipedia Wikipedia], a spark of curiosity led him to explore geography further.
By August 2022, Landen had become an avid viewer of the geo community on YouTube. Inspired by what he saw, he decided to contribute to this community and started his own channel, ''IcyBall Mapping'', in October 2022. Initially, he focused on mapping TTS videos using MapChart. Today, known as ''IcyBall Geostuffs'', Landen creates a diverse range of geographical content.
For his edits, Landen relies on a set of software tools including ''CapCut'', ''Alight Motion'' occasionally, ''ibis Paint X'', and ''Picsart''. He makes CvCs (country vs. country comparisons) and Nationalist Edits on his iPad, while he uses his iPhone for Mapping Videos. Landen's contributions and unique style have earned him a dedicated following, boasting 37.1K subscribers and more than 15.4 million views on his channel.
== Alliances ==
Landen plays an active role in the geo community, being the co-founder of the '''League of Californian Geotubers (L.C.G)'''. He is also a member of the '''League of American Geotubers (L.A.G)'''.
== External Links ==
* [https://youtube.com/@IcyBall.Geostuffs IcyBall Geostuffs on YouTube]
* [https://www.tiktok.com/@icyball.geostuffs IcyBall Geostuffs on TikTok]
* [https://open.spotify.com/user/31z5m4knlqiude3t2nzzedmlih7u?si=SV96CHwpT2iUsfpogBT84A IcyBall Geostuffs on Spotify]
6aef9016bd202a8e2978fa33bfd4cbc68f3ca62a
633
632
2023-08-14T13:49:41Z
InsaneX
2
wikitext
text/x-wiki
[[File:IcyBall_Geostuffs_Logo.jpg|thumb|300px|Logo of IcyBall Geostuffs.]]
'''Landen''' is an American Geotuber known for his channel '''IcyBall Geostuffs'''. Born on September 11, 2009, in [https://en.wikipedia.org/wiki/Riverside,_California Riverside], [https://en.wikipedia.org/wiki/California California], he currently resides in [https://en.wikipedia.org/wiki/Anaheim,_California Anaheim], [https://en.wikipedia.org/wiki/Anaheim,_California California].
== Early Life ==
From a young age, Landen took immense pride in his ethnic backgrounds, particularly his Polish and Persian ancestries. This interest in cultural and ethnic heritage would later translate into a profound fascination with geography.
== YouTube Career ==
Landen's journey into the realm of geography began in the 6th grade, roughly around late 2021 to early 2022. While working on a history project about [https://en.wikipedia.org/wiki/Ancient_Greece Ancient Greece], he chanced upon the strategic strait known as the [https://en.wikipedia.org/wiki/Dardanelles Dardanelles]. As he delved deeper into [https://en.wikipedia.org/wiki/Encyclop%C3%A6dia_Britannica,_Inc. Britannica] and [https://en.wikipedia.org/wiki/Wikipedia Wikipedia], a spark of curiosity led him to explore geography further.
By August 2022, Landen had become an avid viewer of the Geo community on YouTube. Inspired by what he saw, he decided to contribute to this community and started his own channel, ''IcyBall Mapping'', in October 2022. Initially, he focused on mapping TTS videos using MapChart. Today, known as ''IcyBall Geostuffs'', Landen creates a diverse range of geographical content.
For his edits, Landen relies on a set of software tools including ''CapCut'', ''Alight Motion'' occasionally, ''ibis Paint X'', and ''Picsart''. He makes CvCs (country vs. country comparisons) and Nationalist Edits on his iPad, while he uses his iPhone for Mapping Videos. Landen's contributions and unique style have earned him a dedicated following, boasting 37.1K subscribers and more than 15.4 million views on his channel.
== Alliances ==
Landen plays an active role in the geo community, being the co-founder of the '''League of Californian Geotubers (L.C.G)'''. He is also a member of the '''League of American Geotubers (L.A.G)'''.
== External Links ==
* [https://youtube.com/@IcyBall.Geostuffs IcyBall Geostuffs on YouTube]
* [https://www.tiktok.com/@icyball.geostuffs IcyBall Geostuffs on TikTok]
* [https://open.spotify.com/user/31z5m4knlqiude3t2nzzedmlih7u?si=SV96CHwpT2iUsfpogBT84A IcyBall Geostuffs on Spotify]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
fd7741a351ad0b404396823dd3b61b7bc5d7ac93
File:IcyBall Geostuffs Logo.jpg
6
248
631
2023-08-14T13:47:52Z
InsaneX
2
Logo of IcyBall Geostuffs
wikitext
text/x-wiki
== Summary ==
Logo of IcyBall Geostuffs
fd4d3e2d16318b234e86599fa7c8e0342256244d
File:OtterMapping Logo.jpg
6
249
634
2023-08-14T14:55:32Z
InsaneX
2
Logo of OtterMapping.
wikitext
text/x-wiki
== Summary ==
Logo of OtterMapping.
f90e3d62d44142b3e548d822d73f82fd05ba9699
OtterMapping
0
250
635
2023-08-14T14:55:44Z
InsaneX
2
Created page with "[[File:OtterMapping_Logo.jpg|thumb|300px|Logo of OtterMapping.]] '''OtterMapping''' is an American Geotuber, known for producing videos related to geography and historical subjects. As of 14th August 2023, the channel has garnered over 420k views and has a subscriber count of 775. == Early Life == Born on January 16, 2009, in the USA, OtterMapping has always been inclined towards geography and history. == YouTube Career == OtterMapping started their YouTube journey wit..."
wikitext
text/x-wiki
[[File:OtterMapping_Logo.jpg|thumb|300px|Logo of OtterMapping.]]
'''OtterMapping''' is an American Geotuber, known for producing videos related to geography and historical subjects. As of 14th August 2023, the channel has garnered over 420k views and has a subscriber count of 775.
== Early Life ==
Born on January 16, 2009, in the USA, OtterMapping has always been inclined towards geography and history.
== YouTube Career ==
OtterMapping started their YouTube journey with a desire to both establish a presence in the digital community and to educate the audience about geography—a subject they felt was not well-understood by many. Over time, the content on their channel has delved into a blend of geographical insights and historical events or phenomena.
== Alliances ==
OtterMapping is a member of the '''League of American Geotubers (L.A.G)''', an alliance within the Geo community where creators collaborate on content creation and editing.
== External Links ==
* [https://youtube.com/@OtterMapping OtterMapping on YouTube]
[[Category:List of Geotubers]]
2c53868166ce4ef4bf8adb075ddac66da0b59b57
642
635
2023-08-17T00:10:45Z
Illinois editz
18
wikitext
text/x-wiki
[[File:OtterMapping_Logo.jpg|thumb|300px|Logo of OtterMapping.]]
'''OtterMapping''' is an American Geotuber, known for producing videos related to geography and historical subjects. As of 14th August 2023, the channel has garnered over 420k views and has a subscriber count of 775.
== Early Life ==
Born on January 16, 2009, in the USA, OtterMapping has always been inclined towards geography and history.
== YouTube Career ==
OtterMapping started their YouTube journey with a desire to both establish a presence in the digital community and to educate the audience about geography—a subject they felt was not well-understood by many. Over time, the content on their channel has delved into a blend of geographical insights and historical events or phenomena.
== Alliances ==
OtterMapping is one of the co founders of '''League of American Geotubers (L.A.G)''', an alliance within the Geo community where creators collaborate on content creation and editing.
== External Links ==
* [https://youtube.com/@OtterMapping OtterMapping on YouTube]
[[Category:List of Geotubers]]
833fe47b941654514d4aab706e33aa5bf6fc2e4c
643
642
2023-08-18T12:37:41Z
InsaneX
2
/* Alliances */
wikitext
text/x-wiki
[[File:OtterMapping_Logo.jpg|thumb|300px|Logo of OtterMapping.]]
'''OtterMapping''' is an American Geotuber, known for producing videos related to geography and historical subjects. As of 14th August 2023, the channel has garnered over 420k views and has a subscriber count of 775.
== Early Life ==
Born on January 16, 2009, in the USA, OtterMapping has always been inclined towards geography and history.
== YouTube Career ==
OtterMapping started their YouTube journey with a desire to both establish a presence in the digital community and to educate the audience about geography—a subject they felt was not well-understood by many. Over time, the content on their channel has delved into a blend of geographical insights and historical events or phenomena.
== Alliances ==
OtterMapping is one of the co-founders of '''League of American Geotubers (L.A.G)''', an alliance within the Geo community where creators collaborate on content creation and editing.
== External Links ==
* [https://youtube.com/@OtterMapping OtterMapping on YouTube]
[[Category:List of Geotubers]]
98132626594226f47a94dafbc3b0e53c37d29464
User:Illinois editz
2
251
637
2023-08-14T15:37:49Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:Illinois editz
3
252
638
2023-08-14T15:37:49Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:Illinois Editz]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 15:37, 14 August 2023
acc8be5e002eaab8bb5f127b9ff76647d17aa533
User:FarhanEditz
2
253
640
2023-08-15T11:11:34Z
FarhanEditz
19
Created page with "M. Khairul Farhan (better known as FarhanEditz) was born on 3rd July 2008 in Sabah,Malaysia. He has a dream to start a YouTube career in 2016/2017. He created various channel but much of them failed until his comeback in August 2022 as a Geotuber. Later become an Editor"
wikitext
text/x-wiki
M. Khairul Farhan (better known as FarhanEditz) was born on 3rd July 2008 in Sabah,Malaysia. He has a dream to start a YouTube career in 2016/2017. He created various channel but much of them failed until his comeback in August 2022 as a Geotuber. Later become an Editor
8245290f4bd88a6aed309e1141b57ff5146e6c0e
User talk:FarhanEditz
3
254
641
2023-08-16T07:18:23Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:FarhanEditz]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 07:18, 16 August 2023
ec21f1fff6c8d2dc824ed4441a51c287a68d9eef
Militarizatixn
0
255
644
2023-08-18T18:16:27Z
InsaneX
2
Created page with "'''Militarizatixn''' is a popular Mongolian-Chinese Geotuber known for creating YouTube videos related to geopolitics, history and current world affairs. As of August 2023, the channel has garnered 175,000 subscribers and over 26.3 million views. ==Personal Information== Militarizatixn was born on September 20th, 2008, in [https://en.wikipedia.org/wiki/Mongolia Mongolia]. He is currently 15 years old and resides in https://en.wikipedia.org/wiki/British_Columbia British..."
wikitext
text/x-wiki
'''Militarizatixn''' is a popular Mongolian-Chinese Geotuber known for creating YouTube videos related to geopolitics, history and current world affairs. As of August 2023, the channel has garnered 175,000 subscribers and over 26.3 million views.
==Personal Information==
Militarizatixn was born on September 20th, 2008, in [https://en.wikipedia.org/wiki/Mongolia Mongolia]. He is currently 15 years old and resides in https://en.wikipedia.org/wiki/British_Columbia British Columbia], [https://en.wikipedia.org/wiki/Canada Canada]. He is a follower of [https://en.wikipedia.org/wiki/Islam Islam].
==YouTube Career==
Militarizatixn began his YouTube career in 2017, initially focusing on gaming content like ''Geometry Dash'', ''Pixel Gun 3D'', and ''Roblox''. After a period of uploading miscellaneous content, Militarizatixn took a break from YouTube.
His return to YouTube marked a significant shift in content. Militarizatixn was inspired by fellow Geotuber ''It's Fire Sketcher'' to create videos on geography and geopolitics. With support from ''It's Fire Sketcher'' and by joining a group of Geotubers including ''R2X Mapping'', ''GlitchedGeography'', and ''That Turk Guy'', Militarizatixn began to gain popularity. He was motivated to improve his editing skills and create content that attracted a large audience.
Despite considering a shift to ''Who is Stronger'' (Anime Debate) content, Militarizatixn ultimately chose to continue with geo-related content, which has since become the primary focus of his channel. His videos cover a wide range of topics, including historical and contemporary geopolitical issues.
Militarizatixn's success on YouTube has also led him to branch out to other social media platforms, such as TikTok.
==External links==
* [https://www.youtube.com/c/Militarizatixn ''Militarizatixn'' on YouTube]
* [https://www.tiktok.com/@militarizatixn_ ''Militarizatixn'' on TikTok]
56d5d520117b68b8313db6ec071a870d5684de56
645
644
2023-08-18T18:16:52Z
InsaneX
2
/* External links */
wikitext
text/x-wiki
'''Militarizatixn''' is a popular Mongolian-Chinese Geotuber known for creating YouTube videos related to geopolitics, history and current world affairs. As of August 2023, the channel has garnered 175,000 subscribers and over 26.3 million views.
==Personal Information==
Militarizatixn was born on September 20th, 2008, in [https://en.wikipedia.org/wiki/Mongolia Mongolia]. He is currently 15 years old and resides in https://en.wikipedia.org/wiki/British_Columbia British Columbia], [https://en.wikipedia.org/wiki/Canada Canada]. He is a follower of [https://en.wikipedia.org/wiki/Islam Islam].
==YouTube Career==
Militarizatixn began his YouTube career in 2017, initially focusing on gaming content like ''Geometry Dash'', ''Pixel Gun 3D'', and ''Roblox''. After a period of uploading miscellaneous content, Militarizatixn took a break from YouTube.
His return to YouTube marked a significant shift in content. Militarizatixn was inspired by fellow Geotuber ''It's Fire Sketcher'' to create videos on geography and geopolitics. With support from ''It's Fire Sketcher'' and by joining a group of Geotubers including ''R2X Mapping'', ''GlitchedGeography'', and ''That Turk Guy'', Militarizatixn began to gain popularity. He was motivated to improve his editing skills and create content that attracted a large audience.
Despite considering a shift to ''Who is Stronger'' (Anime Debate) content, Militarizatixn ultimately chose to continue with geo-related content, which has since become the primary focus of his channel. His videos cover a wide range of topics, including historical and contemporary geopolitical issues.
Militarizatixn's success on YouTube has also led him to branch out to other social media platforms, such as TikTok.
==External Links==
* [https://www.youtube.com/c/Militarizatixn ''Militarizatixn'' on YouTube]
* [https://www.tiktok.com/@militarizatixn_ ''Militarizatixn'' on TikTok]
cd9422cd5ac350d054606d06b99b5ff36348a159
646
645
2023-08-18T18:17:15Z
InsaneX
2
/* Personal Information */
wikitext
text/x-wiki
'''Militarizatixn''' is a popular Mongolian-Chinese Geotuber known for creating YouTube videos related to geopolitics, history and current world affairs. As of August 2023, the channel has garnered 175,000 subscribers and over 26.3 million views.
==Personal Information==
Militarizatixn was born on September 20th, 2008, in [https://en.wikipedia.org/wiki/Mongolia Mongolia]. He is currently 15 years old and resides in [https://en.wikipedia.org/wiki/British_Columbia British Columbia], [https://en.wikipedia.org/wiki/Canada Canada]. He is a follower of [https://en.wikipedia.org/wiki/Islam Islam].
==YouTube Career==
Militarizatixn began his YouTube career in 2017, initially focusing on gaming content like ''Geometry Dash'', ''Pixel Gun 3D'', and ''Roblox''. After a period of uploading miscellaneous content, Militarizatixn took a break from YouTube.
His return to YouTube marked a significant shift in content. Militarizatixn was inspired by fellow Geotuber ''It's Fire Sketcher'' to create videos on geography and geopolitics. With support from ''It's Fire Sketcher'' and by joining a group of Geotubers including ''R2X Mapping'', ''GlitchedGeography'', and ''That Turk Guy'', Militarizatixn began to gain popularity. He was motivated to improve his editing skills and create content that attracted a large audience.
Despite considering a shift to ''Who is Stronger'' (Anime Debate) content, Militarizatixn ultimately chose to continue with geo-related content, which has since become the primary focus of his channel. His videos cover a wide range of topics, including historical and contemporary geopolitical issues.
Militarizatixn's success on YouTube has also led him to branch out to other social media platforms, such as TikTok.
==External Links==
* [https://www.youtube.com/c/Militarizatixn ''Militarizatixn'' on YouTube]
* [https://www.tiktok.com/@militarizatixn_ ''Militarizatixn'' on TikTok]
1324dc7848718ff30535e9da41590d29b8d5e28b
647
646
2023-08-18T18:19:58Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
'''Militarizatixn''' is a popular Mongolian-Chinese Geotuber known for creating YouTube videos related to geopolitics, history and current world affairs. As of August 2023, the channel has garnered 175,000 subscribers and over 26.3 million views.
==Personal Information==
Militarizatixn was born on September 20th, 2008, in [https://en.wikipedia.org/wiki/Mongolia Mongolia]. He is currently 15 years old and resides in [https://en.wikipedia.org/wiki/British_Columbia British Columbia], [https://en.wikipedia.org/wiki/Canada Canada]. He is a follower of [https://en.wikipedia.org/wiki/Islam Islam].
==YouTube Career==
Militarizatixn began his YouTube career in 2017, initially focusing on gaming content like [https://en.wikipedia.org/wiki/Geometry_Dash Geometry Dash], [https://en.wikipedia.org/wiki/Pixel_Gun_3D Pixel Gun 3D], and [https://en.wikipedia.org/wiki/Roblox Roblox]. After a period of uploading miscellaneous content, Militarizatixn took a break from YouTube.
His return to [https://en.wikipedia.org/wiki/YouTube YouTube] marked a significant shift in content. Militarizatixn was inspired by fellow Geotuber ''It's Fire Sketcher'' to create videos on geography and geopolitics. With support from ''It's Fire Sketcher'' and by joining a group of Geotubers including ''R2X Mapping'', ''GlitchedGeography'', and ''That Turk Guy'', Militarizatixn began to gain popularity. He was motivated to improve his editing skills and create content that attracted a large audience.
Despite considering a shift to ''Who is Stronger'' (Anime Debate) content, Militarizatixn ultimately chose to continue with geo-related content, which has since become the primary focus of his channel. His videos cover a wide range of topics, including historical and contemporary geopolitical issues.
Militarizatixn's success on YouTube has also led him to branch out to other social media platforms, such as [https://en.wikipedia.org/wiki/TikTok TikTok].
==External Links==
* [https://www.youtube.com/c/Militarizatixn ''Militarizatixn'' on YouTube]
* [https://www.tiktok.com/@militarizatixn_ ''Militarizatixn'' on TikTok]
d44b30cc230d3c2a3a725b12fe5e5ecaf2c08a84
648
647
2023-08-18T18:20:13Z
InsaneX
2
wikitext
text/x-wiki
'''Militarizatixn''' is a popular Mongolian-Chinese Geotuber known for creating [https://en.wikipedia.org/wiki/YouTube YouTube] videos related to geopolitics, history and current world affairs. As of August 2023, the channel has garnered 175,000 subscribers and over 26.3 million views.
==Personal Information==
Militarizatixn was born on September 20th, 2008, in [https://en.wikipedia.org/wiki/Mongolia Mongolia]. He is currently 15 years old and resides in [https://en.wikipedia.org/wiki/British_Columbia British Columbia], [https://en.wikipedia.org/wiki/Canada Canada]. He is a follower of [https://en.wikipedia.org/wiki/Islam Islam].
==YouTube Career==
Militarizatixn began his YouTube career in 2017, initially focusing on gaming content like [https://en.wikipedia.org/wiki/Geometry_Dash Geometry Dash], [https://en.wikipedia.org/wiki/Pixel_Gun_3D Pixel Gun 3D], and [https://en.wikipedia.org/wiki/Roblox Roblox]. After a period of uploading miscellaneous content, Militarizatixn took a break from YouTube.
His return to [https://en.wikipedia.org/wiki/YouTube YouTube] marked a significant shift in content. Militarizatixn was inspired by fellow Geotuber ''It's Fire Sketcher'' to create videos on geography and geopolitics. With support from ''It's Fire Sketcher'' and by joining a group of Geotubers including ''R2X Mapping'', ''GlitchedGeography'', and ''That Turk Guy'', Militarizatixn began to gain popularity. He was motivated to improve his editing skills and create content that attracted a large audience.
Despite considering a shift to ''Who is Stronger'' (Anime Debate) content, Militarizatixn ultimately chose to continue with geo-related content, which has since become the primary focus of his channel. His videos cover a wide range of topics, including historical and contemporary geopolitical issues.
Militarizatixn's success on YouTube has also led him to branch out to other social media platforms, such as [https://en.wikipedia.org/wiki/TikTok TikTok].
==External Links==
* [https://www.youtube.com/c/Militarizatixn ''Militarizatixn'' on YouTube]
* [https://www.tiktok.com/@militarizatixn_ ''Militarizatixn'' on TikTok]
140c25e959103966f8e0671e568c20f0ca22a482
649
648
2023-08-18T18:20:30Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
'''Militarizatixn''' is a popular Mongolian-Chinese Geotuber known for creating [https://en.wikipedia.org/wiki/YouTube YouTube] videos related to geopolitics, history and current world affairs. As of August 2023, the channel has garnered 175,000 subscribers and over 26.3 million views.
==Personal Information==
Militarizatixn was born on September 20th, 2008, in [https://en.wikipedia.org/wiki/Mongolia Mongolia]. He is currently 15 years old and resides in [https://en.wikipedia.org/wiki/British_Columbia British Columbia], [https://en.wikipedia.org/wiki/Canada Canada]. He is a follower of [https://en.wikipedia.org/wiki/Islam Islam].
==YouTube Career==
Militarizatixn began his YouTube career in 2017, initially focusing on gaming content like [https://en.wikipedia.org/wiki/Geometry_Dash Geometry Dash], [https://en.wikipedia.org/wiki/Pixel_Gun_3D Pixel Gun 3D], and [https://en.wikipedia.org/wiki/Roblox Roblox]. After a period of uploading miscellaneous content, Militarizatixn took a break from YouTube.
His return to [https://en.wikipedia.org/wiki/YouTube YouTube] marked a significant shift in content. Militarizatixn was inspired by fellow Geotuber ''It's Fire Sketcher'' to create videos on geography and geopolitics. With support from ''It's Fire Sketcher'' and by joining a group of Geotubers including ''R2X Mapping'', ''GlitchedGeography'', and ''That Turk Guy'', Militarizatixn began to gain popularity. He was motivated to improve his editing skills and create content that attracted a large audience.
Despite considering a shift to ''Who is Stronger'' (Anime Debate) content, Militarizatixn ultimately chose to continue with geo-related content, which has since become the primary focus of his channel. His videos cover a wide range of topics, including historical and contemporary geopolitical issues.
Militarizatixn's success on YouTube has also led him to branch out to other social media platforms, such as [https://en.wikipedia.org/wiki/TikTok TikTok].
==External Links==
* [https://www.youtube.com/c/Militarizatixn Militarizatixn on YouTube]
* [https://www.tiktok.com/@militarizatixn_ Militarizatixn on TikTok]
cf215904c78b17892ab6590570ca8545a82963ca
650
649
2023-08-18T18:20:50Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
'''Militarizatixn''' is a popular Mongolian-Chinese Geotuber known for creating [https://en.wikipedia.org/wiki/YouTube YouTube] videos related to geopolitics, history and current world affairs. As of August 2023, the channel has garnered 175,000 subscribers and over 26.3 million views.
==Personal Information==
Militarizatixn was born on September 20th, 2008, in [https://en.wikipedia.org/wiki/Mongolia Mongolia]. He is currently 15 years old and resides in [https://en.wikipedia.org/wiki/British_Columbia British Columbia], [https://en.wikipedia.org/wiki/Canada Canada]. He is a follower of [https://en.wikipedia.org/wiki/Islam Islam].
==YouTube Career==
Militarizatixn began his [https://en.wikipedia.org/wiki/YouTube YouTube] career in 2017, initially focusing on gaming content like [https://en.wikipedia.org/wiki/Geometry_Dash Geometry Dash], [https://en.wikipedia.org/wiki/Pixel_Gun_3D Pixel Gun 3D], and [https://en.wikipedia.org/wiki/Roblox Roblox]. After a period of uploading miscellaneous content, Militarizatixn took a break from YouTube.
His return to [https://en.wikipedia.org/wiki/YouTube YouTube] marked a significant shift in content. Militarizatixn was inspired by fellow Geotuber ''It's Fire Sketcher'' to create videos on geography and geopolitics. With support from ''It's Fire Sketcher'' and by joining a group of Geotubers including ''R2X Mapping'', ''GlitchedGeography'', and ''That Turk Guy'', Militarizatixn began to gain popularity. He was motivated to improve his editing skills and create content that attracted a large audience.
Despite considering a shift to ''Who is Stronger'' (Anime Debate) content, Militarizatixn ultimately chose to continue with geo-related content, which has since become the primary focus of his channel. His videos cover a wide range of topics, including historical and contemporary geopolitical issues.
Militarizatixn's success on YouTube has also led him to branch out to other social media platforms, such as [https://en.wikipedia.org/wiki/TikTok TikTok].
==External Links==
* [https://www.youtube.com/c/Militarizatixn Militarizatixn on YouTube]
* [https://www.tiktok.com/@militarizatixn_ Militarizatixn on TikTok]
59794e9d0958e3cad90d38764e407954252fb523
652
650
2023-08-18T18:22:43Z
InsaneX
2
wikitext
text/x-wiki
[[File:Militarizatixn_Logo.jpg|thumb|300px|Logo of Militarizatixn.]]
'''Militarizatixn''' is a popular Mongolian-Chinese Geotuber known for creating [https://en.wikipedia.org/wiki/YouTube YouTube] videos related to geopolitics, history and current world affairs. As of August 2023, the channel has garnered 175,000 subscribers and over 26.3 million views.
==Personal Information==
Militarizatixn was born on September 20th, 2008, in [https://en.wikipedia.org/wiki/Mongolia Mongolia]. He is currently 15 years old and resides in [https://en.wikipedia.org/wiki/British_Columbia British Columbia], [https://en.wikipedia.org/wiki/Canada Canada]. He is a follower of [https://en.wikipedia.org/wiki/Islam Islam].
==YouTube Career==
Militarizatixn began his [https://en.wikipedia.org/wiki/YouTube YouTube] career in 2017, initially focusing on gaming content like [https://en.wikipedia.org/wiki/Geometry_Dash Geometry Dash], [https://en.wikipedia.org/wiki/Pixel_Gun_3D Pixel Gun 3D], and [https://en.wikipedia.org/wiki/Roblox Roblox]. After a period of uploading miscellaneous content, Militarizatixn took a break from YouTube.
His return to [https://en.wikipedia.org/wiki/YouTube YouTube] marked a significant shift in content. Militarizatixn was inspired by fellow Geotuber ''It's Fire Sketcher'' to create videos on geography and geopolitics. With support from ''It's Fire Sketcher'' and by joining a group of Geotubers including ''R2X Mapping'', ''GlitchedGeography'', and ''That Turk Guy'', Militarizatixn began to gain popularity. He was motivated to improve his editing skills and create content that attracted a large audience.
Despite considering a shift to ''Who is Stronger'' (Anime Debate) content, Militarizatixn ultimately chose to continue with geo-related content, which has since become the primary focus of his channel. His videos cover a wide range of topics, including historical and contemporary geopolitical issues.
Militarizatixn's success on YouTube has also led him to branch out to other social media platforms, such as [https://en.wikipedia.org/wiki/TikTok TikTok].
==External Links==
* [https://www.youtube.com/c/Militarizatixn Militarizatixn on YouTube]
* [https://www.tiktok.com/@militarizatixn_ Militarizatixn on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
bd8f76a0751524d94a5c8f0bb630ab7517d041a4
File:Militarizatixn Logo.jpg
6
256
651
2023-08-18T18:21:48Z
InsaneX
2
Logo of Militarizatixn.
wikitext
text/x-wiki
== Summary ==
Logo of Militarizatixn.
f7a0d920fa1e8fc4b1f100d4ce754233f9ff0ba2
MightyGeoGuy
0
257
653
2023-08-19T11:09:32Z
InsaneX
2
Created page with "'''Ahmed Malik''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: احمد ملک) is a Pakistani Geotuber, best recognized for his YouTube channel, '''MightyGeoGuy'''. He is best known for his videos related to geography, including country comparisons, historical empires, and geopolitics topics. == Personal Information == Ahmed Malik was born on 20 April 2008 in Rawalpindi, Pakistan. As of now, he is residing in Islamabad, Pakistan. == YouTube Career == Ahmed Malik began..."
wikitext
text/x-wiki
'''Ahmed Malik''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: احمد ملک) is a Pakistani Geotuber, best recognized for his YouTube channel, '''MightyGeoGuy'''. He is best known for his videos related to geography, including country comparisons, historical empires, and geopolitics topics.
== Personal Information ==
Ahmed Malik was born on 20 April 2008 in Rawalpindi, Pakistan. As of now, he is residing in Islamabad, Pakistan.
== YouTube Career ==
Ahmed Malik began his YouTube career as a Geotuber on 25 June 2022, inspired by other YouTubers including NeiterAll Shorts, Cambodia ball officials, ExploitHistory, It's fire sketcher, Militarizatixn, and Azuriya. Throughout his career, he collaborated with fellow Geotubers and established a strong community of geography enthusiasts. On 17 April 2023, Ahmed decided to quit his YouTube career due to personal reasons.
== Content Type and Software Used ==
In the beginning, Malik used the video editing software ''CapCut''. Later on, he switched to ''Alight Motion'', and his first video edited with this software was created with the help of fellow Geotuber and his brother, ''DyaEditZ''. Initially, his content focused on "then vs now" edits, but he eventually expanded his repertoire to include Asia vs Europe comparisons, history-related videos, and content based on current trends and geopolitics topics. Despite his hiatus from YouTube, Malik has left the possibility open for a potential return to content creation.
== Alliances ==
During his YouTube career, Malik was part of several alliances with fellow Geotubers:
* '''KATO'''
* '''PSC'''
* '''SAE'''
== External Links ==
* [https://www.youtube.com/@MightyGeoGuy MightyGeoGuy on YouTube]
* [https://www.tiktok.com/@mightygeoguy MightyGeoGuy on TikTok]
14743319431978e028da83317b58807958916088
655
653
2023-08-19T11:13:14Z
InsaneX
2
wikitext
text/x-wiki
[[File:MightyGeoGuy_Logo.jpg|thumb|300px|Logo of MightyGeoGuy.]]
'''Ahmed Malik''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: احمد ملک) is a Pakistani Geotuber, best recognized for his YouTube channel, '''MightyGeoGuy'''. He is best known for his videos related to geography, including country comparisons, historical empires, and geopolitics topics.
== Personal Information ==
Ahmed Malik was born on 20 April 2008 in Rawalpindi, Pakistan. As of now, he is residing in Islamabad, Pakistan.
== YouTube Career ==
Ahmed Malik began his YouTube career as a Geotuber on 25 June 2022, inspired by other YouTubers including NeiterAll Shorts, Cambodia ball officials, ExploitHistory, It's fire sketcher, Militarizatixn, and Azuriya. Throughout his career, he collaborated with fellow Geotubers and established a strong community of geography enthusiasts. On 17 April 2023, Ahmed decided to quit his YouTube career due to personal reasons.
== Content Type and Software Used ==
In the beginning, Malik used the video editing software ''CapCut''. Later on, he switched to ''Alight Motion'', and his first video edited with this software was created with the help of fellow Geotuber and his brother, ''DyaEditZ''. Initially, his content focused on "then vs now" edits, but he eventually expanded his repertoire to include Asia vs Europe comparisons, history-related videos, and content based on current trends and geopolitics topics. Despite his hiatus from YouTube, Malik has left the possibility open for a potential return to content creation.
== Alliances ==
During his YouTube career, Malik was part of several alliances with fellow Geotubers:
* '''KATO'''
* '''PSC'''
* '''SAE'''
== External Links ==
* [https://www.youtube.com/@MightyGeoGuy MightyGeoGuy on YouTube]
* [https://www.tiktok.com/@mightygeoguy MightyGeoGuy on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
3bac6de8eb4ffb2b76a6179595152d71d33cc82c
656
655
2023-08-19T11:18:47Z
InsaneX
2
wikitext
text/x-wiki
[[File:MightyGeoGuy_Logo.jpg|thumb|300px|Logo of MightyGeoGuy.]]
'''Ahmed Malik''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: احمد ملک) is a Pakistani Geotuber, best recognized for his YouTube channel, '''MightyGeoGuy'''. He is best known for his videos related to geography, including country comparisons, historical empires, and geopolitics topics.
== Personal Information ==
Ahmed Malik was born on 20 April 2008 in [https://en.wikipedia.org/wiki/Rawalpindi Rawalpindi], https://en.wikipedia.org/wiki/Pakistan Pakistan]. As of now, he is residing in [https://en.wikipedia.org/wiki/Islamabad Islamabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan].
== YouTube Career ==
Ahmed Malik began his [https://en.wikipedia.org/wiki/YouTube YouTube] career as a Geotuber on 25 June 2022, inspired by other Geotubers including NeiterAll Shorts, Cambodia ball officials, ExploitHistory, It's fire sketcher, Militarizatixn, and Azuriya. Throughout his career, he collaborated with fellow Geotubers and established a strong community of geography enthusiasts. On 17 April 2023, Ahmed decided to quit his YouTube career due to personal reasons.
== Content Type and Software Used ==
In the beginning, Malik used the video editing software ''CapCut''. Later on, he switched to ''Alight Motion'', and his first video edited with this software was created with the help of fellow Geotuber and his brother, ''DyaEditZ''. Initially, his content focused on "then vs now" edits, but he eventually expanded his repertoire to include Asia vs Europe comparisons, history-related videos, and content based on current trends and geopolitics topics. Despite his hiatus from YouTube, Malik has left the possibility open for a potential return to content creation.
== Alliances ==
During his YouTube career, Malik was part of several alliances with fellow Geotubers:
* '''KATO'''
* '''PSC'''
* '''SAE'''
== External Links ==
* [https://www.youtube.com/@MightyGeoGuy MightyGeoGuy on YouTube]
* [https://www.tiktok.com/@mightygeoguy MightyGeoGuy on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
166fd6492935edcad27483095432067dea5eee9e
657
656
2023-08-19T12:09:45Z
InsaneX
2
wikitext
text/x-wiki
[[File:MightyGeoGuy_Logo.jpg|thumb|300px|Logo of MightyGeoGuy.]]
'''Ahmed Malik''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: احمد ملک) is a Pakistani Geotuber, best recognized for his YouTube channel, '''MightyGeoGuy'''. He is best known for his videos related to geography, including country comparisons, historical empires, and geopolitics topics.
== Personal Information ==
Ahmed Malik was born on 20 April 2008 in [https://en.wikipedia.org/wiki/Rawalpindi Rawalpindi], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. As of now, he is residing in [https://en.wikipedia.org/wiki/Islamabad Islamabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan].
== YouTube Career ==
Ahmed Malik began his [https://en.wikipedia.org/wiki/YouTube YouTube] career as a Geotuber on 25 June 2022, inspired by other Geotubers including NeiterAll Shorts, Cambodia ball officials, ExploitHistory, It's fire sketcher, Militarizatixn, and Azuriya. Throughout his career, he collaborated with fellow Geotubers and established a strong community of geography enthusiasts. On 17 April 2023, Ahmed decided to quit his YouTube career due to personal reasons.
== Content Type and Software Used ==
In the beginning, Malik used the video editing software ''CapCut''. Later on, he switched to ''Alight Motion'', and his first video edited with this software was created with the help of fellow Geotuber and his brother, ''DyaEditZ''. Initially, his content focused on "then vs now" edits, but he eventually expanded his repertoire to include Asia vs Europe comparisons, history-related videos, and content based on current trends and geopolitics topics. Despite his hiatus from YouTube, Malik has left the possibility open for a potential return to content creation.
== Alliances ==
During his YouTube career, Malik was part of several alliances with fellow Geotubers:
* '''KATO'''
* '''PSC'''
* '''SAE'''
== External Links ==
* [https://www.youtube.com/@MightyGeoGuy MightyGeoGuy on YouTube]
* [https://www.tiktok.com/@mightygeoguy MightyGeoGuy on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
b9d2954e9134416b9e606e573ba923b4172e43bb
File:MightyGeoGuy Logo.jpg
6
258
654
2023-08-19T11:12:24Z
InsaneX
2
Logo of MightyGeoGuy.
wikitext
text/x-wiki
== Summary ==
Logo of MightyGeoGuy.
ce4c7240950d59f9b6c41b1d270e1c4ca4a90ea8
Umar Edits
0
4
658
441
2023-08-19T14:57:05Z
InsaneX
2
wikitext
text/x-wiki
[[File:UmarEdits_Logo.jpg|thumb|right|300px|Logo of Umar Edits.]]
'''Umar Edits''' [Pakistan](https://en.wikipedia.org/wiki/Pakistan) is a big country.
d09986f1a709aa2100e9701cf78e8b716d514dd8
659
658
2023-08-19T14:58:22Z
InsaneX
2
wikitext
text/x-wiki
[[File:UmarEdits_Logo.jpg|thumb|right|300px|Logo of Umar Edits.]]
'''Umar Edits'''
f5b9ba2993709f659ddbc7a01b02bcf95f64ef29
Main Page
0
1
660
550
2023-08-19T15:04:23Z
InsaneX
2
/* Featured Geotuber */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content. Join our [https://discord.gg/aPXQ5ZMjH8 Discord Server] for more Information.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [https://en.wikipedia.org/wiki/Hyderabad,_Sindh Hyderabad], [[w:Pakistan Pakistan]]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geotubers]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 12, 2023:''' [[Abdullah do it all]] page was created!
* '''August 12, 2023:''' [[Glitch Editz]] page was created!
* '''August 12, 2023:''' [[OfficialEditzPK]] page was created!
* '''August 11, 2023:''' Geotubepedia was officially launched!
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:Copyrights | Geotubpedia Copyrights]]
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Help Desk|Help Desk]]
4df290b8710ebdc3fe1cf98380242ceffa9dc320
661
660
2023-08-19T15:05:36Z
InsaneX
2
/* Featured Geotuber */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content. Join our [https://discord.gg/aPXQ5ZMjH8 Discord Server] for more Information.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' (Urdu: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [[w:Hyderabad,_Sindh| Hyderabad]], [[w:Pakistan| Pakistan]]. He identifies as a [https://en.wikipedia.org/w/index.php?search=&title=Special%3ASearch Shia Muslim]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [https://en.wikipedia.org/wiki/Sharbat_(beverage) Sharbat] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geotubers]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 12, 2023:''' [[Abdullah do it all]] page was created!
* '''August 12, 2023:''' [[Glitch Editz]] page was created!
* '''August 12, 2023:''' [[OfficialEditzPK]] page was created!
* '''August 11, 2023:''' Geotubepedia was officially launched!
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:Copyrights | Geotubpedia Copyrights]]
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Help Desk|Help Desk]]
902294fbd0bf40a453f6d6d5de223f614ed6c5fc
662
661
2023-08-19T15:07:49Z
InsaneX
2
/* Featured Geotuber */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content. Join our [https://discord.gg/aPXQ5ZMjH8 Discord Server] for more Information.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Syed Samar''' ([[w:Urdu| Urdu]]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views. He was born on February 16, 2010, in [[w:Hyderabad,_Sindh| Hyderabad]], [[w:Pakistan| Pakistan]]. He identifies as a [[w:Shia Islam| Shia Muslim]]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [[w:Sharbat_(beverage)| Sharbat]] and Tea to an assortment of cold drinks including Pepsi, Coke, and water. [[Cartoonabad | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geotubers]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 12, 2023:''' [[Abdullah do it all]] page was created!
* '''August 12, 2023:''' [[Glitch Editz]] page was created!
* '''August 12, 2023:''' [[OfficialEditzPK]] page was created!
* '''August 11, 2023:''' Geotubepedia was officially launched!
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:Copyrights | Geotubpedia Copyrights]]
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Help Desk|Help Desk]]
e1e7907e6b086d565e13d2aab1f9b2f3732aed51
Abdullah do it all
0
219
665
587
2023-08-20T18:23:23Z
That muslim kid
9
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' [[W:urdu | Urdu]]: محمد عبداللہ ناصر) is a Bahraini Pakistani teenager known for his YouTube channel, '''Abdullah do it all'''. Born and residing in [[w:lahore | lahore]], [[w:Pakistan | Pakistan]] Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [[w:islam | Islam]], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on YouTube started in 2018 with the channel primarily focused on gaming content, especially around the game [[w:Geometry Dash Geometry Dash]]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber "World.military.king1", Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software Capcut to Alight Motion in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* Adobe After Effects
* Adobe Premiere Pro
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the Pakistan Youtube Shorts Editors Club (P.Y.S.E.C) alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
4c2c1c31d3e2476e8230ae9bdc062a2a3c243de7
666
665
2023-08-23T15:43:17Z
InsaneX
2
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' ([[W:urdu | Urdu]]: محمد عبداللہ ناصر) is a Bahraini Pakistani teenager known for his YouTube channel, '''Abdullah do it all'''. Born and residing in [[w:lahore | lahore]], [[w:Pakistan | Pakistan]] Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [[w:islam | Islam]], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on YouTube started in 2018 with the channel primarily focused on gaming content, especially around the game [[w:Geometry Dash Geometry Dash]]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber "World.military.king1", Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software Capcut to Alight Motion in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* Adobe After Effects
* Adobe Premiere Pro
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the Pakistan Youtube Shorts Editors Club (P.Y.S.E.C) alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
e794518bea01132f361113cd58cdc111d26df79a
667
666
2023-08-23T15:44:31Z
InsaneX
2
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' ([[W:Urdu | Urdu]]: محمد عبداللہ ناصر) is a Bahraini Pakistani teenager known for his YouTube channel, '''Abdullah do it all'''. Born and residing in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]] Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [[w:Islam | Islam]], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on YouTube started in 2018 with the channel primarily focused on gaming content, especially around the game [[w:Geometry Dash | Geometry Dash]]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber "World.military.king1", Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software ''Capcut'' to ''Alight Motion'' in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* Adobe After Effects
* Adobe Premiere Pro
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the '''Pakistan Youtube Shorts Editors Club (P.Y.S.E.C)''' alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
2fd01ba0fc37a8d6b6400d71a7bfd01e8cf2bce6
668
667
2023-08-23T15:46:07Z
InsaneX
2
/* Editing Style and Tools */
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' ([[W:Urdu | Urdu]]: محمد عبداللہ ناصر) is a Bahraini Pakistani teenager known for his YouTube channel, '''Abdullah do it all'''. Born and residing in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]] Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [[w:Islam | Islam]], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on YouTube started in 2018 with the channel primarily focused on gaming content, especially around the game [[w:Geometry Dash | Geometry Dash]]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber "World.military.king1", Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software ''Capcut'' to ''Alight Motion'' in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* [[w:Adobe After Effects | Adobe After Effects]]
* [[Adobe Premiere Pro | Adobe Premiere Pro]]
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the '''Pakistan Youtube Shorts Editors Club (P.Y.S.E.C)''' alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
892fd69210f67afc622e16e75cf3bb5d8bad662e
669
668
2023-08-23T15:46:22Z
InsaneX
2
/* Editing Style and Tools */
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' ([[W:Urdu | Urdu]]: محمد عبداللہ ناصر) is a Bahraini Pakistani teenager known for his YouTube channel, '''Abdullah do it all'''. Born and residing in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]] Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [[w:Islam | Islam]], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on YouTube started in 2018 with the channel primarily focused on gaming content, especially around the game [[w:Geometry Dash | Geometry Dash]]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber "World.military.king1", Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software ''Capcut'' to ''Alight Motion'' in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* [[w:Adobe After Effects | Adobe After Effects]]
* [[w:Adobe Premiere Pro | Adobe Premiere Pro]]
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the '''Pakistan Youtube Shorts Editors Club (P.Y.S.E.C)''' alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
a212a3120a8a919db24b2c365e41929bb90a9c7b
670
669
2023-08-23T15:46:44Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' ([[W:Urdu | Urdu]]: محمد عبداللہ ناصر) is a Bahraini Pakistani teenager known for his YouTube channel, '''Abdullah do it all'''. Born and residing in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]] Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [[w:Islam | Islam]], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on YouTube started in 2018 with the channel primarily focused on gaming content, especially around the game [[w:Geometry Dash | Geometry Dash]]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber ''World.military.king1'', Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software ''Capcut'' to ''Alight Motion'' in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* [[w:Adobe After Effects | Adobe After Effects]]
* [[w:Adobe Premiere Pro | Adobe Premiere Pro]]
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the '''Pakistan Youtube Shorts Editors Club (P.Y.S.E.C)''' alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
e8826a2a9ba5e781cc9b72e8a53f00469597ff71
671
670
2023-08-23T15:46:56Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' ([[W:Urdu | Urdu]]: محمد عبداللہ ناصر) is a Bahraini Pakistani teenager known for his YouTube channel, '''Abdullah do it all'''. Born and residing in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]] Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [[w:Islam | Islam]], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on [[w:YouTube]] started in 2018 with the channel primarily focused on gaming content, especially around the game [[w:Geometry Dash | Geometry Dash]]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber ''World.military.king1'', Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software ''Capcut'' to ''Alight Motion'' in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* [[w:Adobe After Effects | Adobe After Effects]]
* [[w:Adobe Premiere Pro | Adobe Premiere Pro]]
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the '''Pakistan Youtube Shorts Editors Club (P.Y.S.E.C)''' alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
972207234b6f505777eea535809f926318072853
672
671
2023-08-23T15:47:09Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' ([[W:Urdu | Urdu]]: محمد عبداللہ ناصر) is a Bahraini Pakistani teenager known for his YouTube channel, '''Abdullah do it all'''. Born and residing in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]] Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in Lahore, Pakistan. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [[w:Islam | Islam]], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on [[w:YouTube | YouTube]] started in 2018 with the channel primarily focused on gaming content, especially around the game [[w:Geometry Dash | Geometry Dash]]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber ''World.military.king1'', Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software ''Capcut'' to ''Alight Motion'' in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* [[w:Adobe After Effects | Adobe After Effects]]
* [[w:Adobe Premiere Pro | Adobe Premiere Pro]]
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the '''Pakistan Youtube Shorts Editors Club (P.Y.S.E.C)''' alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
68d49920c7b5cb1aef59543ff95cc6c9509f07fa
673
672
2023-08-23T15:47:29Z
InsaneX
2
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' ([[W:Urdu | Urdu]]: محمد عبداللہ ناصر) is a Bahraini Pakistani teenager known for his YouTube channel, '''Abdullah do it all'''. Born and residing in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]] Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]]. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [[w:Islam | Islam]], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on [[w:YouTube | YouTube]] started in 2018 with the channel primarily focused on gaming content, especially around the game [[w:Geometry Dash | Geometry Dash]]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber ''World.military.king1'', Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software ''Capcut'' to ''Alight Motion'' in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* [[w:Adobe After Effects | Adobe After Effects]]
* [[w:Adobe Premiere Pro | Adobe Premiere Pro]]
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the '''Pakistan Youtube Shorts Editors Club (P.Y.S.E.C)''' alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
3cff3382fc577d44ecb7578b0060b981f7cb8107
Glitch Editz
0
217
664
556
2023-08-20T19:00:13Z
That muslim kid
9
wikitext
text/x-wiki
[[File:Glitch_Editz_Logo.jpg|thumb|300px|Logo of Glitch Editz.]]
'''Glitch Editz''' is a well known American Geotuber known for his videos on geography, history, politics, and military edits.
== Personal Information ==
Glitch Editz was born on 2009, in [[ w:Los Angeles |Los Angeles]], [[w:California | California]], USA. He is currently 14 years old and still resides in Los Angeles.
== YouTube Career ==
Glitch Editz launched his YouTube channel in January 2021, initially focusing on content related to ''Minecraft'' on the Bedrock Edition, specifically within the Hive gaming server. He continued this theme until the channel reached 309 subscribers, after which he stopped uploading and deleted all of his content.
The channel remained inactive until he discovered geo-related content on [[w:YouTube Shorts | YouTube Shorts]], which inspired him to shift his content focus. This led to the rebirth of his channel, and he began producing geography-based content on September 25, 2022. His wide-ranging content includes topics such as geography, history, politics, and military-themed edits.
When producing Nationalist Edits, Glitch Editz utilizes a range of software tools including CapCut, Picsart, and ibisPaint X, all on his iPad. For his "Country VS Country" edits, CapCut on the iPad is his tool of choice. For mapping-related content, he uses ibis Paint X and CapCut on his iPhone.
== Statistics ==
As of now, Glitch Editz's YouTube channel has amassed 13.8K subscribers and has garnered 6.4 million total views.
== External Links ==
* [https://www.youtube.com/@glitch_editz/ Glitch Editz on YouTube]
* [https://www.tiktok.com/@zglitch_editz Glitch Editz on TikTok]
* [https://open.spotify.com/user/hwuokva73rytudbtu5sqra0k1 Glitch Editz on Spotify]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
d5ef3662c0fdc459488958c5cf781694a3e53879
User:Qosin monkey
2
259
663
2023-08-22T00:20:08Z
Qosin monkey
30
Created page with "this is truly a despicable me moment"
wikitext
text/x-wiki
this is truly a despicable me moment
f10d462020222d0ad733c437f094f992ad36ed6d
User talk:Qosin monkey
3
260
674
2023-08-23T15:27:30Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:Qosin monkey]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 15:27, 23 August 2023
e8c8eeca7fc686ee1be889fb33e08e7020738e7a
File:Falaqpfp1.jpg
6
262
678
2023-08-23T15:48:35Z
Falaq
21
First Pfp of Falaq
wikitext
text/x-wiki
== Summary ==
First Pfp of Falaq
abbd1c304ed9856841205fd4513ede0e7ac4e431
AHZ
0
246
683
628
2023-08-24T16:26:37Z
That muslim kid
9
wikitext
text/x-wiki
[[File:AHZ_Logo.jpg|thumb|300px|Logo of AHZ.]]
'''Ahmet''' is an Azerbaijani Geotuber known for his YouTube channel '''AHZ'''. Born in 2007 in [https://en.wikipedia.org/wiki/Azerbaijan Azerbaijan], Ahmet later moved to [https://en.wikipedia.org/wiki/Canada Canada].
== Early Life ==
Ahmet's early life was marked by challenges, as he was born into a low-income family in Azerbaijan. Despite these hardships, Ahmet found solace and passion in the digital world.
== YouTube Career ==
Ahmet's journey on [[W: YouTube| Youtube]] began as a mapper, inspired by creators like Balkan Mapping. However, his interests soon shifted to the Geotuber community, intrigued by the advanced edits and creative potential. In his videos, Ahmet primarily creates Islamic and [[W:Turanism | Turanist]] edits, reflecting his personal beliefs as both an Islamist and a pan-Turanist. To create these edits, he often uses software tools like ''Capcut'' and ''Picsart''.
Ahmet's contributions and unique style have earned him a dedicated following, boasting 19.3K subscribers and nearly 8.8 million views on his channel.
== Alliances ==
Ahmet is an active member of the '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)''', an alliance within the Geo community that focuses on collaborative content creation.
== External Links ==
* [https://youtube.com/@ahz_editz.53 AHZ on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
0194b220021c45728c2931d9ae8734150aca8f14
684
683
2023-08-24T17:24:15Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
[[File:AHZ_Logo.jpg|thumb|300px|Logo of AHZ.]]
'''Ahmet''' is an Azerbaijani Geotuber known for his YouTube channel '''AHZ'''. Born in 2007 in [https://en.wikipedia.org/wiki/Azerbaijan Azerbaijan], Ahmet later moved to [https://en.wikipedia.org/wiki/Canada Canada].
== Early Life ==
Ahmet's early life was marked by challenges, as he was born into a low-income family in Azerbaijan. Despite these hardships, Ahmet found solace and passion in the digital world.
== YouTube Career ==
Ahmet's journey on [[W:YouTube| YouTube]] began as a mapper, inspired by creators like Balkan Mapping. However, his interests soon shifted to the Geotuber community, intrigued by the advanced edits and creative potential. In his videos, Ahmet primarily creates Islamic and [[W:Turanism | Turanist]] edits, reflecting his personal beliefs as both an Islamist and a pan-Turanist. To create these edits, he often uses software tools like ''Capcut'' and ''Picsart''.
Ahmet's contributions and unique style have earned him a dedicated following, boasting 19.3K subscribers and nearly 8.8 million views on his channel.
== Alliances ==
Ahmet is an active member of the '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)''', an alliance within the Geo community that focuses on collaborative content creation.
== External Links ==
* [https://youtube.com/@ahz_editz.53 AHZ on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
5cf9439172dcdcdebc56b35c65deac4eaba029a0
685
684
2023-08-24T17:25:10Z
InsaneX
2
wikitext
text/x-wiki
[[File:AHZ_Logo.jpg|thumb|300px|Logo of AHZ.]]
'''Ahmet''' is an Azerbaijani Geotuber known for his YouTube channel '''AHZ'''. Born in 2007 in [[w:Azerbaijan|Azerbaijan]], Ahmet later moved to [[w:Canada| Canada].
== Early Life ==
Ahmet's early life was marked by challenges, as he was born into a low-income family in Azerbaijan. Despite these hardships, Ahmet found solace and passion in the digital world.
== YouTube Career ==
Ahmet's journey on [[W:YouTube| YouTube]] began as a mapper, inspired by creators like Balkan Mapping. However, his interests soon shifted to the Geotuber community, intrigued by the advanced edits and creative potential. In his videos, Ahmet primarily creates Islamic and [[W:Turanism | Turanist]] edits, reflecting his personal beliefs as both an Islamist and a pan-Turanist. To create these edits, he often uses software tools like ''Capcut'' and ''Picsart''.
Ahmet's contributions and unique style have earned him a dedicated following, boasting 19.3K subscribers and nearly 8.8 million views on his channel.
== Alliances ==
Ahmet is an active member of the '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)''', an alliance within the Geo community that focuses on collaborative content creation.
== External Links ==
* [https://youtube.com/@ahz_editz.53 AHZ on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
bb0e135183b574e907dfb755a07e22ecc2de6494
686
685
2023-08-24T17:25:20Z
InsaneX
2
wikitext
text/x-wiki
[[File:AHZ_Logo.jpg|thumb|300px|Logo of AHZ.]]
'''Ahmet''' is an Azerbaijani Geotuber known for his YouTube channel '''AHZ'''. Born in 2007 in [[w:Azerbaijan|Azerbaijan]], Ahmet later moved to [[w:Canada| Canada]].
== Early Life ==
Ahmet's early life was marked by challenges, as he was born into a low-income family in Azerbaijan. Despite these hardships, Ahmet found solace and passion in the digital world.
== YouTube Career ==
Ahmet's journey on [[W:YouTube| YouTube]] began as a mapper, inspired by creators like Balkan Mapping. However, his interests soon shifted to the Geotuber community, intrigued by the advanced edits and creative potential. In his videos, Ahmet primarily creates Islamic and [[W:Turanism | Turanist]] edits, reflecting his personal beliefs as both an Islamist and a pan-Turanist. To create these edits, he often uses software tools like ''Capcut'' and ''Picsart''.
Ahmet's contributions and unique style have earned him a dedicated following, boasting 19.3K subscribers and nearly 8.8 million views on his channel.
== Alliances ==
Ahmet is an active member of the '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)''', an alliance within the Geo community that focuses on collaborative content creation.
== External Links ==
* [https://youtube.com/@ahz_editz.53 AHZ on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
d369646073bf94aa93b976d2da46961d05b1cedc
Based.Saudi.Bangladeshi.21
0
240
693
619
2023-08-24T16:36:37Z
That muslim kid
9
wikitext
text/x-wiki
[[File:Based.saudi.bangladeshi.21_Logo.jpg|thumb|300px|Logo of Based.Saudi.Bangladeshi.21.]]
'''Ahmed Salman''' [[W:Arabic | Arabic]]: أحمد سلمان; [[W:Bengali_language Bangla]]: আহমেদ সালমান) is a Geotuber prominently known for his [[w:YouTube | YouTube]] channel '''Based.Saudi.Bangladeshi.21'''. Born on May 6, 2009, in [[W:Taif | Taif]], [[w:Mecca_Province | Mecca province]], [[w:Saudi_Arabia | Saudi Arabia]], he relocated to [[w:Dhaka | Dhaka]], [[w:Bangladesh | Bangladesh]], in September 2021 and later moved permanently to [[w:Sirajganj_District | Sirajganj]], [[w:Rajshahi_District | Rajshahi District]], [[w:Bangladesh | Bangladesh]], in March 2023.
== Early Life and Background ==
Ahmed's initial exposure to YouTube was in 2019 when he launched his first channel. Despite gaining 25k views and 258 subscribers, he deleted the channel due to familial pressures. With his family's subsequent consent, Ahmed launched his second YouTube channel on October 3, 2022. He drew inspiration from the YouTuber Based Iraqi 21, now popularly referred to as Iraqi Muslim, naming his channel in a similar vein. Ahmed possesses a profound interest in politics and history, advocating for the [[w:Bangladesh_Nationalist_Party | BNP (Bangladesh Nationalist Party)]] in Bangladesh and supporting [[w:Monarchy | monarchy]] in Saudi Arabia.
== YouTube and Instagram Presence ==
While Ahmed's YouTube career began with a setback, his determination led him to a second venture in 2022, heavily inspired by other content creators. On [[w:instagram | Instagram]], Ahmed, under the name '''سلمان أحمد''', initially achieved recognition when one of his anime-related posts, specifically about [[w:Demon_Slayer:_Kimetsu_no_Yaiba | Demon Slayer]], accumulated 354k views. While he primarily focuses on geo content, his passion for anime, particularly Demon Slayer, often translates into his Instagram posts where he shares edited anime content. Ahmed frequently engages on Instagram, making him quite accessible to his followers. Surprised by the reach of his anime post, Ahmed's following has since grown to almost 500.
== Editing Styles and Tools ==
Initially, Ahmed began his editing journey using InShot. However, as he sought to improve and diversify his editing skills, he transitioned to software like CapCut and is currently acquainting himself with Alight Motion.
== Alliances ==
Ahmed Salman is an active member of multiple alliances within the Geo community. These alliances foster collaboration among their members, allowing for the creation of joint edits and shared geo-content. His memberships include:
* '''Pakistan Geotuber Alliance (P.G.A)'''
* '''United Alliance of Geotuber (U.A.G)'''
* '''United States Geotuber Alliance (U.S.G.A)'''
* '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'''
== External Links ==
* [https://youtube.com/@Based.Saudi.Bangladeshi.21 Based.Saudi.Bangladeshi.21 on YouTube]
* [https://instagram.com/ahmed.salman21 Based.Saudi.Bangladeshi.21 on Instagram]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
998ddb988059c68d45b69cd09ab4ee49242bdbfe
694
693
2023-08-24T17:34:07Z
InsaneX
2
wikitext
text/x-wiki
[[File:Based.saudi.bangladeshi.21_Logo.jpg|thumb|300px|Logo of Based.Saudi.Bangladeshi.21.]]
'''Ahmed Salman''' [[W:Arabic | Arabic]]: أحمد سلمان; [[W:Bengali_language|Bangla]]: আহমেদ সালমান) is a Geotuber prominently known for his [[w:YouTube | YouTube]] channel '''Based.Saudi.Bangladeshi.21'''. Born on May 6, 2009, in [[W:Taif | Taif]], [[w:Mecca_Province | Mecca province]], [[w:Saudi_Arabia | Saudi Arabia]], he relocated to [[w:Dhaka | Dhaka]], [[w:Bangladesh | Bangladesh]], in September 2021 and later moved permanently to [[w:Sirajganj_District | Sirajganj]], [[w:Rajshahi_District | Rajshahi District]], [[w:Bangladesh | Bangladesh]], in March 2023.
== Early Life and Background ==
Ahmed's initial exposure to YouTube was in 2019 when he launched his first channel. Despite gaining 25k views and 258 subscribers, he deleted the channel due to familial pressures. With his family's subsequent consent, Ahmed launched his second YouTube channel on October 3, 2022. He drew inspiration from the YouTuber Based Iraqi 21, now popularly referred to as Iraqi Muslim, naming his channel in a similar vein. Ahmed possesses a profound interest in politics and history, advocating for the [[w:Bangladesh_Nationalist_Party | BNP (Bangladesh Nationalist Party)]] in Bangladesh and supporting [[w:Monarchy | monarchy]] in Saudi Arabia.
== YouTube and Instagram Presence ==
While Ahmed's YouTube career began with a setback, his determination led him to a second venture in 2022, heavily inspired by other content creators. On [[w:Instagram | Instagram]], Ahmed, under the name '''سلمان أحمد''', initially achieved recognition when one of his anime-related posts, specifically about [[w:Demon_Slayer:_Kimetsu_no_Yaiba | Demon Slayer]], accumulated 354k views. While he primarily focuses on Geo content, his passion for anime, particularly Demon Slayer, often translates into his Instagram posts where he shares edited anime content. Ahmed frequently engages on Instagram, making him quite accessible to his followers. Surprised by the reach of his anime post, Ahmed's following has since grown to almost 500.
== Editing Styles and Tools ==
Initially, Ahmed began his editing journey using ''InShot''. However, as he sought to improve and diversify his editing skills, he transitioned to software like ''CapCut'' and is currently acquainting himself with ''Alight Motion''.
== Alliances ==
Ahmed Salman is an active member of multiple alliances within the Geo community. These alliances foster collaboration among their members, allowing for the creation of joint edits and shared geo-content. His memberships include:
* '''Pakistan Geotuber Alliance (P.G.A)'''
* '''United Alliance of Geotuber (U.A.G)'''
* '''United States Geotuber Alliance (U.S.G.A)'''
* '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'''
== External Links ==
* [https://youtube.com/@Based.Saudi.Bangladeshi.21 Based.Saudi.Bangladeshi.21 on YouTube]
* [https://instagram.com/ahmed.salman21 Based.Saudi.Bangladeshi.21 on Instagram]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
41a40e3b41b66a744245757d85fbd3c547b1c31d
Militarizatixn
0
255
691
652
2023-08-24T16:43:03Z
That muslim kid
9
wikitext
text/x-wiki
[[File:Militarizatixn_Logo.jpg|thumb|300px|Logo of Militarizatixn.]]
'''Militarizatixn''' is a popular Mongolian-Chinese Geotuber known for creating [[w:YouTube | YouTube]] videos related to geopolitics, history and current world affairs. As of August 2023, the channel has garnered 175,000 subscribers and over 26.3 million views.
==Personal Information==
Militarizatixn was born on September 20th, 2008, in [[w:Mongolia | Mongolia]]. He is currently 15 years old and resides in [[w:British_Columbia | British Columbia]], [[w:Canada | Canada]]. He is a follower of [[w:islam | Islam]].
==YouTube Career==
Militarizatixn began his [[w:YouTube | YouTube]] career in 2017, initially focusing on gaming content like [[w:Geometry_Dash | Geometry Dash]], [[w:Pixel_Gun_3D | Pixel Gun 3D]], and [[w:Roblox | Roblox]]. After a period of uploading miscellaneous content, Militarizatixn took a break from YouTube.
His return to [[w:YouTube | YouTube]] marked a significant shift in content. Militarizatixn was inspired by fellow Geotuber ''It's Fire Sketcher'' to create videos on geography and geopolitics. With support from ''It's Fire Sketcher'' and by joining a group of Geotubers including ''R2X Mapping'', ''GlitchedGeography'', and ''That Turk Guy'', Militarizatixn began to gain popularity. He was motivated to improve his editing skills and create content that attracted a large audience.
Despite considering a shift to ''Who is Stronger'' (Anime Debate) content, Militarizatixn ultimately chose to continue with geo-related content, which has since become the primary focus of his channel. His videos cover a wide range of topics, including historical and contemporary geopolitical issues.
Militarizatixn's success on YouTube has also led him to branch out to other social media platforms, such as [https://en.wikipedia.org/wiki/TikTok TikTok].
==External Links==
* [https://www.youtube.com/c/Militarizatixn Militarizatixn on YouTube]
* [https://www.tiktok.com/@militarizatixn_ Militarizatixn on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
22b05bdcfb67e7d13f8ff26a6e6647599bb3b815
692
691
2023-08-24T17:30:45Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
[[File:Militarizatixn_Logo.jpg|thumb|300px|Logo of Militarizatixn.]]
'''Militarizatixn''' is a popular Mongolian-Chinese Geotuber known for creating [[w:YouTube | YouTube]] videos related to geopolitics, history and current world affairs. As of August 2023, the channel has garnered 175,000 subscribers and over 26.3 million views.
==Personal Information==
Militarizatixn was born on September 20th, 2008, in [[w:Mongolia | Mongolia]]. He is currently 15 years old and resides in [[w:British_Columbia | British Columbia]], [[w:Canada | Canada]]. He is a follower of [[w:islam | Islam]].
==YouTube Career==
Militarizatixn began his [[w:YouTube | YouTube]] career in 2017, initially focusing on gaming content like [[w:Geometry_Dash | Geometry Dash]], [[w:Pixel_Gun_3D | Pixel Gun 3D]], and [[w:Roblox | Roblox]]. After a period of uploading miscellaneous content, Militarizatixn took a break from YouTube.
His return to [[w:YouTube | YouTube]] marked a significant shift in content. Militarizatixn was inspired by fellow Geotuber ''It's Fire Sketcher'' to create videos on geography and geopolitics. With support from ''It's Fire Sketcher'' and by joining a group of Geotubers including ''R2X Mapping'', ''GlitchedGeography'', and ''That Turk Guy'', Militarizatixn began to gain popularity. He was motivated to improve his editing skills and create content that attracted a large audience.
Despite considering a shift to ''Who is Stronger'' (Anime Debate) content, Militarizatixn ultimately chose to continue with geo-related content, which has since become the primary focus of his channel. His videos cover a wide range of topics, including historical and contemporary geopolitical issues.
Militarizatixn's success on YouTube has also led him to branch out to other social media platforms, such as [[w:TikTok|TikTok]].
==External Links==
* [https://www.youtube.com/c/Militarizatixn Militarizatixn on YouTube]
* [https://www.tiktok.com/@militarizatixn_ Militarizatixn on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
6ec4f239e72e094a60e403e24601d4d2ed6cfce1
Braslezian
0
230
689
606
2023-08-24T16:46:35Z
That muslim kid
9
/* Biography */
wikitext
text/x-wiki
[[File:Braslezian_Logo.jpg|thumb|300px|Logo of Braslezian.]]
'''Braslezian''' is a Brazilian Geotuber known for his content primarily focused on comparing countries, empires, and other geographical elements. His work on YouTube began after being inspired by other creators in the Geotuber community, most notably The Cornunist. As of August 13th, the channel boasts 524 subscribers and has accumulated over 134K views.
== Biography ==
Braslezian was born on October 1st, 2011, in [[w:Brazil | Brazil]]. He discovered his passion for geography-related content on YouTube, which later drove him to create his own videos.
== YouTube Career ==
Braslezian's journey into the world of Geotubing started when he began watching videos related to geography, countryball animations, and edits. One of the first channels that he watched using his account was ''Cornunist''. Influenced by the Cornunist's content, Braslezian produced his debut video. Over the course of his YouTube career, he has utilized software such as ''Capcut'' for most of his video edits. However, he occasionally experiments and makes edits with ''Adobe Premiere Pro''.
== Alliances ==
Braslezian is a part of the ''S.A.T.O'' and ''Nationalitia'' alliances within the Geo community.
== External Links ==
* [https://www.youtube.com/@Braslezian Braslezian on YouTube]
* [https://discord.gg/7W6x9JhAMs Braslezian's Discord Server]
[[Category: List of Geotubers]]
97566d236b2116867bb4ef05d298120451d357e2
690
689
2023-08-24T17:29:21Z
InsaneX
2
wikitext
text/x-wiki
[[File:Braslezian_Logo.jpg|thumb|300px|Logo of Braslezian.]]
'''Braslezian''' is a Brazilian Geotuber known for his content primarily focused on comparing countries, empires, and other geographical elements. His work on [[w:YouTube|YouTube]] began after being inspired by other creators in the Geotuber community, most notably ''Cornunist''. As of August 13th, the channel boasts 524 subscribers and has accumulated over 134K views.
== Biography ==
Braslezian was born on October 1st, 2011, in [[w:Brazil | Brazil]]. He discovered his passion for geography-related content on YouTube, which later drove him to create his own videos.
== YouTube Career ==
Braslezian's journey into the world of Geotubing started when he began watching videos related to geography, countryball animations, and edits. One of the first channels that he watched using his account was ''Cornunist''. Influenced by Cornunist's content, Braslezian produced his debut video. Over the course of his YouTube career, he has utilized software such as ''Capcut'' for most of his video edits. However, he occasionally experiments and makes edits with ''Adobe Premiere Pro''.
== Alliances ==
Braslezian is a part of the ''S.A.T.O'' and ''Nationalitia'' alliances within the Geo community.
== External Links ==
* [https://www.youtube.com/@Braslezian Braslezian on YouTube]
* [https://discord.gg/7W6x9JhAMs Braslezian's Discord Server]
[[Category: List of Geotubers]]
c74b89e7c5cb938892b489fac03cf205416bdb04
Cartoonabad
0
169
687
554
2023-08-24T16:51:29Z
That muslim kid
9
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([[w:Urdu | Urdu]: سید ثمر) is a Pakistani Geotuber, best recognized for his YouTube channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [[w:Hyderabad,_Sindh | Hyderabad]], [[W:Pakistan | Pakistan]]. He identifies as a [[w:Shia Islam | Shia Muslim]]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [[w:Sharbat_(beverage) | Sharbat]] and Tea to an assortment of cold drinks including Pepsi, Coke, and water.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [[w:Hindi Hindi]]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.youtube.com/@Cartoonabad Cartoonabad (Second channel) on YouTube]
* [https://www.youtube.com/@Cartoonabad_OG Cartoonabad (Third channel) on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
9ca53a3b932e3d3fb570bd1c9ac0f28c86e1fdab
688
687
2023-08-24T17:27:35Z
InsaneX
2
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([[w:Urdu | Urdu]]: سید ثمر) is a Pakistani Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Cartoonabad'''. As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [[w:Hyderabad,_Sindh | Hyderabad]], [[W:Pakistan | Pakistan]]. He identifies as a [[w:Shia Islam | Shia Muslim]]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [[w:Sharbat_(beverage) | Sharbat]] and Tea to an assortment of cold drinks including [[w:Pepsi|Pepsi]], [[w:Coca-Cola|Coke]], and water.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [[w:Hindi|Hindi]]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D images. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.youtube.com/@Cartoonabad Cartoonabad (Second channel) on YouTube]
* [https://www.youtube.com/@Cartoonabad_OG Cartoonabad (Third channel) on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
a4e40393b3eed05f1df97d16bacb4a137709243c
705
688
2023-08-25T16:13:19Z
Cartoonabad
36
/* Personal Life */Added content
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|300px|Logo of Cartoonabad.]]
'''Sindhi Patriot''' Formerly Known as '''Cartoonabad''' is a YouTube channel started by
'''Syed Samar''' ([[w:Urdu | Urdu]]: سید ثمر) is a Pakistani Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Sindhi Patriot'''( Cartoonabad). As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [[w:Hyderabad,_Sindh | Hyderabad]], [[W:Pakistan | Pakistan]]. He identifies as a [[w:Shia Islam | Shia Muslim]]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [[w:Sharbat_(beverage) | Sharbat]] and Tea to an assortment of cold drinks including [[w:Pepsi|Pepsi]], [[w:Coca-Cola|Coke]], and water.
Cartoonabad is 13 year old boy and he has few goals of his life these goals are to Stop LGBT, Become a Shia Alim, Become a Doctor, Become a Successful YouTuber , Give Independence to Sindhudesh and Biggest of them all try to be a good Muslim
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [[w:Hindi|Hindi]]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D app. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.youtube.com/@Cartoonabad Cartoonabad (Second channel) on YouTube]
* [https://www.youtube.com/@Cartoonabad_OG Cartoonabad (Third channel) on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
dab38d318f3f8421fc9f44b643ba4cd9480db4b1
706
705
2023-08-26T09:42:17Z
InsaneX
2
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([[w:Urdu | Urdu]]: سید ثمر) is a Pakistani Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Sindhi Patriot'''(previously '''Cartoonabad'''). As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [[w:Hyderabad,_Sindh | Hyderabad]], [[W:Pakistan | Pakistan]]. He identifies as a [[w:Shia Islam | Shia Muslim]]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [[w:Sharbat_(beverage) | Sharbat]] and Tea to an assortment of cold drinks including [[w:Pepsi|Pepsi]], [[w:Coca-Cola|Coke]], and water. His main goals include stopping LGBT, becoming a Shia Muslim scholar, becoming a Doctor, Become a Successful YouTuber, Give Independence to Sindhudesh and Biggest of them all try to be a good Muslim.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [[w:Hindi|Hindi]]. Samar's YouTube trajectory took a turn when he started creating country ball animations using Prisma 3D app. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.youtube.com/@Cartoonabad Cartoonabad (Second channel) on YouTube]
* [https://www.youtube.com/@Cartoonabad_OG Cartoonabad (Third channel) on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
7e124d2090c67d71fa49452655b114cc8bcef848
707
706
2023-08-26T13:03:46Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([[w:Urdu | Urdu]]: سید ثمر) is a Pakistani Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Sindhi Patriot'''(previously '''Cartoonabad'''). As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [[w:Hyderabad,_Sindh | Hyderabad]], [[W:Pakistan | Pakistan]]. He identifies as a [[w:Shia Islam | Shia Muslim]]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [[w:Sharbat_(beverage) | Sharbat]] and Tea to an assortment of cold drinks including [[w:Pepsi|Pepsi]], [[w:Coca-Cola|Coke]], and water. His main goals include stopping LGBT, becoming a Shia Muslim scholar, becoming a Doctor, Become a Successful YouTuber, Give Independence to Sindhudesh and Biggest of them all try to be a good Muslim.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [[w:Hindi|Hindi]]. Samar's YouTube trajectory took a turn when he started creating country ball animations using ''Prisma3D''. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.youtube.com/@Cartoonabad Cartoonabad (Second channel) on YouTube]
* [https://www.youtube.com/@Cartoonabad_OG Cartoonabad (Third channel) on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
ca00040c187eb10e81230d8e48dcef8717b460e3
708
707
2023-08-26T13:04:02Z
InsaneX
2
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([[w:Urdu | Urdu]]: سید ثمر) is a Pakistani Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Sindhi Patriot''' (previously '''Cartoonabad'''). As of August 10th, the channel boasts 1.67K subscribers and has accumulated over 607,937 views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [[w:Hyderabad,_Sindh | Hyderabad]], [[W:Pakistan | Pakistan]]. He identifies as a [[w:Shia Islam | Shia Muslim]]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [[w:Sharbat_(beverage) | Sharbat]] and Tea to an assortment of cold drinks including [[w:Pepsi|Pepsi]], [[w:Coca-Cola|Coke]], and water. His main goals include stopping LGBT, becoming a Shia Muslim scholar, becoming a Doctor, Become a Successful YouTuber, Give Independence to Sindhudesh and Biggest of them all try to be a good Muslim.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [[w:Hindi|Hindi]]. Samar's YouTube trajectory took a turn when he started creating country ball animations using ''Prisma3D''. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.youtube.com/@Cartoonabad Cartoonabad (Second channel) on YouTube]
* [https://www.youtube.com/@Cartoonabad_OG Cartoonabad (Third channel) on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
1f01c9b1eb34b6ed3ee69a8d8a4a0ab37bb1d8b7
709
708
2023-08-26T13:06:10Z
InsaneX
2
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([[w:Urdu | Urdu]]: سید ثمر) is a Pakistani Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Sindhi Patriot''' (previously '''Cartoonabad'''). As of August 10th, the channel has 1.67K subscribers and has received over 607K views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [[w:Hyderabad,_Sindh | Hyderabad]], [[W:Pakistan | Pakistan]]. He identifies as a [[w:Shia Islam | Shia Muslim]]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [[w:Sharbat_(beverage) | Sharbat]] and Tea to an assortment of cold drinks including [[w:Pepsi|Pepsi]], [[w:Coca-Cola|Coke]], and water. His main goals include stopping LGBT, becoming a Shia Muslim scholar, becoming a Doctor, Become a Successful YouTuber, Give Independence to Sindhudesh and Biggest of them all try to be a good Muslim.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [[w:Hindi|Hindi]]. Samar's YouTube trajectory took a turn when he started creating country ball animations using ''Prisma3D''. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.youtube.com/@Cartoonabad Cartoonabad (Second channel) on YouTube]
* [https://www.youtube.com/@Cartoonabad_OG Cartoonabad (Third channel) on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
6d88632333b512d3a4d2336656fd21fa4c2456b9
710
709
2023-08-26T13:10:48Z
InsaneX
2
/* Personal Life */
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([[w:Urdu | Urdu]]: سید ثمر) is a Pakistani Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Sindhi Patriot''' (previously '''Cartoonabad'''). As of August 10th, the channel has 1.67K subscribers and has received over 607K views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [[w:Hyderabad,_Sindh | Hyderabad]], [[W:Pakistan | Pakistan]]. He identifies as a [[w:Shia Islam | Shia Muslim]]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [[w:Sharbat_(beverage) | Sharbat]] and Tea to an assortment of cold drinks including [[w:Pepsi|Pepsi]] and [[w:Coca-Cola|Coke]]. Samar's aspirations encompass various fields: he aims to become a Shia Muslim scholar, a medical doctor, and a successful YouTuber.
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [[w:Hindi|Hindi]]. Samar's YouTube trajectory took a turn when he started creating country ball animations using ''Prisma3D''. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.youtube.com/@Cartoonabad Cartoonabad (Second channel) on YouTube]
* [https://www.youtube.com/@Cartoonabad_OG Cartoonabad (Third channel) on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
97a8d13a0b7a49f999b23d0dd3b630812ea88b3b
711
710
2023-08-26T13:17:20Z
InsaneX
2
wikitext
text/x-wiki
[[File:Cartoonabad_Logo.jpg|thumb|300px|Logo of Cartoonabad.]]
'''Syed Samar''' ([[w:Urdu | Urdu]]: سید ثمر) is a Pakistani Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Sindhi Patriot''' (previously '''Cartoonabad'''). As of August 10th, the channel has 1.67K subscribers and has received over 607K views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [[w:Hyderabad,_Sindh | Hyderabad]], [[W:Pakistan | Pakistan]]. He identifies as a [[w:Shia Islam | Shia Muslim]]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [[w:Sharbat_(beverage) | Sharbat]] and Tea to an assortment of cold drinks including [[w:Pepsi|Pepsi]] and [[w:Coca-Cola|Coke]]. Samar's aspirations encompass various fields: he aims to become a Shia Muslim scholar, a medical doctor, and a successful [[w:YouTuber|YouTuber]].
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [[w:Hindi|Hindi]]. Samar's YouTube trajectory took a turn when he started creating country ball animations using ''Prisma3D''. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.youtube.com/@Cartoonabad Cartoonabad (Second channel) on YouTube]
* [https://www.youtube.com/@Cartoonabad_OG Cartoonabad (Third channel) on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
10d68fbab65503bf5de6e4b052303f4a3c68228f
713
711
2023-08-26T13:20:49Z
InsaneX
2
wikitext
text/x-wiki
[[File:Sindhi Patriot Logo.jpg|thumb|300px|Logo of Sindhi Patriot.]]
'''Syed Samar''' ([[w:Urdu | Urdu]]: سید ثمر) is a Pakistani Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Sindhi Patriot''' (previously '''Cartoonabad'''). As of August 10th, the channel has 1.67K subscribers and has received over 607K views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [[w:Hyderabad,_Sindh | Hyderabad]], [[W:Pakistan | Pakistan]]. He identifies as a [[w:Shia Islam | Shia Muslim]]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [[w:Sharbat_(beverage) | Sharbat]] and Tea to an assortment of cold drinks including [[w:Pepsi|Pepsi]] and [[w:Coca-Cola|Coke]]. Samar's aspirations encompass various fields: he aims to become a Shia Muslim scholar, a medical doctor, and a successful [[w:YouTuber|YouTuber]].
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [[w:Hindi|Hindi]]. Samar's YouTube trajectory took a turn when he started creating country ball animations using ''Prisma3D''. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.youtube.com/@Cartoonabad Cartoonabad (Second channel) on YouTube]
* [https://www.youtube.com/@Cartoonabad_OG Cartoonabad (Third channel) on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
ac29dc4688d6e5a8c834e395885ed07b3de4b14b
715
713
2023-08-26T13:23:33Z
InsaneX
2
Redirected page to [[Sindhi Patriot]]
wikitext
text/x-wiki
#REDIRECT [[Sindhi_Patriot]]
b8a4d3b1acc60eb8624a5079a81090dbc27bf593
Amidoch
0
261
675
2023-08-24T17:14:27Z
InsaneX
2
Created page with "'''Amidoch Djlass''' ([[w:Arabic|Arabic]]: اميدوش دجلاس) is a Tunisian-French Geotuber and TikToker known for his geographical and historical content on his YouTube channel '''Amidoch''' and [[w:TikTok|TikTok]] account '''Amidoch Mapping'''. As of a recent count, Amidoch has amassed 29.2K subscribers on YouTube, with over 11.3 million views, and 22.5K followers on TikTok with over 400.6K likes. == Early Life == Amidoch Djlass was born on September 7, 2006, in..."
wikitext
text/x-wiki
'''Amidoch Djlass''' ([[w:Arabic|Arabic]]: اميدوش دجلاس) is a Tunisian-French Geotuber and TikToker known for his geographical and historical content on his YouTube channel '''Amidoch''' and [[w:TikTok|TikTok]] account '''Amidoch Mapping'''. As of a recent count, Amidoch has amassed 29.2K subscribers on YouTube, with over 11.3 million views, and 22.5K followers on TikTok with over 400.6K likes.
== Early Life ==
Amidoch Djlass was born on September 7, 2006, in [[w:Grasse|Grasse]], [[w:France|France]]. Born with French-Tunisian heritage, Amidoch initially lived in France until his family relocated to [[w:Italy|Italy]]. In 2011, during a vacation to [[w:Tunisia|Tunisia]], they found themselves unable to return to France due to the border closures brought about by the [[w:Tunisian Revolution|Tunisian Revolution]]. They spent seven years in Tunisia, a period during which Amidoch learned about [[w:History of Tunisia|Tunisian history]], [[w:Culture of Tunisia|culture]], and [[w:Tunisian Arabic|language]]. In 2018, with borders reopening, the family moved to [[w:Normandy|Normandy]], [[w:France|France]], but faced challenges like racism. They briefly relocated to Grasse before settling in Alsace-Lorraine, where Amidoch found the motivation to pursue a career on [[w:YouTube|YouTube]].
== YouTube Career ==
Amidoch's journey on YouTube began in [[w:Lyon|Lyon]], where he became intrigued by the concept of "mapping" on [[w:YouTube Shorts|YouTube Shorts]]. His initial videos focused on comparing countries' historical and present states. Despite early challenges, Amidoch's videos on the collapse of [[w:Yugoslavia|Yugoslavia]] and the [[w:Soviet Union|USSR]] gained significant attention, helping him amass a significant subscriber base. His trend of comparing regions such as "West vs East" and "North vs South" boosted his popularity, especially after involving the real experiences of people living in those regions. Amidoch is known to collaborate with fellow Geotubers like ThatTurkGuy, [[Militarizatixn]], AngryBozo Geography, R2X Mapping, Omran Geography, and Divine Geography.
== TikTok Career ==
Amidoch started his TikTok journey five months prior to the current date, gaining popularity with his "West Vs East countries" video, which went viral. Amidoch's content primarily revolves around nationalist editing, mapping, and history.
== Content and Community Involvement ==
Amidoch is an active member of the '''Creators Hub''', which aims to protect Geotubers from raids. He is also the Co-Owner of the '''Nationalist Community''', a community that assists budding nationalist editors in honing their editing skills.
== External Links ==
* [https://www.tiktok.com/@amidoch.mapping Amidoch on TikTok]
* [https://www.youtube.com/@Amidoch.mapping/ Amidoch on YouTube]
* [https://discord.gg/amidoch-community-846332203365695508 Amidoch's Discord Server]
4ee7f9581b2942441aec3d14ef5ad7fdce3b0715
676
675
2023-08-24T17:15:12Z
InsaneX
2
wikitext
text/x-wiki
'''Amidoch Djlass''' ([[w:Arabic|Arabic]]: اميدوش دجلاس) is a Tunisian-French Geotuber and TikToker known for his geographical and historical content on his [[w:YouTube|YouTube]] channel '''Amidoch''' and [[w:TikTok|TikTok]] account '''Amidoch Mapping'''. As of a recent count, Amidoch has amassed 29.2K subscribers on YouTube, with over 11.3 million views, and 22.5K followers on TikTok with over 400.6K likes.
== Early Life ==
Amidoch Djlass was born on September 7, 2006, in [[w:Grasse|Grasse]], [[w:France|France]]. Born with French-Tunisian heritage, Amidoch initially lived in France until his family relocated to [[w:Italy|Italy]]. In 2011, during a vacation to [[w:Tunisia|Tunisia]], they found themselves unable to return to France due to the border closures brought about by the [[w:Tunisian Revolution|Tunisian Revolution]]. They spent seven years in Tunisia, a period during which Amidoch learned about [[w:History of Tunisia|Tunisian history]], [[w:Culture of Tunisia|culture]], and [[w:Tunisian Arabic|language]]. In 2018, with borders reopening, the family moved to [[w:Normandy|Normandy]], [[w:France|France]], but faced challenges like racism. They briefly relocated to Grasse before settling in Alsace-Lorraine, where Amidoch found the motivation to pursue a career on [[w:YouTube|YouTube]].
== YouTube Career ==
Amidoch's journey on [[w:YouTube|YouTube]] began in [[w:Lyon|Lyon]], where he became intrigued by the concept of "mapping" on [[w:YouTube Shorts|YouTube Shorts]]. His initial videos focused on comparing countries' historical and present states. Despite early challenges, Amidoch's videos on the collapse of [[w:Yugoslavia|Yugoslavia]] and the [[w:Soviet Union|USSR]] gained significant attention, helping him amass a significant subscriber base. His trend of comparing regions such as "West vs East" and "North vs South" boosted his popularity, especially after involving the real experiences of people living in those regions. Amidoch is known to collaborate with fellow Geotubers like ThatTurkGuy, [[Militarizatixn]], AngryBozo Geography, R2X Mapping, Omran Geography, and Divine Geography.
== TikTok Career ==
Amidoch started his TikTok journey five months prior to the current date, gaining popularity with his "West Vs East countries" video, which went viral. Amidoch's content primarily revolves around nationalist editing, mapping, and history.
== Content and Community Involvement ==
Amidoch is an active member of the '''Creators Hub''', which aims to protect Geotubers from raids. He is also the Co-Owner of the '''Nationalist Community''', a community that assists budding nationalist editors in honing their editing skills.
== External Links ==
* [https://www.tiktok.com/@amidoch.mapping Amidoch on TikTok]
* [https://www.youtube.com/@Amidoch.mapping/ Amidoch on YouTube]
* [https://discord.gg/amidoch-community-846332203365695508 Amidoch's Discord Server]
028d8fc02494ab064d5b289078da82adeb74f064
677
676
2023-08-24T17:16:07Z
InsaneX
2
/* Content and Community Involvement */
wikitext
text/x-wiki
'''Amidoch Djlass''' ([[w:Arabic|Arabic]]: اميدوش دجلاس) is a Tunisian-French Geotuber and TikToker known for his geographical and historical content on his [[w:YouTube|YouTube]] channel '''Amidoch''' and [[w:TikTok|TikTok]] account '''Amidoch Mapping'''. As of a recent count, Amidoch has amassed 29.2K subscribers on YouTube, with over 11.3 million views, and 22.5K followers on TikTok with over 400.6K likes.
== Early Life ==
Amidoch Djlass was born on September 7, 2006, in [[w:Grasse|Grasse]], [[w:France|France]]. Born with French-Tunisian heritage, Amidoch initially lived in France until his family relocated to [[w:Italy|Italy]]. In 2011, during a vacation to [[w:Tunisia|Tunisia]], they found themselves unable to return to France due to the border closures brought about by the [[w:Tunisian Revolution|Tunisian Revolution]]. They spent seven years in Tunisia, a period during which Amidoch learned about [[w:History of Tunisia|Tunisian history]], [[w:Culture of Tunisia|culture]], and [[w:Tunisian Arabic|language]]. In 2018, with borders reopening, the family moved to [[w:Normandy|Normandy]], [[w:France|France]], but faced challenges like racism. They briefly relocated to Grasse before settling in Alsace-Lorraine, where Amidoch found the motivation to pursue a career on [[w:YouTube|YouTube]].
== YouTube Career ==
Amidoch's journey on [[w:YouTube|YouTube]] began in [[w:Lyon|Lyon]], where he became intrigued by the concept of "mapping" on [[w:YouTube Shorts|YouTube Shorts]]. His initial videos focused on comparing countries' historical and present states. Despite early challenges, Amidoch's videos on the collapse of [[w:Yugoslavia|Yugoslavia]] and the [[w:Soviet Union|USSR]] gained significant attention, helping him amass a significant subscriber base. His trend of comparing regions such as "West vs East" and "North vs South" boosted his popularity, especially after involving the real experiences of people living in those regions. Amidoch is known to collaborate with fellow Geotubers like ThatTurkGuy, [[Militarizatixn]], AngryBozo Geography, R2X Mapping, Omran Geography, and Divine Geography.
== TikTok Career ==
Amidoch started his TikTok journey five months prior to the current date, gaining popularity with his "West Vs East countries" video, which went viral. Amidoch's content primarily revolves around nationalist editing, mapping, and history.
== Alliances ==
Amidoch is an active member of the '''Creators Hub''', which aims to protect Geotubers from raids. He is also the Co-Owner of the '''Nationalist Community''', a community that assists budding nationalist editors in honing their editing skills.
== External Links ==
* [https://www.tiktok.com/@amidoch.mapping Amidoch on TikTok]
* [https://www.youtube.com/@Amidoch.mapping/ Amidoch on YouTube]
* [https://discord.gg/amidoch-community-846332203365695508 Amidoch's Discord Server]
d39aa7b1cd0295444bbe453091b7d692677a89c8
682
677
2023-08-24T17:19:45Z
InsaneX
2
wikitext
text/x-wiki
[[File:Amidoch_Logo.jpg|thumb|300px|Logo of Amidoch.]]
'''Amidoch Djlass''' ([[w:Arabic|Arabic]]: اميدوش دجلاس) is a Tunisian-French Geotuber and TikToker known for his geographical and historical content on his [[w:YouTube|YouTube]] channel '''Amidoch''' and [[w:TikTok|TikTok]] account '''Amidoch Mapping'''. As of a recent count, Amidoch has amassed 29.2K subscribers on YouTube, with over 11.3 million views, and 22.5K followers on TikTok with over 400.6K likes.
== Early Life ==
Amidoch Djlass was born on September 7, 2006, in [[w:Grasse|Grasse]], [[w:France|France]]. Born with French-Tunisian heritage, Amidoch initially lived in France until his family relocated to [[w:Italy|Italy]]. In 2011, during a vacation to [[w:Tunisia|Tunisia]], they found themselves unable to return to France due to the border closures brought about by the [[w:Tunisian Revolution|Tunisian Revolution]]. They spent seven years in Tunisia, a period during which Amidoch learned about [[w:History of Tunisia|Tunisian history]], [[w:Culture of Tunisia|culture]], and [[w:Tunisian Arabic|language]]. In 2018, with borders reopening, the family moved to [[w:Normandy|Normandy]], [[w:France|France]], but faced challenges like racism. They briefly relocated to Grasse before settling in Alsace-Lorraine, where Amidoch found the motivation to pursue a career on [[w:YouTube|YouTube]].
== YouTube Career ==
Amidoch's journey on [[w:YouTube|YouTube]] began in [[w:Lyon|Lyon]], where he became intrigued by the concept of "mapping" on [[w:YouTube Shorts|YouTube Shorts]]. His initial videos focused on comparing countries' historical and present states. Despite early challenges, Amidoch's videos on the collapse of [[w:Yugoslavia|Yugoslavia]] and the [[w:Soviet Union|USSR]] gained significant attention, helping him amass a significant subscriber base. His trend of comparing regions such as "West vs East" and "North vs South" boosted his popularity, especially after involving the real experiences of people living in those regions. Amidoch is known to collaborate with fellow Geotubers like ThatTurkGuy, [[Militarizatixn]], AngryBozo Geography, R2X Mapping, Omran Geography, and Divine Geography.
== TikTok Career ==
Amidoch started his TikTok journey five months prior to the current date, gaining popularity with his "West Vs East countries" video, which went viral. Amidoch's content primarily revolves around nationalist editing, mapping, and history.
== Alliances ==
Amidoch is an active member of the '''Creators Hub''', which aims to protect Geotubers from raids. He is also the Co-Owner of the '''Nationalist Community''', a community that assists budding nationalist editors in honing their editing skills.
== External Links ==
* [https://www.tiktok.com/@amidoch.mapping Amidoch on TikTok]
* [https://www.youtube.com/@Amidoch.mapping/ Amidoch on YouTube]
* [https://discord.gg/amidoch-community-846332203365695508 Amidoch's Discord Server]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
cedc5a5aeffd1b755a7dfceb43ca17ceddef834e
User:Falaq
2
263
679
2023-08-24T17:18:11Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:Falaq
3
264
680
2023-08-24T17:18:11Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:File:Falaqpfp1.jpg]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 17:18, 24 August 2023
29a40787a6c052fd0079ab449dba1d6a58ec97e2
File:Amidoch Logo.jpg
6
265
681
2023-08-24T17:18:53Z
InsaneX
2
Logo of Amidoch.
wikitext
text/x-wiki
== Summary ==
Logo of Amidoch.
29baa5e1a9efcb57ebcee3bebe90ac15d40d5d40
File:Mint-eggy-pfp.png
6
266
695
2023-08-24T19:08:06Z
Mint eggy93
33
This is the current pfp of mint eggy the geotuber
wikitext
text/x-wiki
== Summary ==
This is the current pfp of mint eggy the geotuber
849b8dc034bddd831d07437bb9c0dcbdbe6b42c9
Talk:Main Page
1
267
696
2023-08-24T19:28:23Z
Not data channel
34
/* Yo how to create pages? */ new section
wikitext
text/x-wiki
== Yo how to create pages? ==
??? [[User:Not data channel|Not data channel]] ([[User talk:Not data channel|talk]]) 19:28, 24 August 2023 (UTC)
a9397bf3e141b2e60f483869c93dceac2cfe2a33
697
696
2023-08-26T09:35:03Z
InsaneX
2
/* Yo how to create pages? */
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Logo Of GeoGraphyMapping.png
6
268
698
2023-08-25T07:06:18Z
TheEagle7
35
wikitext
text/x-wiki
The Logo Of GeoGraphyMapping
Made by @Vladeco2456
9b4f469484b1078ed3f1e4931a11717f5c045728
File:GeoGraphyMapping's logo.png
6
280
722
2023-08-25T08:10:06Z
TheEagle7
35
wikitext
text/x-wiki
GeoGraphyMapping's logo.
Created by @Vladeco2456
743b5204b9638e5f6908dccaa089bbc35f92cb8a
IcyBall Geostuffs
0
247
719
633
2023-08-25T16:03:40Z
TheEagle7
35
/* YouTube Career */Converted external links to interlinks.
wikitext
text/x-wiki
[[File:IcyBall_Geostuffs_Logo.jpg|thumb|300px|Logo of IcyBall Geostuffs.]]
'''Landen''' is an American Geotuber known for his channel '''IcyBall Geostuffs'''. Born on September 11, 2009, in [[w:Riverside | Riverside]], [[w:California | California]], he currently resides in [[w:Anaheim | Anaheim]], [[w:California | California]].
== Early Life ==
From a young age, Landen took immense pride in his ethnic backgrounds, particularly his Polish and Persian ancestries. This interest in cultural and ethnic heritage would later translate into a profound fascination with geography.
== YouTube Career ==
Landen's journey into the realm of geography began in the 6th grade, roughly around late 2021 to early 2022. While working on a history project about [[w:Ancient_Greece | Ancient Greece]], he chanced upon the strategic strait known as the [[w:Dardanelles | Dardanelles]]. As he developed into [[w:Encyclop%C3%A6dia_Britannica | Encyclopedia Britannica]] and [[w:Wikipedia | Wikipedia]], a spark of curiosity led him to explore geography further.
By August 2022, Landen had become an avid viewer of the Geo community on YouTube. Inspired by what he saw, he decided to contribute to this community and started his own channel, ''IcyBall Mapping'', in October 2022. Initially, he focused on mapping TTS videos using MapChart. Today, known as ''IcyBall Geostuffs'', Landen creates a diverse range of geographical content.
For his edits, Landen relies on a set of software tools including ''CapCut'', ''Alight Motion'' occasionally, ''ibis Paint X'', and ''Picsart''. He makes CvCs (country vs. country comparisons) and Nationalist Edits on his iPad, while he uses his iPhone for Mapping Videos. Landen's contributions and unique style have earned him a dedicated following, boasting 37.1K subscribers and more than 15.4 million views on his channel.
== Alliances ==
Landen plays an active role in the geo community, being the co-founder of the '''League of Californian Geotubers (L.C.G)'''. He is also a member of the '''League of American Geotubers (L.A.G)'''.
== External Links ==
* [https://youtube.com/@IcyBall.Geostuffs IcyBall Geostuffs on YouTube]
* [https://www.tiktok.com/@icyball.geostuffs IcyBall Geostuffs on TikTok]
* [https://open.spotify.com/user/31z5m4knlqiude3t2nzzedmlih7u?si=SV96CHwpT2iUsfpogBT84A IcyBall Geostuffs on Spotify]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
c12cd0ff65af60da1ee6e736cb13816f13c1d2de
720
719
2023-08-26T13:37:07Z
InsaneX
2
wikitext
text/x-wiki
[[File:IcyBall_Geostuffs_Logo.jpg|thumb|300px|Logo of IcyBall Geostuffs.]]
'''Landen''' is an American Geotuber known for his channel '''IcyBall Geostuffs'''. Born on September 11, 2009, in [[w:Riverside,_California| Riverside]], [[w:California | California]], he currently resides in [[w:Anaheim,_California| Anaheim]], [[w:California | California]].
== Early Life ==
From a young age, Landen took immense pride in his ethnic backgrounds, particularly his Polish and Persian ancestries. This interest in cultural and ethnic heritage would later translate into a profound fascination with geography.
== YouTube Career ==
Landen's journey into the realm of geography began in the 6th grade, roughly around late 2021 to early 2022. While working on a history project about [[w:Ancient_Greece | Ancient Greece]], he chanced upon the strategic strait known as the [[w:Dardanelles | Dardanelles]]. As he developed into [[w:Encyclop%C3%A6dia_Britannica | Encyclopedia Britannica]] and [[w:Wikipedia | Wikipedia]], a spark of curiosity led him to explore geography further.
By August 2022, Landen had become an avid viewer of the Geo community on YouTube. Inspired by what he saw, he decided to contribute to this community and started his own channel, ''IcyBall Mapping'', in October 2022. Initially, he focused on mapping TTS videos using MapChart. Today, known as ''IcyBall Geostuffs'', Landen creates a diverse range of geographical content.
For his edits, Landen relies on a set of software tools including ''CapCut'', ''Alight Motion'' occasionally, ''ibis Paint X'', and ''Picsart''. He makes CvCs (country vs. country comparisons) and Nationalist Edits on his iPad, while he uses his iPhone for Mapping Videos. Landen's contributions and unique style have earned him a dedicated following, boasting 37.1K subscribers and more than 15.4 million views on his channel.
== Alliances ==
Landen plays an active role in the geo community, being the co-founder of the '''League of Californian Geotubers (L.C.G)'''. He is also a member of the '''League of American Geotubers (L.A.G)'''.
== External Links ==
* [https://youtube.com/@IcyBall.Geostuffs IcyBall Geostuffs on YouTube]
* [https://www.tiktok.com/@icyball.geostuffs IcyBall Geostuffs on TikTok]
* [https://open.spotify.com/user/31z5m4knlqiude3t2nzzedmlih7u?si=SV96CHwpT2iUsfpogBT84A IcyBall Geostuffs on Spotify]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
3db236eab4df71cf55039e151c12f4dab27d54f5
721
720
2023-08-26T13:38:56Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
[[File:IcyBall_Geostuffs_Logo.jpg|thumb|300px|Logo of IcyBall Geostuffs.]]
'''Landen''' is an American Geotuber known for his channel '''IcyBall Geostuffs'''. Born on September 11, 2009, in [[w:Riverside,_California| Riverside]], [[w:California | California]], he currently resides in [[w:Anaheim,_California| Anaheim]], [[w:California | California]].
== Early Life ==
From a young age, Landen took immense pride in his ethnic backgrounds, particularly his Polish and Persian ancestries. This interest in cultural and ethnic heritage would later translate into a profound fascination with geography.
== YouTube Career ==
Landen's journey into the realm of geography began in the 6th grade, roughly around late 2021 to early 2022. While working on a history project about [[w:Ancient_Greece | Ancient Greece]], he chanced upon the strategic strait known as the [[w:Dardanelles | Dardanelles]]. As he delved deeper into [[w:Encyclop%C3%A6dia_Britannica | Encyclopedia Britannica]] and [[w:Wikipedia | Wikipedia]], a spark of curiosity led him to explore geography further.
By August 2022, Landen had become an avid viewer of the Geo community on YouTube. Inspired by what he saw, he decided to contribute to this community and started his own channel, ''IcyBall Mapping'', in October 2022. Initially, he focused on mapping TTS videos using MapChart. Today, known as ''IcyBall Geostuffs'', Landen creates a diverse range of geographical content.
For his edits, Landen relies on a set of software tools including ''CapCut'', ''Alight Motion'' occasionally, ''ibis Paint X'', and ''Picsart''. He makes CvCs (country vs. country comparisons) and Nationalist Edits on his iPad, while he uses his iPhone for Mapping Videos. Landen's contributions and unique style have earned him a dedicated following, boasting 37.1K subscribers and more than 15.4 million views on his channel.
== Alliances ==
Landen plays an active role in the geo community, being the co-founder of the '''League of Californian Geotubers (L.C.G)'''. He is also a member of the '''League of American Geotubers (L.A.G)'''.
== External Links ==
* [https://youtube.com/@IcyBall.Geostuffs IcyBall Geostuffs on YouTube]
* [https://www.tiktok.com/@icyball.geostuffs IcyBall Geostuffs on TikTok]
* [https://open.spotify.com/user/31z5m4knlqiude3t2nzzedmlih7u?si=SV96CHwpT2iUsfpogBT84A IcyBall Geostuffs on Spotify]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
dc511a2507693f9bb7e286882f8bb6ba418d030f
User talk:Mint eggy93
3
273
703
2023-08-26T09:34:07Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:File:Mint-eggy-pfp.png]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 09:34, 26 August 2023
3a10e0abc4d1f23b1dafa75320ba5b3127c8f153
User:Mint eggy93
2
274
704
2023-08-26T09:34:07Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:Not data channel
3
271
701
2023-08-26T09:34:33Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:Talk:Main Page]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 09:34, 26 August 2023
04fba06dd86e37cb1aa0049be7f9d0b594ea6b85
User:Not data channel
2
272
702
2023-08-26T09:34:33Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:TheEagle7
3
269
699
2023-08-26T09:35:52Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:File:Logo Of GeoGraphyMapping.png]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 09:35, 26 August 2023
51483feeff719773c8a489816578677940952786
User:TheEagle7
2
270
700
2023-08-26T09:35:52Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:Cartoonabad
3
277
716
2023-08-26T09:37:59Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:Cartoonabad]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 09:37, 26 August 2023
d2dc9783496700b1bba3e97787a01d1295825c8e
User:Cartoonabad
2
278
717
2023-08-26T09:37:59Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
File:Sindhi Patriot Logo.jpg
6
275
712
2023-08-26T13:20:16Z
InsaneX
2
Logo of Sindhi Patriot.
wikitext
text/x-wiki
== Summary ==
Logo of Sindhi Patriot.
c0f4e38336b042e13724c3d3b4cd771feead10f4
Sindhi Patriot
0
276
714
2023-08-26T13:22:48Z
InsaneX
2
Created page with "[[File:Sindhi Patriot Logo.jpg|thumb|300px|Logo of Sindhi Patriot.]] '''Syed Samar''' ([[w:Urdu | Urdu]]: سید ثمر) is a Pakistani Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Sindhi Patriot''' (previously '''Cartoonabad'''). As of August 10th, the channel has 1.67K subscribers and has received over 607K views. == Personal Life == Syed Samar was born on February 16, 2010, in [[w:Hyderabad,_Sindh | Hyderabad]], [[W:Pakistan | Pakistan]]. He id..."
wikitext
text/x-wiki
[[File:Sindhi Patriot Logo.jpg|thumb|300px|Logo of Sindhi Patriot.]]
'''Syed Samar''' ([[w:Urdu | Urdu]]: سید ثمر) is a Pakistani Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Sindhi Patriot''' (previously '''Cartoonabad'''). As of August 10th, the channel has 1.67K subscribers and has received over 607K views.
== Personal Life ==
Syed Samar was born on February 16, 2010, in [[w:Hyderabad,_Sindh | Hyderabad]], [[W:Pakistan | Pakistan]]. He identifies as a [[w:Shia Islam | Shia Muslim]]. When it comes to his culinary preferences, Samar has a fondness for a range of foods including Biryani, Samosas, Burgers, and Pizza. His beverage choices range from [[w:Sharbat_(beverage) | Sharbat]] and Tea to an assortment of cold drinks including [[w:Pepsi|Pepsi]] and [[w:Coca-Cola|Coke]]. Samar's aspirations encompass various fields: he aims to become a Shia Muslim scholar, a medical doctor, and a successful [[w:YouTuber|YouTuber]].
== YouTube Career ==
From a young age, Samar exhibited a keen interest in cartoons. His initial foray into the world of YouTube was influenced by this passion, as he began his journey by dubbing ''Talking Tom and Friends'' in [[w:Hindi|Hindi]]. Samar's YouTube trajectory took a turn when he started creating country ball animations using ''Prisma3D''. Inspired by geography and the potential to explore it further, Samar transitioned into creating and sharing geography-related content, thereby establishing himself as a notable Geotuber.
== External Links ==
* [https://www.youtube.com/@cartoonabadcountryballanimatio Cartoonabad on YouTube]
* [https://www.youtube.com/@Cartoonabad Cartoonabad (Second channel) on YouTube]
* [https://www.youtube.com/@Cartoonabad_OG Cartoonabad (Third channel) on YouTube]
* [https://www.tiktok.com/@cartoonabad?_t=8dQlUpVSaJe&_r=1 Cartoonabad on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
ac29dc4688d6e5a8c834e395885ed07b3de4b14b
DyaEditZ
0
281
723
2023-08-26T16:32:48Z
InsaneX
2
Created page with "'''Ahmed Mohamed''' ([[w:Arabic|Arabic]]: احمد محمد) is an Egyptian Geotuber well known for his YouTube channel, '''DyaEditZ'''. As of August 26th, he boasts an audience of 4.32K subscribers with over 1.7 million views on his videos. == Early Life == Ahmed Mohamed was born and raised in [[w:Cairo | Cairo]], [[w:Egypt | Egypt]]. Despite his early interest in becoming a Geotuber, his initial foray into the realm of [[w:YouTube|YouTube]] in February 16, 2019 was sh..."
wikitext
text/x-wiki
'''Ahmed Mohamed''' ([[w:Arabic|Arabic]]: احمد محمد) is an Egyptian Geotuber well known for his YouTube channel, '''DyaEditZ'''. As of August 26th, he boasts an audience of 4.32K subscribers with over 1.7 million views on his videos.
== Early Life ==
Ahmed Mohamed was born and raised in [[w:Cairo | Cairo]], [[w:Egypt | Egypt]]. Despite his early interest in becoming a Geotuber, his initial foray into the realm of [[w:YouTube|YouTube]] in February 16, 2019 was short-lived due to dissatisfaction with his video edits. It wasn't until 2022, when he stumbled upon another Geotuber, ''FlageditZ'', that he felt inspired to re-enter the YouTube community. The camaraderie between the two helped Ahmed refocus and reimagine his channel, subsequently rebranding it as '''Egyptian Ball'''.
== YouTube Career ==
His early videos on the platform primarily revolved around country comparisons, highlighting relationships between nations as allies or adversaries. Initially, Ahmed utilized ''CapCut'' for video editing, producing a range of content until his final CapCut creation – a tribute video dedicated to [[MightyGeoGuy]], another Geotuber. Switching gears, he adopted ''Alight Motion'' as his primary editing software, aided and inspired by ''SuperiorGAF''. This change in toolset saw a remarkable improvement in his video quality, most notably showcased in his celebratory edit for [[w:Pakistan | Pakistan's]] Independence Day, which he personally regards as one of his best works.
== Alliances ==
Ahmed Mohamed is part of several alliances within the Geo community:
* United Anti Communist (U.A.C)
* Strongest Alliance Ever (S.A.E)
* KATO
== External Links ==
* [https://youtube.com/@EgyptianDya DyaEditZ on YouTube]
aa8273fd80dde94fdff19ed5f84b49e5804c36fe
724
723
2023-08-26T16:33:10Z
InsaneX
2
/* Alliances */
wikitext
text/x-wiki
'''Ahmed Mohamed''' ([[w:Arabic|Arabic]]: احمد محمد) is an Egyptian Geotuber well known for his YouTube channel, '''DyaEditZ'''. As of August 26th, he boasts an audience of 4.32K subscribers with over 1.7 million views on his videos.
== Early Life ==
Ahmed Mohamed was born and raised in [[w:Cairo | Cairo]], [[w:Egypt | Egypt]]. Despite his early interest in becoming a Geotuber, his initial foray into the realm of [[w:YouTube|YouTube]] in February 16, 2019 was short-lived due to dissatisfaction with his video edits. It wasn't until 2022, when he stumbled upon another Geotuber, ''FlageditZ'', that he felt inspired to re-enter the YouTube community. The camaraderie between the two helped Ahmed refocus and reimagine his channel, subsequently rebranding it as '''Egyptian Ball'''.
== YouTube Career ==
His early videos on the platform primarily revolved around country comparisons, highlighting relationships between nations as allies or adversaries. Initially, Ahmed utilized ''CapCut'' for video editing, producing a range of content until his final CapCut creation – a tribute video dedicated to [[MightyGeoGuy]], another Geotuber. Switching gears, he adopted ''Alight Motion'' as his primary editing software, aided and inspired by ''SuperiorGAF''. This change in toolset saw a remarkable improvement in his video quality, most notably showcased in his celebratory edit for [[w:Pakistan | Pakistan's]] Independence Day, which he personally regards as one of his best works.
== Alliances ==
Ahmed Mohamed is part of several alliances within the Geo community:
* '''United Anti Communist (U.A.C)'''
* '''Strongest Alliance Ever (S.A.E)'''
* '''KATO'''
== External Links ==
* [https://youtube.com/@EgyptianDya DyaEditZ on YouTube]
eb72d465d1a3365881ccbed99440d914d8b4326e
726
724
2023-08-26T16:34:29Z
InsaneX
2
wikitext
text/x-wiki
[[File:DyaEditZ_Logo.jpg|thumb|300px|Logo of DyaEditZ.]]
'''Ahmed Mohamed''' ([[w:Arabic|Arabic]]: احمد محمد) is an Egyptian Geotuber well known for his YouTube channel, '''DyaEditZ'''. As of August 26th, he boasts an audience of 4.32K subscribers with over 1.7 million views on his videos.
== Early Life ==
Ahmed Mohamed was born and raised in [[w:Cairo | Cairo]], [[w:Egypt | Egypt]]. Despite his early interest in becoming a Geotuber, his initial foray into the realm of [[w:YouTube|YouTube]] in February 16, 2019 was short-lived due to dissatisfaction with his video edits. It wasn't until 2022, when he stumbled upon another Geotuber, ''FlageditZ'', that he felt inspired to re-enter the YouTube community. The camaraderie between the two helped Ahmed refocus and reimagine his channel, subsequently rebranding it as '''Egyptian Ball'''.
== YouTube Career ==
His early videos on the platform primarily revolved around country comparisons, highlighting relationships between nations as allies or adversaries. Initially, Ahmed utilized ''CapCut'' for video editing, producing a range of content until his final CapCut creation – a tribute video dedicated to [[MightyGeoGuy]], another Geotuber. Switching gears, he adopted ''Alight Motion'' as his primary editing software, aided and inspired by ''SuperiorGAF''. This change in toolset saw a remarkable improvement in his video quality, most notably showcased in his celebratory edit for [[w:Pakistan | Pakistan's]] Independence Day, which he personally regards as one of his best works.
== Alliances ==
Ahmed Mohamed is part of several alliances within the Geo community:
* '''United Anti Communist (U.A.C)'''
* '''Strongest Alliance Ever (S.A.E)'''
* '''KATO'''
== External Links ==
* [https://youtube.com/@EgyptianDya DyaEditZ on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
c6aea0a9114f2c87d3c00862391446b3641fd2ad
File:DyaEditZ Logo.jpg
6
282
725
2023-08-26T16:33:41Z
InsaneX
2
Logo of DyaEditZ.
wikitext
text/x-wiki
== Summary ==
Logo of DyaEditZ.
ecda921d841e7063ebd7d2a8486c1dd803de8a52
Data Channel
0
283
727
2023-08-26T17:10:56Z
InsaneX
2
Created page with "'''Data Channel''' is a Ukrainian-Polish Geotuber with a significant presence on [[w:YouTube|YouTube]], boasting a subscriber count of 136K and accumulating over 98.7 million views on his videos. == Early Life == Data Channel was born in [[w:Novovolynsk | Novovolynsk]], [[w:Volyn Oblast | Volyn Oblast]], [[w:Ukraine | Ukraine]] but currently resides in [[w:Zakerzonia|Zakerzonia]], [[w:Poland | Poland]]. With a mixed Ukrainian-Polish heritage, his content reflects a deep..."
wikitext
text/x-wiki
'''Data Channel''' is a Ukrainian-Polish Geotuber with a significant presence on [[w:YouTube|YouTube]], boasting a subscriber count of 136K and accumulating over 98.7 million views on his videos.
== Early Life ==
Data Channel was born in [[w:Novovolynsk | Novovolynsk]], [[w:Volyn Oblast | Volyn Oblast]], [[w:Ukraine | Ukraine]] but currently resides in [[w:Zakerzonia|Zakerzonia]], [[w:Poland | Poland]]. With a mixed Ukrainian-Polish heritage, his content reflects a deep-rooted connection to both nations.
== YouTube Career ==
Data Channel's foray into YouTube was driven by a desire to assist the Ukrainian Army during the [[w:Russian invasion of Ukraine|Russian invasion of Ukraine]]. This fervor led him to become an avid viewer of YouTube Shorts, spurring him to learn video editing via ''CapCut''. He launched his channel in June 2022 and quickly found massive success with a video titled ''How do Greenlanders sleep?'', which alone garnered 50M views within a month.
Primarily using ''CapCut'' for video editing, he occasionally switches to ''Alight Motion'' for specialized edits. For textual overlays and map designs, he uses ''ibis Paint X''. His content ranges from nationalist edits and mapping to informative videos about the ongoing conflict in Ukraine.
== External Links ==
* [https://www.youtube.com/@data_channel/ Data Channel on YouTube]
* [https://www.tiktok.com/@data_channel_ Data Channel on TikTok]
* [https://www.instagram.com/data.channel_/ Data Channel on Instagram]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
740546042ada62788124752b3b162be11c53788e
729
727
2023-08-26T17:12:49Z
InsaneX
2
wikitext
text/x-wiki
[[File:Data_Channel_Logo.jpg|thumb|300px|Logo of Data Channel.]]
'''Data Channel''' is a Ukrainian-Polish Geotuber with a significant presence on [[w:YouTube|YouTube]], boasting a subscriber count of 136K and accumulating over 98.7 million views on his videos.
== Early Life ==
Data Channel was born in [[w:Novovolynsk | Novovolynsk]], [[w:Volyn Oblast | Volyn Oblast]], [[w:Ukraine | Ukraine]] but currently resides in [[w:Zakerzonia|Zakerzonia]], [[w:Poland | Poland]]. With a mixed Ukrainian-Polish heritage, his content reflects a deep-rooted connection to both nations.
== YouTube Career ==
Data Channel's foray into YouTube was driven by a desire to assist the Ukrainian Army during the [[w:Russian invasion of Ukraine|Russian invasion of Ukraine]]. This fervor led him to become an avid viewer of YouTube Shorts, spurring him to learn video editing via ''CapCut''. He launched his channel in June 2022 and quickly found massive success with a video titled ''How do Greenlanders sleep?'', which alone garnered 50M views within a month.
Primarily using ''CapCut'' for video editing, he occasionally switches to ''Alight Motion'' for specialized edits. For textual overlays and map designs, he uses ''ibis Paint X''. His content ranges from nationalist edits and mapping to informative videos about the ongoing conflict in Ukraine.
== External Links ==
* [https://www.youtube.com/@data_channel/ Data Channel on YouTube]
* [https://www.tiktok.com/@data_channel_ Data Channel on TikTok]
* [https://www.instagram.com/data.channel_/ Data Channel on Instagram]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
50488ac6833f21e95417c4ca86be142c155c4573
File:Data Channel Logo.jpg
6
284
728
2023-08-26T17:12:04Z
InsaneX
2
Logo of Data Channel.
wikitext
text/x-wiki
== Summary ==
Logo of Data Channel.
b16e6fdfb427119e52ec26e0cc3e782a254b7944
User:Not data channel
2
272
730
702
2023-08-27T06:06:15Z
Not data channel
34
wikitext
text/x-wiki
==About me==
I'm data_channel, but there will be no proofs
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
33f29122f4b54767d14e35fdd041067d1c25db7b
AngryBozo Geography
0
285
731
2023-08-27T07:56:53Z
InsaneX
2
Created page with "'''David''' (born January 13, 2010) is an American-Ecuadorian Geotuber, better known by his [[w:YouTube | YouTube]] channel '''AngryBozo Geography'''. He creates content related to geography, history, and mapping. As of 27th August, he has garnered almost 80K subscribers and has received over 65.5 million views on his videos. == Early Life == David was born in [[w:New_York_City|New York]], [[w:New York (state)|New York]], [[w:United_States|USA]] to Ecuadorian parents wh..."
wikitext
text/x-wiki
'''David''' (born January 13, 2010) is an American-Ecuadorian Geotuber, better known by his [[w:YouTube | YouTube]] channel '''AngryBozo Geography'''. He creates content related to geography, history, and mapping. As of 27th August, he has garnered almost 80K subscribers and has received over 65.5 million views on his videos.
== Early Life ==
David was born in [[w:New_York_City|New York]], [[w:New York (state)|New York]], [[w:United_States|USA]] to Ecuadorian parents who had moved there in 2009. The family relocated to [[w:Long Island|Long Island]], [[w:New York (state)|New York]], [[w:United_States|USA]] in search of a new home and job opportunities. By the age of six, David showed a keen interest in animations and aspired to be an animator, a dream he later forwent.
== YouTube Career ==
David launched his YouTube channel on November 15th, 2020, originally under the name ''DavidBlox''. He initially created [[w:YouTube Shorts | YouTube Shorts]] related to Roblox and occasionally uploaded gameplay videos. In November 2021, he rebranded to ''AngryBozo'' and continued to produce Roblox content until his subscriber count neared 935. David's transition to geography-based content began on August 13th, 2022, when he uploaded his first geo video. The video gained rapid traction, acquiring over 200k views within the first hour and boosting his subscriber count. Inspired by other creators like R2X Mapping, David shifted his focus towards history and mapping videos. Despite facing challenges, such as a wrongful channel termination by a user named ''MapOfGeography'' in January 2023, David managed to reclaim his channel and continued to witness steady growth. His content often involves trends like comparing countries at different times, with his most popular video being "France and Russia's relations now vs then," which has amassed 7.3 million views.
==External Links==
* [https://www.youtube.com/@angrybozo.geography1/ AngryBozo Geography on YouTube]
* [https://www.twitch.tv/angrybozolive AngryBozo Geography on Twitch]
* [https://www.tiktok.com/@angrybozo.geography1?_t=8fAUQgVWD7L&_r=1 AngryBozo Geography on TikTok]
39063130c708c2e51abfd3a0504f8df7f5da6222
732
731
2023-08-27T07:57:18Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
'''David''' (born January 13, 2010) is an American-Ecuadorian Geotuber, better known by his [[w:YouTube | YouTube]] channel '''AngryBozo Geography'''. He creates content related to geography, history, and mapping. As of 27th August, he has garnered almost 80K subscribers and has received over 65.5 million views on his videos.
== Early Life ==
David was born in [[w:New_York_City|New York]], [[w:New York (state)|New York]], [[w:United_States|USA]] to Ecuadorian parents who had moved there in 2009. The family relocated to [[w:Long Island|Long Island]], [[w:New York (state)|New York]], [[w:United_States|USA]] in search of a new home and job opportunities. By the age of six, David showed a keen interest in animations and aspired to be an animator, a dream he later forwent.
== YouTube Career ==
David launched his YouTube channel on November 15th, 2020, originally under the name ''DavidBlox''. He initially created [[w:YouTube Shorts | YouTube Shorts]] related to Roblox and occasionally uploaded gameplay videos. In November 2021, he rebranded to ''AngryBozo'' and continued to produce Roblox content until his subscriber count neared 935.
David's transition to geography-based content began on August 13th, 2022, when he uploaded his first geo video. The video gained rapid traction, acquiring over 200k views within the first hour and boosting his subscriber count. Inspired by other creators like R2X Mapping, David shifted his focus towards history and mapping videos. Despite facing challenges, such as a wrongful channel termination by a user named ''MapOfGeography'' in January 2023, David managed to reclaim his channel and continued to witness steady growth. His content often involves trends like comparing countries at different times, with his most popular video being "France and Russia's relations now vs then," which has amassed 7.3 million views.
==External Links==
* [https://www.youtube.com/@angrybozo.geography1/ AngryBozo Geography on YouTube]
* [https://www.twitch.tv/angrybozolive AngryBozo Geography on Twitch]
* [https://www.tiktok.com/@angrybozo.geography1?_t=8fAUQgVWD7L&_r=1 AngryBozo Geography on TikTok]
f057afa1660ebed74d6cb3dfd5b2b4e76be7c039
733
732
2023-08-27T07:57:51Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
'''David''' (born January 13, 2010) is an American-Ecuadorian Geotuber, better known by his [[w:YouTube | YouTube]] channel '''AngryBozo Geography'''. He creates content related to geography, history, and mapping. As of 27th August, he has garnered almost 80K subscribers and has received over 65.5 million views on his videos.
== Early Life ==
David was born in [[w:New_York_City|New York]], [[w:New York (state)|New York]], [[w:United_States|USA]] to Ecuadorian parents who had moved there in 2009. The family relocated to [[w:Long Island|Long Island]], [[w:New York (state)|New York]], [[w:United_States|USA]] in search of a new home and job opportunities. By the age of six, David showed a keen interest in animations and aspired to be an animator, a dream he later forwent.
== YouTube Career ==
David launched his YouTube channel on November 15th, 2020, originally under the name ''DavidBlox''. He initially created [[w:YouTube Shorts | YouTube Shorts]] related to Roblox and occasionally uploaded gameplay videos. In November 2021, he rebranded to ''AngryBozo'' and continued to produce Roblox content until his subscriber count neared 935. David's transition to geography-based content began on August 13th, 2022, when he uploaded his first geo video. The video gained rapid traction, acquiring over 200k views within the first hour and boosting his subscriber count. Inspired by other creators like R2X Mapping, David shifted his focus towards history and mapping videos. Despite facing challenges, such as a wrongful channel termination by a user named ''MapOfGeography'' in January 2023, David managed to reclaim his channel and continued to witness steady growth. His content often involves trends like comparing countries at different times, with his most popular video being "France and Russia's relations now vs then," which has amassed 7.3 million views.
==External Links==
* [https://www.youtube.com/@angrybozo.geography1/ AngryBozo Geography on YouTube]
* [https://www.twitch.tv/angrybozolive AngryBozo Geography on Twitch]
* [https://www.tiktok.com/@angrybozo.geography1?_t=8fAUQgVWD7L&_r=1 AngryBozo Geography on TikTok]
39063130c708c2e51abfd3a0504f8df7f5da6222
735
733
2023-08-27T07:59:29Z
InsaneX
2
wikitext
text/x-wiki
[[File:AngryBozo Geography Logo.jpg|thumb|300px|Logo of AngryBozo Geography.]]
'''David''' (born January 13, 2010) is an American-Ecuadorian Geotuber, better known by his [[w:YouTube | YouTube]] channel '''AngryBozo Geography'''. He creates content related to geography, history, and mapping. As of 27th August, he has garnered almost 80K subscribers and has received over 65.5 million views on his videos.
== Early Life ==
David was born in [[w:New_York_City|New York]], [[w:New York (state)|New York]], [[w:United_States|USA]] to Ecuadorian parents who had moved there in 2009. The family relocated to [[w:Long Island|Long Island]], [[w:New York (state)|New York]], [[w:United_States|USA]] in search of a new home and job opportunities. By the age of six, David showed a keen interest in animations and aspired to be an animator, a dream he later forwent.
== YouTube Career ==
David launched his YouTube channel on November 15th, 2020, originally under the name ''DavidBlox''. He initially created [[w:YouTube Shorts | YouTube Shorts]] related to Roblox and occasionally uploaded gameplay videos. In November 2021, he rebranded to ''AngryBozo'' and continued to produce Roblox content until his subscriber count neared 935. David's transition to geography-based content began on August 13th, 2022, when he uploaded his first geo video. The video gained rapid traction, acquiring over 200k views within the first hour and boosting his subscriber count. Inspired by other creators like R2X Mapping, David shifted his focus towards history and mapping videos. Despite facing challenges, such as a wrongful channel termination by a user named ''MapOfGeography'' in January 2023, David managed to reclaim his channel and continued to witness steady growth. His content often involves trends like comparing countries at different times, with his most popular video being "France and Russia's relations now vs then," which has amassed 7.3 million views.
==External Links==
* [https://www.youtube.com/@angrybozo.geography1/ AngryBozo Geography on YouTube]
* [https://www.twitch.tv/angrybozolive AngryBozo Geography on Twitch]
* [https://www.tiktok.com/@angrybozo.geography1?_t=8fAUQgVWD7L&_r=1 AngryBozo Geography on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
de26bb3cf2c04e08cb103e159e859a86d7fe15a2
File:AngryBozo Geography Logo.jpg
6
286
734
2023-08-27T07:58:30Z
InsaneX
2
Logo of AngryBozo Geography.
wikitext
text/x-wiki
== Summary ==
Logo of AngryBozo Geography.
0fe04aee603192aeda2bf285cc30ce0d13de85f3
User:YX Edits
2
287
736
2023-08-27T08:22:57Z
YX Edits
42
iaakksskfjfjguvjgntdihd
wikitext
text/x-wiki
'''YX Edits'''
YX Edits (@YX_Edits) is a Polish GeoTuber that makes mainly Country vs Country edits, as well as having a few maps and nationalist edits.
cf05982568ae3d0b605b47a216bd09e60a162062
User talk:YX Edits
3
288
737
2023-08-27T08:53:49Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:YX Edits]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 08:53, 27 August 2023
ecc5c159eb3057e862fe4a0ca57998add4d1843e
Abdullah do it all
0
219
738
673
2023-08-27T09:26:45Z
InsaneX
2
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' ([[W:Urdu | Urdu]]: محمد عبداللہ ناصر) is a Bahraini Pakistani Geotuber, well known for his YouTube channel, '''Abdullah do it all'''. Born and residing in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]] Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]]. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [[w:Islam | Islam]], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on [[w:YouTube | YouTube]] started in 2018 with the channel primarily focused on gaming content, especially around the game [[w:Geometry Dash | Geometry Dash]]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber ''World.military.king1'', Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software ''Capcut'' to ''Alight Motion'' in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* [[w:Adobe After Effects | Adobe After Effects]]
* [[w:Adobe Premiere Pro | Adobe Premiere Pro]]
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the '''Pakistan Youtube Shorts Editors Club (P.Y.S.E.C)''' alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
8e31a242101b1784eca86f9bb954d8115e0d6fcf
739
738
2023-08-27T09:27:08Z
InsaneX
2
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' ([[W:Urdu | Urdu]]: محمد عبداللہ ناصر) is a Bahraini-Pakistani Geotuber, well known for his YouTube channel, '''Abdullah do it all'''. Born and residing in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]] Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]]. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [[w:Islam | Islam]], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on [[w:YouTube | YouTube]] started in 2018 with the channel primarily focused on gaming content, especially around the game [[w:Geometry Dash | Geometry Dash]]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber ''World.military.king1'', Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software ''Capcut'' to ''Alight Motion'' in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* [[w:Adobe After Effects | Adobe After Effects]]
* [[w:Adobe Premiere Pro | Adobe Premiere Pro]]
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the '''Pakistan Youtube Shorts Editors Club (P.Y.S.E.C)''' alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
a1b1f719138db068737cfae2007e9e2932278afc
740
739
2023-08-27T09:27:32Z
InsaneX
2
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' ([[W:Urdu | Urdu]]: محمد عبداللہ ناصر) is a Bahraini-Pakistani Geotuber, well known for his [[w:YouTube|YouTube]] channel, '''Abdullah do it all'''. Born and residing in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]] Abdullah has gained significant attention in the ''Geo Community'' for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]]. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [[w:Islam | Islam]], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on [[w:YouTube | YouTube]] started in 2018 with the channel primarily focused on gaming content, especially around the game [[w:Geometry Dash | Geometry Dash]]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber ''World.military.king1'', Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software ''Capcut'' to ''Alight Motion'' in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* [[w:Adobe After Effects | Adobe After Effects]]
* [[w:Adobe Premiere Pro | Adobe Premiere Pro]]
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the '''Pakistan Youtube Shorts Editors Club (P.Y.S.E.C)''' alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
f5028978ec40a1b0f793dcdeef39f811342e4ffe
741
740
2023-08-27T09:27:49Z
InsaneX
2
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' ([[W:Urdu | Urdu]]: محمد عبداللہ ناصر) is a Bahraini-Pakistani Geotuber, well known for his [[w:YouTube|YouTube]] channel, '''Abdullah do it all'''. Born and residing in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]] Abdullah has gained significant attention in the Geo Community for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]]. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [[w:Islam | Islam]], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on [[w:YouTube | YouTube]] started in 2018 with the channel primarily focused on gaming content, especially around the game [[w:Geometry Dash | Geometry Dash]]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber ''World.military.king1'', Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software ''Capcut'' to ''Alight Motion'' in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* [[w:Adobe After Effects | Adobe After Effects]]
* [[w:Adobe Premiere Pro | Adobe Premiere Pro]]
==Affiliations==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the '''Pakistan Youtube Shorts Editors Club (P.Y.S.E.C)''' alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
84d07f4c1124af39b284cfd71b8c753f212681ad
742
741
2023-08-27T09:32:03Z
InsaneX
2
/* Affiliations */
wikitext
text/x-wiki
[[File:AbdullahDoItAll-Logo.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' ([[W:Urdu | Urdu]]: محمد عبداللہ ناصر) is a Bahraini-Pakistani Geotuber, well known for his [[w:YouTube|YouTube]] channel, '''Abdullah do it all'''. Born and residing in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]] Abdullah has gained significant attention in the Geo Community for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]]. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [[w:Islam | Islam]], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on [[w:YouTube | YouTube]] started in 2018 with the channel primarily focused on gaming content, especially around the game [[w:Geometry Dash | Geometry Dash]]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber ''World.military.king1'', Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software ''Capcut'' to ''Alight Motion'' in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* [[w:Adobe After Effects | Adobe After Effects]]
* [[w:Adobe Premiere Pro | Adobe Premiere Pro]]
==Alliances==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the '''Pakistan Youtube Shorts Editors Club (P.Y.S.E.C)''' alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
4645b91e20e772fd2514746fec837affebc7454d
Nikusha Mapping
0
289
743
2023-08-27T09:34:09Z
InsaneX
2
Created page with "'''Nikoloz''' ([[w:Georgian language|Georgian]]: ნიკოლოზ) renowned for his [[w:YouTube | YouTube]] channel '''Nikusha Mapping''', is a Georgian Geotuber. As of [date of last update], he has a following of approximately 1.87K subscribers with a total of 352K views on his videos. ==Early Life== Nikoloz was born on February 16, 2010, in [[w:Tbilisi|Tbilisi]], [[w:Georgia|Georgia]]. He showed a deep passion for geography and history from a young age. ==YouTub..."
wikitext
text/x-wiki
'''Nikoloz''' ([[w:Georgian language|Georgian]]: ნიკოლოზ) renowned for his [[w:YouTube | YouTube]] channel '''Nikusha Mapping''', is a Georgian Geotuber. As of [date of last update], he has a following of approximately 1.87K subscribers with a total of 352K views on his videos.
==Early Life==
Nikoloz was born on February 16, 2010, in [[w:Tbilisi|Tbilisi]], [[w:Georgia|Georgia]]. He showed a deep passion for geography and history from a young age.
==YouTube Career==
Combining his interests in geography and history, Nikoloz embarked on his journey as a Geotuber. To create his content, he primarily relies on tools like ''CapCut'', but also occasionally uses applications such as ''Background Eraser'', ''Sketch'' and ''FlipaClip''. Nikoloz's videos showcase a fusion of geographical insights and historical contexts. Through his videos, he engages his audience by unraveling the complexities of various geographical regions and their intertwined histories.
==Alliances==
Landen plays an active role in the geo community, being the member of '''D.O.Y''' and '''Anti KATO'''.
==External Links==
* [https://www.youtube.com/@Nikusha_Mapping/ Nikusha Mapping on YouTube]
b1dfd4c1986fef846f6c40de3d72612046f1c087
745
743
2023-08-27T09:35:59Z
InsaneX
2
wikitext
text/x-wiki
[[File:Nikusha_Mapping_Logo.jpg|thumb|300px|Logo of Nikusha Mapping.]]
'''Nikoloz''' ([[w:Georgian language|Georgian]]: ნიკოლოზ) renowned for his [[w:YouTube | YouTube]] channel '''Nikusha Mapping''', is a Georgian Geotuber. As of [date of last update], he has a following of approximately 1.87K subscribers with a total of 352K views on his videos.
==Early Life==
Nikoloz was born on February 16, 2010, in [[w:Tbilisi|Tbilisi]], [[w:Georgia|Georgia]]. He showed a deep passion for geography and history from a young age.
==YouTube Career==
Combining his interests in geography and history, Nikoloz embarked on his journey as a Geotuber. To create his content, he primarily relies on tools like ''CapCut'', but also occasionally uses applications such as ''Background Eraser'', ''Sketch'' and ''FlipaClip''. Nikoloz's videos showcase a fusion of geographical insights and historical contexts. Through his videos, he engages his audience by unraveling the complexities of various geographical regions and their intertwined histories.
==Alliances==
Nikoloz plays an active role in the geo community, being the member of '''D.O.Y''' and '''Anti KATO'''.
==External Links==
* [https://www.youtube.com/@Nikusha_Mapping/ Nikusha Mapping on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
d9b786fa3171a30ff154a3af36e511edd54a5860
746
745
2023-08-27T09:36:44Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
[[File:Nikusha_Mapping_Logo.jpg|thumb|300px|Logo of Nikusha Mapping.]]
'''Nikoloz''' ([[w:Georgian language|Georgian]]: ნიკოლოზ) renowned for his [[w:YouTube | YouTube]] channel '''Nikusha Mapping''', is a Georgian Geotuber. As of [date of last update], he has a following of approximately 1.87K subscribers with a total of 352K views on his videos.
==Early Life==
Nikoloz was born on February 16, 2010, in [[w:Tbilisi|Tbilisi]], [[w:Georgia|Georgia]]. He showed a deep passion for geography and history from a young age.
==YouTube Career==
Combining his interests in geography and history, Nikoloz embarked on his journey as a Geotuber. To create his content, he primarily relies on tools like ''CapCut'', but also occasionally uses applications such as ''Background Eraser'', [[w:Sketch (software)|Sketch]] and ''FlipaClip''. Nikoloz's videos showcase a fusion of geographical insights and historical contexts. Through his videos, he engages his audience by unraveling the complexities of various geographical regions and their intertwined histories.
==Alliances==
Nikoloz plays an active role in the geo community, being the member of '''D.O.Y''' and '''Anti KATO'''.
==External Links==
* [https://www.youtube.com/@Nikusha_Mapping/ Nikusha Mapping on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
2703860a8411742463840112318ecbf317dede06
753
746
2023-08-28T14:24:20Z
94.240.219.216
0
Fixed date of birth
wikitext
text/x-wiki
[[File:Nikusha_Mapping_Logo.jpg|thumb|300px|Logo of Nikusha Mapping.]]
'''Nikoloz''' ([[w:Georgian language|Georgian]]: ნიკოლოზ) renowned for his [[w:YouTube | YouTube]] channel '''Nikusha Mapping''', is a Georgian Geotuber. As of [date of last update], he has a following of approximately 1.87K subscribers with a total of 352K views on his videos.
==Early Life==
Nikoloz was born on December 19, 2006, in [[w:Tbilisi|Tbilisi]], [[w:Georgia|Georgia]]. He showed a deep passion for geography and history from a young age.
==YouTube Career==
Combining his interests in geography and history, Nikoloz embarked on his journey as a Geotuber. To create his content, he primarily relies on tools like ''CapCut'', but also occasionally uses applications such as ''Background Eraser'', [[w:Sketch (software)|Sketch]] and ''FlipaClip''. Nikoloz's videos showcase a fusion of geographical insights and historical contexts. Through his videos, he engages his audience by unraveling the complexities of various geographical regions and their intertwined histories.
==Alliances==
Nikoloz plays an active role in the geo community, being the member of '''D.O.Y''' and '''Anti KATO'''.
==External Links==
* [https://www.youtube.com/@Nikusha_Mapping/ Nikusha Mapping on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
4d5394f1d86b72ea4e081ccb039567f246cc7db6
File:Nikusha Mapping Logo.jpg
6
290
744
2023-08-27T09:35:27Z
InsaneX
2
Logo of Nikusha Mapping.
wikitext
text/x-wiki
== Summary ==
Logo of Nikusha Mapping.
5670fc2524936e50640db12130bafb669d6eeb11
User:Filip Edits
2
291
747
2023-08-27T14:59:15Z
Filip Edits
45
Created page with "'''Filip Edits''' is a new Geotuber who is gainig many subscribers. He made his channel of the 17th of June 2023 and has 4.51k '''subscribers.''' He is 12 years old, and has gained over 2.5 '''million''' views as of the 27th of August."
wikitext
text/x-wiki
'''Filip Edits''' is a new Geotuber who is gainig many subscribers. He made his channel of the 17th of June 2023 and has 4.51k '''subscribers.''' He is 12 years old, and has gained over 2.5 '''million''' views as of the 27th of August.
7e65ec6a028f1695eb873dde469273d503b37cea
User talk:Filip Edits
3
292
748
2023-08-27T17:24:26Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:Filip Edits]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 17:24, 27 August 2023
9a36f3cfbb9d5204ea106f8be29397d709f7d681
Talk:Glitch Editz
1
293
750
2023-08-27T20:45:57Z
Riyadh edits25
47
Created page with "bro is big noy"
wikitext
text/x-wiki
bro is big noy
0fd600a6d6ae00a6b5caf1cf505f61202ab2d827
Based.Saudi.Bangladeshi.21
0
240
749
694
2023-08-28T15:06:27Z
InsaneX
2
wikitext
text/x-wiki
[[File:Based.saudi.bangladeshi.21_Logo.jpg|thumb|300px|Logo of Based.Saudi.Bangladeshi.21.]]
'''Ahmed Salman''' ([[W:Arabic | Arabic]]: أحمد سلمان; [[W:Bengali_language|Bangla]]: আহমেদ সালমান) is a Geotuber prominently known for his [[w:YouTube | YouTube]] channel '''Based.Saudi.Bangladeshi.21'''. Born on May 6, 2009, in [[W:Taif | Taif]], [[w:Mecca_Province | Mecca province]], [[w:Saudi_Arabia | Saudi Arabia]], he relocated to [[w:Dhaka | Dhaka]], [[w:Bangladesh | Bangladesh]], in September 2021 and later moved permanently to [[w:Sirajganj_District | Sirajganj]], [[w:Rajshahi_District | Rajshahi District]], [[w:Bangladesh | Bangladesh]], in March 2023.
== Early Life and Background ==
Ahmed's initial exposure to YouTube was in 2019 when he launched his first channel. Despite gaining 25k views and 258 subscribers, he deleted the channel due to familial pressures. With his family's subsequent consent, Ahmed launched his second YouTube channel on October 3, 2022. He drew inspiration from the YouTuber Based Iraqi 21, now popularly referred to as Iraqi Muslim, naming his channel in a similar vein. Ahmed possesses a profound interest in politics and history, advocating for the [[w:Bangladesh_Nationalist_Party | BNP (Bangladesh Nationalist Party)]] in Bangladesh and supporting [[w:Monarchy | monarchy]] in Saudi Arabia.
== YouTube and Instagram Presence ==
While Ahmed's YouTube career began with a setback, his determination led him to a second venture in 2022, heavily inspired by other content creators. On [[w:Instagram | Instagram]], Ahmed, under the name '''سلمان أحمد''', initially achieved recognition when one of his anime-related posts, specifically about [[w:Demon_Slayer:_Kimetsu_no_Yaiba | Demon Slayer]], accumulated 354k views. While he primarily focuses on Geo content, his passion for anime, particularly Demon Slayer, often translates into his Instagram posts where he shares edited anime content. Ahmed frequently engages on Instagram, making him quite accessible to his followers. Surprised by the reach of his anime post, Ahmed's following has since grown to almost 500.
== Editing Styles and Tools ==
Initially, Ahmed began his editing journey using ''InShot''. However, as he sought to improve and diversify his editing skills, he transitioned to software like ''CapCut'' and is currently acquainting himself with ''Alight Motion''.
== Alliances ==
Ahmed Salman is an active member of multiple alliances within the Geo community. These alliances foster collaboration among their members, allowing for the creation of joint edits and shared geo-content. His memberships include:
* '''Pakistan Geotuber Alliance (P.G.A)'''
* '''United Alliance of Geotuber (U.A.G)'''
* '''United States Geotuber Alliance (U.S.G.A)'''
* '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)'''
== External Links ==
* [https://youtube.com/@Based.Saudi.Bangladeshi.21 Based.Saudi.Bangladeshi.21 on YouTube]
* [https://instagram.com/ahmed.salman21 Based.Saudi.Bangladeshi.21 on Instagram]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
bded079872f42fb74971ac41838372e6024bed41
User:Riyadh edits25
2
294
751
2023-08-28T15:07:25Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:Riyadh edits25
3
295
752
2023-08-28T15:07:25Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:Talk:Glitch Editz]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 15:07, 28 August 2023
c10d78dcb66c802f03ddf07ed75d45c0fbd51583
Geographyify
0
296
754
2023-08-28T15:32:14Z
InsaneX
2
Created page with "'''Ahnaf Abrar Khan''' ([[w:Bangla | Bengali language]]: আহনাফ আবরার খান) is a Bangladeshi Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Geographyify'''. == Early Life == Ahnaf Abrar Khan was born on December 25th, 2009, in [[w:Dhaka|Dhaka]], [[w:Bangladesh|Bangladesh]]. From a young age, he exhibited a keen interest in [[w:Football|football]] and was always curious about the world map. He later relocated to w:Los Angele..."
wikitext
text/x-wiki
'''Ahnaf Abrar Khan''' ([[w:Bangla | Bengali language]]: আহনাফ আবরার খান) is a Bangladeshi Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Geographyify'''.
== Early Life ==
Ahnaf Abrar Khan was born on December 25th, 2009, in [[w:Dhaka|Dhaka]], [[w:Bangladesh|Bangladesh]]. From a young age, he exhibited a keen interest in [[w:Football|football]] and was always curious about the world map. He later relocated to [[w:Los Angeles|Los Angeles]], [[w:California|California]], [[w:United States|USA]] from Dhaka.
== YouTube Career ==
The inspiration behind Ahnaf's foray into YouTube was driven by his passion for Bangladesh and his conversations with a friend who shared similar interests. Both were inspired by the YouTube channel World.Military.King. Ahnaf's friend initially started a channel focused on military-related videos, which motivated Ahnaf to start his own channel. Despite the significant success Ahnaf achieved after his first video garnered two thousand views, his friend's channel did not share the same fate and eventually became inactive. Ahnaf uses ''CapCut'' to edit his videos and relies on ''Canva'' for creating logos, banners, or thumbnails.
== External Links ==
* [https://www.youtube.com/@Geographyify Geographyify on YouTube]
* [https://www.instagram.com/thereal_geographyify/ Geographyify on Instagram]
* [https://www.tiktok.com/@geographyify Geographyify on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
deef462999daaef9c55beea87f18160523c98a24
755
754
2023-08-28T15:39:08Z
InsaneX
2
wikitext
text/x-wiki
'''Ahnaf Abrar Khan''' ([[w:Bangla | Bengali language]]: আহনাফ আবরার খান) is a Bangladeshi Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Geographyify'''. Renowned for his in-depth geographical insights and engaging video content, Ahnaf blends his personal experiences and academic curiosity to make geography accessible and enjoyable for a vast audience.
== Early Life ==
Ahnaf Abrar Khan was born on December 25th, 2009, in [[w:Dhaka|Dhaka]], [[w:Bangladesh|Bangladesh]]. From a young age, he exhibited a keen interest in [[w:Football|football]] and was always curious about the world map. He later relocated to [[w:Los Angeles|Los Angeles]], [[w:California|California]], [[w:United States|USA]] from Dhaka.
== YouTube Career ==
The inspiration behind Ahnaf's foray into YouTube was driven by his passion for Bangladesh and his conversations with a friend who shared similar interests. Both were inspired by the YouTube channel World.Military.King. Ahnaf's friend initially started a channel focused on military-related videos, which motivated Ahnaf to start his own channel. Despite the significant success Ahnaf achieved after his first video garnered two thousand views, his friend's channel did not share the same fate and eventually became inactive. Ahnaf uses ''CapCut'' to edit his videos and relies on ''Canva'' for creating logos, banners, or thumbnails.
== External Links ==
* [https://www.youtube.com/@Geographyify Geographyify on YouTube]
* [https://www.instagram.com/thereal_geographyify/ Geographyify on Instagram]
* [https://www.tiktok.com/@geographyify Geographyify on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
35204e8386b64123112aa244f527af5e293bce48
756
755
2023-08-28T15:39:39Z
InsaneX
2
wikitext
text/x-wiki
'''Ahnaf Abrar Khan''' ([[w:Bengali language| Bangla]]: আহনাফ আবরার খান) is a Bangladeshi Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Geographyify'''. Renowned for his in-depth geographical insights and engaging video content, Ahnaf blends his personal experiences and academic curiosity to make geography accessible and enjoyable for a vast audience.
== Early Life ==
Ahnaf Abrar Khan was born on December 25th, 2009, in [[w:Dhaka|Dhaka]], [[w:Bangladesh|Bangladesh]]. From a young age, he exhibited a keen interest in [[w:Football|football]] and was always curious about the world map. He later relocated to [[w:Los Angeles|Los Angeles]], [[w:California|California]], [[w:United States|USA]] from Dhaka.
== YouTube Career ==
The inspiration behind Ahnaf's foray into YouTube was driven by his passion for Bangladesh and his conversations with a friend who shared similar interests. Both were inspired by the YouTube channel World.Military.King. Ahnaf's friend initially started a channel focused on military-related videos, which motivated Ahnaf to start his own channel. Despite the significant success Ahnaf achieved after his first video garnered two thousand views, his friend's channel did not share the same fate and eventually became inactive. Ahnaf uses ''CapCut'' to edit his videos and relies on ''Canva'' for creating logos, banners, or thumbnails.
== External Links ==
* [https://www.youtube.com/@Geographyify Geographyify on YouTube]
* [https://www.instagram.com/thereal_geographyify/ Geographyify on Instagram]
* [https://www.tiktok.com/@geographyify Geographyify on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
f12ceb9de4cf2e2b6055e7fcfe5583fcd11e050d
758
756
2023-08-28T15:40:34Z
InsaneX
2
wikitext
text/x-wiki
[[File:Geographyify_Logo.jpg|thumb|300px|Logo of Geographyify.]]
'''Ahnaf Abrar Khan''' ([[w:Bengali language| Bangla]]: আহনাফ আবরার খান) is a Bangladeshi Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Geographyify'''. Renowned for his in-depth geographical insights and engaging video content, Ahnaf blends his personal experiences and academic curiosity to make geography accessible and enjoyable for a vast audience.
== Early Life ==
Ahnaf Abrar Khan was born on December 25th, 2009, in [[w:Dhaka|Dhaka]], [[w:Bangladesh|Bangladesh]]. From a young age, he exhibited a keen interest in [[w:Football|football]] and was always curious about the world map. He later relocated to [[w:Los Angeles|Los Angeles]], [[w:California|California]], [[w:United States|USA]] from Dhaka.
== YouTube Career ==
The inspiration behind Ahnaf's foray into YouTube was driven by his passion for Bangladesh and his conversations with a friend who shared similar interests. Both were inspired by the YouTube channel World.Military.King. Ahnaf's friend initially started a channel focused on military-related videos, which motivated Ahnaf to start his own channel. Despite the significant success Ahnaf achieved after his first video garnered two thousand views, his friend's channel did not share the same fate and eventually became inactive. Ahnaf uses ''CapCut'' to edit his videos and relies on ''Canva'' for creating logos, banners, or thumbnails.
== External Links ==
* [https://www.youtube.com/@Geographyify Geographyify on YouTube]
* [https://www.instagram.com/thereal_geographyify/ Geographyify on Instagram]
* [https://www.tiktok.com/@geographyify Geographyify on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
360fea8cee5b3f5f749a6ffab94fd741eb20494d
File:Geographyify Logo.jpg
6
297
757
2023-08-28T15:40:04Z
InsaneX
2
Logo of Geographyify.
wikitext
text/x-wiki
== Summary ==
Logo of Geographyify.
430aebbe55a48cc943300ea15b1f5c7ef782e550
Nato Mapper
0
298
759
2023-08-28T16:08:29Z
That muslim kid
9
Created page with "'''Diez''' is a German Geotuber, notable for their [[w:YouTube|YouTube]] channel, '''GeographyExplorer'''. == Early Life == Diez, born in August 2009 in Cologne, Germany, has always held a strong passion for their country. Growing up as a German nationalist, this sentiment has remained a significant part of their identity. == YouTube Career == Diez initially embarked on their YouTube journey by sharing content related to the video game ''Rocket League'' from October 22..."
wikitext
text/x-wiki
'''Diez''' is a German Geotuber, notable for their [[w:YouTube|YouTube]] channel, '''GeographyExplorer'''.
== Early Life ==
Diez, born in August 2009 in Cologne, Germany, has always held a strong passion for their country. Growing up as a German nationalist, this sentiment has remained a significant part of their identity.
== YouTube Career ==
Diez initially embarked on their YouTube journey by sharing content related to the video game ''Rocket League'' from October 22 to February 23. During this phase, they amassed a subscriber count of 216. However, a pivotal moment in their content consumption occurred when they came across a recommended video from the channel ''Glitch Editz''.
Inspired by the world of Geotubing, Diez decided to transition their content focus. This marked the inception of their channel, ''GeographyExplorer'', which is dedicated to exploring and comparing countries, empires, and other geographical topics.
== Ancestry and Background ==
With a diverse ancestral background, Diez's heritage is a blend of 87% German, 10% Malay, and 2% Italian. This mixture of cultures and identities plays a role in shaping their unique perspective on geography.
== YouTube Shorts and Creativity ==
One distinctive aspect of Diez's content creation process is that they craft all their YouTube Shorts using their smartphone. This commitment to creativity and convenience has allowed them to present engaging geographical insights in a concise format.
== External Links ==
* [https://www.youtube.com/geographyexplorer GeographyExplorer YouTube Channel]
== Categories ==
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
d60f3f1707bd968dd4d0a29585f4b13cb39e2ffd
760
759
2023-08-28T16:31:14Z
InsaneX
2
wikitext
text/x-wiki
'''Diez''' is a German Geotuber, well known for his [[w:YouTube|YouTube]] channel, '''Nato Mapper'''. Born in 2009 in [[w:Cologne|Cologne]], [[w:Germany|Germany]], He has always held a strong passion for his country.
== Early Life ==
Diez was born on August 2009 in [[w:Cologne|Cologne]], [[w:Germany|Germany]]. He has always held a strong passion for their country. Growing up as a German nationalist, this sentiment has remained a significant part of their identity.
== YouTube Career ==
Diez initially embarked on their YouTube journey by sharing content related to the video game ''Rocket League'' from October 22 to February 23. During this phase, they amassed a subscriber count of 216. However, a pivotal moment in their content consumption occurred when they came across a recommended video from the channel ''Glitch Editz''.
Inspired by the world of Geotubing, Diez decided to transition their content focus. This marked the inception of their channel, ''GeographyExplorer'', which is dedicated to exploring and comparing countries, empires, and other geographical topics.
== Ancestry and Background ==
With a diverse ancestral background, Diez's heritage is a blend of 87% German, 10% Malay, and 2% Italian. This mixture of cultures and identities plays a role in shaping their unique perspective on geography.
== YouTube Shorts and Creativity ==
One distinctive aspect of Diez's content creation process is that they craft all their YouTube Shorts using their smartphone. This commitment to creativity and convenience has allowed them to present engaging geographical insights in a concise format.
== External Links ==
* [https://www.youtube.com/geographyexplorer GeographyExplorer YouTube Channel]
== Categories ==
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
f84e0ea71148af4a20e99a8455dbd099b5982305
761
760
2023-08-28T16:35:27Z
InsaneX
2
wikitext
text/x-wiki
'''Diez''' is a German Geotuber, well known for his [[w:YouTube|YouTube]] channel, '''Nato Mapper'''. Born in 2009 in [[w:Cologne|Cologne]], [[w:Germany|Germany]], He has always held a strong passion for his country.
== Early Life ==
Diez was born on August 2009 in [[w:Cologne|Cologne]], [[w:Germany|Germany]]. He has always held a strong passion for their country. Growing up as a German nationalist, this sentiment has remained a significant part of their identity.
== YouTube Career ==
Diez initially embarked on their [[w:YouTube|YouTube]] journey by sharing content related to the video game ''Rocket League'' from October 22 to February 23. During this phase, they amassed a subscriber count of 216. However, a pivotal moment in their content consumption occurred when they came across a recommended video from the channel ''Glitch Editz''.
Inspired by the world of Geotubing, Diez decided to transition their content focus. This marked the inception of their channel, ''GeographyExplorer'', which is dedicated to exploring and comparing countries, empires, and other geographical topics.
== External Links ==
* [https://www.youtube.com/geographyexplorer GeographyExplorer YouTube Channel]
== Categories ==
[[Category:List of Geotubers]]
009a13645afbd6d65b6a550e0bf2054f8757168d
763
761
2023-08-28T16:41:50Z
InsaneX
2
wikitext
text/x-wiki
[[File:Nato_Mapper_Logo.jpg|thumb|300px|Logo of Nato Mapper.]]
'''Diez''' is a German Geotuber, well known for his [[w:YouTube|YouTube]] channel, '''Nato Mapper'''. Born in 2009 in [[w:Cologne|Cologne]], [[w:Germany|Germany]], He has always held a strong passion for his country.
== Early Life ==
Diez was born on August 2009 in [[w:Cologne|Cologne]], [[w:Germany|Germany]]. He has always held a strong passion for their country. Growing up as a German nationalist, this sentiment has remained a significant part of their identity.
== YouTube Career ==
Diez initially embarked on their [[w:YouTube|YouTube]] journey by sharing content related to the video game ''Rocket League'' from October 22 to February 23. During this phase, they amassed a subscriber count of 216. However, a pivotal moment in their content consumption occurred when they came across a recommended video from the channel ''Glitch Editz''.
Inspired by the world of Geotubing, Diez decided to transition their content focus. This marked the inception of their channel, ''GeographyExplorer'', which is dedicated to exploring and comparing countries, empires, and other geographical topics.
== External Links ==
* [https://www.youtube.com/geographyexplorer GeographyExplorer YouTube Channel]
== Categories ==
[[Category:List of Geotubers]]
54e3c9de4d889bdb30c882d59e40ff42d44b79ad
764
763
2023-08-28T16:56:59Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:Nato_Mapper_Logo.jpg|thumb|300px|Logo of Nato Mapper.]]
'''Diez''' is a German Geotuber, well known for his [[w:YouTube|YouTube]] channel, '''Nato Mapper'''. Born in 2009 in [[w:Cologne|Cologne]], [[w:Germany|Germany]], He has always held a strong passion for his country.
== Early Life ==
Diez was born on August 2009 in [[w:Cologne|Cologne]], [[w:Germany|Germany]]. He has always held a strong passion for their country. Growing up as a German nationalist, this sentiment has remained a significant part of their identity.
== YouTube Career ==
Diez initially embarked on their [[w:YouTube|YouTube]] journey by sharing content related to the video game ''Rocket League'' from October 22 to February 23. During this phase, they amassed a subscriber count of 216. However, a pivotal moment in their content consumption occurred when they came across a recommended video from the channel ''Glitch Editz''.
Inspired by the world of Geotubing, Diez decided to transition their content focus. This marked the inception of their channel, ''GeographyExplorer'', which is dedicated to exploring and comparing countries, empires, and other geographical topics.
== External Links ==
* [https://www.youtube.com/@theonenatomapper Nato Mapper on YouTube]
== Categories ==
[[Category:List of Geotubers]]
b04a512d56f410bf6b7c550cffc6aa0d0298470a
765
764
2023-08-28T16:57:30Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
[[File:Nato_Mapper_Logo.jpg|thumb|300px|Logo of Nato Mapper.]]
'''Diez''' is a German Geotuber, well known for his [[w:YouTube|YouTube]] channel, '''Nato Mapper'''. Born in 2009 in [[w:Cologne|Cologne]], [[w:Germany|Germany]], He has always held a strong passion for his country.
== Early Life ==
Diez was born on August 2009 in [[w:Cologne|Cologne]], [[w:Germany|Germany]]. He has always held a strong passion for their country. Growing up as a German nationalist, this sentiment has remained a significant part of their identity.
== YouTube Career ==
Diez initially embarked on their [[w:YouTube|YouTube]] journey by sharing content related to the video game ''Rocket League'' from October 22 to February 23. During this phase, they amassed a subscriber count of 216. However, a pivotal moment in their content consumption occurred when they came across a recommended video from the channel ''Glitch Editz''.
Inspired by the world of Geotubing, Diez decided to transition their content focus. This marked the inception of their channel, ''Nato Mapper'', which is dedicated to exploring and comparing countries, empires, and other geographical topics.
== External Links ==
* [https://www.youtube.com/@theonenatomapper Nato Mapper on YouTube]
== Categories ==
[[Category:List of Geotubers]]
d6504863a0808c7cb799fb1ee14433c22490ba1a
File:Nato Mapper Logo.jpg
6
299
762
2023-08-28T16:35:54Z
InsaneX
2
Logo of Nato Mapper.
wikitext
text/x-wiki
== Summary ==
Logo of Nato Mapper.
1ad9c5c00329166bb0f384af8d9a9fd52f132cd5
World.Military.Reality
0
238
766
617
2023-08-29T16:20:18Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:World.Military.Reality_Logo.jpg|thumb|300px|Logo of World.Military.Reality.]]
'''Abdullah Tahir''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: عبداللہ طاہر) is a Pakistani Geotuber known for his [https://en.wikipedia.org/wiki/YouTube YouTube] channel '''World.Military.Reality'''. The channel was launched on October 1, 2022, and within nine months has garnered nearly 17,000 subscribers and close to 3.5 million views. World.Military.Reality has gained significant attention in the Geo community due to its distinctive takes on history, geography, and geopolitical topics.
== Early Life ==
Abdullah was born in [https://en.wikipedia.org/wiki/Islamabad Islamabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. From an early age, he exhibited a keen interest in military, geography, history, and [https://en.wikipedia.org/wiki/Geopolitics geopolitics].
== YouTube Career ==
Abdullah began his YouTube journey in 2019, focusing primarily on gaming content, especially centered around [https://en.wikipedia.org/wiki/Roblox Roblox]. From 2019 to 2021, despite numerous video uploads, the channel could only manage to amass around 100 subscribers and about 50,000 views.
In 2022, after being introduced to the Geo community and watching content from other Geotubers, Abdullah's passion was rekindled. On October 1, 2023, following a break, he initiated his third YouTube channel dedicated to geopolitics and military-related subjects. Abdullah started by using CapCut for video editing but soon moved to Alight Motion to further enhance his editing capabilities. This transition played a pivotal role in uplifting the quality of his content, resulting in a significant growth spurt for his channel. Such rapid growth affirmed Abdullah's standing in the Geo community, identifying him as a notable Geotuber.
== Editing Styles and Tools ==
Abdullah's distinct editing style and unique subject choices have not only made him popular but have also inspired others to emulate his content. He utilizes a combination of software tools to bring his creative visions to life:
* CapCut
* Alight Motion
* ibis Paint X
* Pixel lab
* [https://en.wikipedia.org/wiki/Adobe_Lightroom Adobe Lightroom]
== External Links ==
* [https://youtube.com/@World.Military.Reality World.Military.Reality on YouTube]
* [https://www.tiktok.com/@world.military.reality._?_t=8enj7uQlkj2&_r=1 World.Military.Reality on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
753c0fcecaae39815a47d09e70cc5ce321780661
EnfeMapping
0
300
767
2023-08-29T16:34:19Z
InsaneX
2
Created page with "'''EnfeMapping''' is a well known [[w:YouTube | YouTube]] content creator and Geotuber based in [[w:Turkey|Turkey]]. With a subscriber count nearing 80,000 and over 39.4 million views, the channel focuses on geographical comparisons and historical analyses, primarily revolving around Turkish history. == YouTube Career == Before delving into the world of YouTube, EnfeMapping described himself as an "ordinary student." His initial content concentrated on Turkish history v..."
wikitext
text/x-wiki
'''EnfeMapping''' is a well known [[w:YouTube | YouTube]] content creator and Geotuber based in [[w:Turkey|Turkey]]. With a subscriber count nearing 80,000 and over 39.4 million views, the channel focuses on geographical comparisons and historical analyses, primarily revolving around Turkish history.
== YouTube Career ==
Before delving into the world of YouTube, EnfeMapping described himself as an "ordinary student." His initial content concentrated on Turkish history videos. However, he took a hiatus from content creation for three months due to the [[W:2023 Turkey–Syria earthquake|Turkey–Syria earthquake]].
On returning, he was inspired by the channel ''MapOfGeogrraphy'' and began his journey into creating mapping videos. Despite facing several challenges in the early phases of his YouTube career, he managed to gain significant popularity. For the creation of his content, EnfeMapping uses a range of software including ''Ibis Paint'', ''Capcut'', [[w:Adobe After Effects | Adobe After Effects]], and [[w:Adobe Photoshop | Adobe Photoshop]].
== External Links ==
* [[https://www.youtube.com/@EnfeMapping | EnfeMapping on YouTube]]
* [[https://www.tiktok.com/@enfemapping | EnfeMapping on TikTok]]
* [[https://www.instagram.com/enfe.mapping_/ | EnfeMapping on Instagram]]
d9850e91912edea55b04aa22e4c187cf5b14dd3b
768
767
2023-08-29T16:39:38Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
'''EnfeMapping''' is a well known [[w:YouTube | YouTube]] content creator and Geotuber based in [[w:Turkey|Turkey]]. With a subscriber count nearing 80,000 and over 39.4 million views, the channel focuses on geographical comparisons and historical analyses, primarily revolving around Turkish history.
== YouTube Career ==
Before delving into the world of YouTube, EnfeMapping described himself as an "ordinary student." His initial content concentrated on Turkish history videos. However, he took a hiatus from content creation for three months due to the [[W:2023 Turkey–Syria earthquake|Turkey–Syria earthquake]].
On returning, he was inspired by the channel ''MapOfGeogrraphy'' and began his journey into creating mapping videos. Despite facing several challenges in the early phases of his YouTube career, he managed to gain significant popularity. For the creation of his content, EnfeMapping uses a range of software including ''Ibis Paint'', ''Capcut'', [[w:Adobe After Effects | Adobe After Effects]], and [[w:Adobe Photoshop | Adobe Photoshop]].
== External Links ==
* https://www.youtube.com/@EnfeMapping | EnfeMapping on YouTube]
* [https://www.tiktok.com/@enfemapping | EnfeMapping on TikTok]
* [https://www.instagram.com/enfe.mapping_/ | EnfeMapping on Instagram]
36d5c2d90a67541d8223c6e0ddeefeede4618b21
769
768
2023-08-29T16:40:01Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
'''EnfeMapping''' is a well known [[w:YouTube | YouTube]] content creator and Geotuber based in [[w:Turkey|Turkey]]. With a subscriber count nearing 80,000 and over 39.4 million views, the channel focuses on geographical comparisons and historical analyses, primarily revolving around Turkish history.
== YouTube Career ==
Before delving into the world of YouTube, EnfeMapping described himself as an "ordinary student." His initial content concentrated on Turkish history videos. However, he took a hiatus from content creation for three months due to the [[W:2023 Turkey–Syria earthquake|Turkey–Syria earthquake]].
On returning, he was inspired by the channel ''MapOfGeogrraphy'' and began his journey into creating mapping videos. Despite facing several challenges in the early phases of his YouTube career, he managed to gain significant popularity. For the creation of his content, EnfeMapping uses a range of software including ''Ibis Paint'', ''Capcut'', [[w:Adobe After Effects | Adobe After Effects]], and [[w:Adobe Photoshop | Adobe Photoshop]].
== External Links ==
* https://www.youtube.com/@EnfeMapping EnfeMapping on YouTube]
* [https://www.tiktok.com/@enfemapping EnfeMapping on TikTok]
* [https://www.instagram.com/enfe.mapping_/ EnfeMapping on Instagram]
3eaa9ad73e4d304280e2c9c37d9065a8ebee7e87
770
769
2023-08-29T16:40:10Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
'''EnfeMapping''' is a well known [[w:YouTube | YouTube]] content creator and Geotuber based in [[w:Turkey|Turkey]]. With a subscriber count nearing 80,000 and over 39.4 million views, the channel focuses on geographical comparisons and historical analyses, primarily revolving around Turkish history.
== YouTube Career ==
Before delving into the world of YouTube, EnfeMapping described himself as an "ordinary student." His initial content concentrated on Turkish history videos. However, he took a hiatus from content creation for three months due to the [[W:2023 Turkey–Syria earthquake|Turkey–Syria earthquake]].
On returning, he was inspired by the channel ''MapOfGeogrraphy'' and began his journey into creating mapping videos. Despite facing several challenges in the early phases of his YouTube career, he managed to gain significant popularity. For the creation of his content, EnfeMapping uses a range of software including ''Ibis Paint'', ''Capcut'', [[w:Adobe After Effects | Adobe After Effects]], and [[w:Adobe Photoshop | Adobe Photoshop]].
== External Links ==
* [https://www.youtube.com/@EnfeMapping EnfeMapping on YouTube]
* [https://www.tiktok.com/@enfemapping EnfeMapping on TikTok]
* [https://www.instagram.com/enfe.mapping_/ EnfeMapping on Instagram]
a6d5a67441a33caeb54204b4b849842369e730d5
771
770
2023-08-29T16:40:51Z
InsaneX
2
wikitext
text/x-wiki
[[File:EnfeMapping_Logo.jpg|thumb|300px|Logo of EnfeMapping.]]
'''EnfeMapping''' is a well known [[w:YouTube | YouTube]] content creator and Geotuber based in [[w:Turkey|Turkey]]. With a subscriber count nearing 80,000 and over 39.4 million views, the channel focuses on geographical comparisons and historical analyses, primarily revolving around Turkish history.
== YouTube Career ==
Before delving into the world of YouTube, EnfeMapping described himself as an "ordinary student." His initial content concentrated on Turkish history videos. However, he took a hiatus from content creation for three months due to the [[W:2023 Turkey–Syria earthquake|Turkey–Syria earthquake]].
On returning, he was inspired by the channel ''MapOfGeogrraphy'' and began his journey into creating mapping videos. Despite facing several challenges in the early phases of his YouTube career, he managed to gain significant popularity. For the creation of his content, EnfeMapping uses a range of software including ''Ibis Paint'', ''Capcut'', [[w:Adobe After Effects | Adobe After Effects]], and [[w:Adobe Photoshop | Adobe Photoshop]].
== External Links ==
* [https://www.youtube.com/@EnfeMapping EnfeMapping on YouTube]
* [https://www.tiktok.com/@enfemapping EnfeMapping on TikTok]
* [https://www.instagram.com/enfe.mapping_/ EnfeMapping on Instagram]
0f2ae3853fa6154dc25f8da861af8042dcdade77
773
771
2023-08-29T16:44:30Z
InsaneX
2
wikitext
text/x-wiki
[[File:EnfeMapping_Logo.jpg|thumb|300px|Logo of EnfeMapping.]]
'''EnfeMapping''' is a well known [[w:YouTube | YouTube]] content creator and Geotuber based in [[w:Turkey|Turkey]]. With a subscriber count nearing 80,000 and over 39.4 million views, the channel focuses on geographical comparisons and historical analyses, primarily revolving around Turkish history.
== YouTube Career ==
Before delving into the world of YouTube, EnfeMapping described himself as an "ordinary student." His initial content concentrated on Turkish history videos. However, he took a hiatus from content creation for three months due to the [[W:2023 Turkey–Syria earthquake|Turkey–Syria earthquake]].
On returning, he was inspired by the channel ''MapOfGeogrraphy'' and began his journey into creating mapping videos. Despite facing several challenges in the early phases of his YouTube career, he managed to gain significant popularity. For the creation of his content, EnfeMapping uses a range of software including ''Ibis Paint'', ''Capcut'', [[w:Adobe After Effects | Adobe After Effects]], and [[w:Adobe Photoshop | Adobe Photoshop]].
== External Links ==
* [https://www.youtube.com/@EnfeMapping EnfeMapping on YouTube]
* [https://www.tiktok.com/@enfemapping EnfeMapping on TikTok]
* [https://www.instagram.com/enfe.mapping_/ EnfeMapping on Instagram]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
191f8150d6e7e1007a2e80ad5e0d95b20e0e9834
File:EnfeMapping Logo.jpg
6
301
772
2023-08-29T16:44:01Z
InsaneX
2
Logo of EnfeMapping.
wikitext
text/x-wiki
== Summary ==
Logo of EnfeMapping.
e5217ad03debcf8a4e9b265a1ae1fa1242fa80c8
ThatTurkGuy
0
302
774
2023-08-29T17:43:09Z
InsaneX
2
Created page with "[[File:ThatTurkGuy_Logo.jpg|thumb|300px|Logo of ThatTurkGuy.]] '''Fawad Tayyab''' (born December 10, 2008 in [[w:Ashgabat | Ashgabat]], [[w:Turkmenistan|Turkmenistan]]) is a Turkish-Mongolian Geotuber, better known for his [[w:YouTube | YouTube]] channel '''ThatTurkGuy''', is a notable Geotuber with almost 10K subscribers and over 4.4 million views. Later, he moved to [[w:Istanbul | Istanbul]], [[w:Turkey|Turkey]]. == Early life == Born in [[w:Ashgabat | Ashgabat]], Faw..."
wikitext
text/x-wiki
[[File:ThatTurkGuy_Logo.jpg|thumb|300px|Logo of ThatTurkGuy.]]
'''Fawad Tayyab''' (born December 10, 2008 in [[w:Ashgabat | Ashgabat]], [[w:Turkmenistan|Turkmenistan]]) is a Turkish-Mongolian Geotuber, better known for his [[w:YouTube | YouTube]] channel '''ThatTurkGuy''', is a notable Geotuber with almost 10K subscribers and over 4.4 million views. Later, he moved to [[w:Istanbul | Istanbul]], [[w:Turkey|Turkey]].
== Early life ==
Born in [[w:Ashgabat | Ashgabat]], Fawad showed early interest in football and was especially talented in the sport. He considered [[w:Cristiano Ronaldo | Cristiano Ronaldo]] to be his favorite player. However, a serious injury during one of the games forced him to take a break from the sport. During this time, he developed a passion for video editing.
== YouTube Career ==
Fawad's inspiration to enter the Geotubing world came from the renowned creator ThatHistoryGuy. Initially, he began creating content using ''CapCut'', focusing on "Country VS Country" comparison videos. His exploration of editing tools led him to discover ''Alight Motion'', an application that he quickly became proficient in. Over time, Fawad transitioned his content focus to nationalist and historical edits. He prides himself as being among the top Alight Motion editors in the Geo community, considering himself probably the second best.
== External Links ==
[https://youtube.com/@ThatTurkGuy ThatTurkGuy on YouTube]
[https://www.tiktok.com/@thatturkguy_ ThatTurkGuy on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
d214f25ddacffa4cf6605ca0ed0d6c0997e6669a
776
774
2023-08-29T17:45:35Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:ThatTurkGuy_Logo.jpg|thumb|300px|Logo of ThatTurkGuy.]]
'''Fawad Tayyab''' (born December 10, 2008 in [[w:Ashgabat | Ashgabat]], [[w:Turkmenistan|Turkmenistan]]) is a Turkish-Mongolian Geotuber, better known for his [[w:YouTube | YouTube]] channel '''ThatTurkGuy''', is a notable Geotuber with almost 10K subscribers and over 4.4 million views. Later, he moved to [[w:Istanbul | Istanbul]], [[w:Turkey|Turkey]].
== Early life ==
Born in [[w:Ashgabat | Ashgabat]], Fawad showed early interest in football and was especially talented in the sport. He considered [[w:Cristiano Ronaldo | Cristiano Ronaldo]] to be his favorite player. However, a serious injury during one of the games forced him to take a break from the sport. During this time, he developed a passion for video editing.
== YouTube Career ==
Fawad's inspiration to enter the Geotubing world came from the renowned creator ThatHistoryGuy. Initially, he began creating content using ''CapCut'', focusing on "Country VS Country" comparison videos. His exploration of editing tools led him to discover ''Alight Motion'', an application that he quickly became proficient in. Over time, Fawad transitioned his content focus to nationalist and historical edits. He prides himself as being among the top Alight Motion editors in the Geo community, considering himself probably the second best.
== External Links ==
* [https://youtube.com/@ThatTurkGuy ThatTurkGuy on YouTube]
* [https://www.tiktok.com/@thatturkguy_ ThatTurkGuy on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
58e94dc76b1012bb5ce924ef123d3877bafff580
File:ThatTurkGuy Logo.jpg
6
303
775
2023-08-29T17:44:14Z
InsaneX
2
Logo of ThatTurkGuy.
wikitext
text/x-wiki
== Summary ==
Logo of ThatTurkGuy.
f01fc1ac4d52f61b82e057fa2770ca090702825c
User:MyniwGuels
2
305
778
2023-08-29T19:43:17Z
MyniwGuels
53
.
wikitext
text/x-wiki
Sadly there is nothing :'(
f1d0d843dbc54d61ca85eaa19b0d59e083ae9464
User:Reed Schultz Geo
2
304
777
2023-08-30T05:20:58Z
Reed Schultz Geo
57
Created page with "geography youtuber with 13.2 subscrier in total"
wikitext
text/x-wiki
geography youtuber with 13.2 subscrier in total
5c678804192074e4bd8b81e1d34d35e4279e4bdd
800
777
2023-08-31T15:25:33Z
Pranav Namoju
65
ReEd ScHuLtZ GrOGiPhY
wikitext
text/x-wiki
geography youtuber with 13.29584726 subscrier in total
Reed Schultz Geo is a youtuber with subscriber and ofc as the name suggests he is a geography youtuber duhhh 😁
he has many superpowers including Mind control and Mind reading, so if u haven't subscribed to him, he will control ur mind and make u subscribe so its better u subscribe. right??
Apart from jokes he is a really nice person in general, likes to talk and chat with his fans in his discord server. If u haven't already checked his discord go and check otherwise u know what happens......😈
heres the link to the discord server. https://discord.gg/6wWPBJ6JQS
Make sure to say hi to me also🥲, my user name is @pranav if im right ig.
he is expected to hit 10 billion subs next year so yeah SUBSCRIBE ORRRRRRR......
ill be sad 😭🥲
dont scroll down
DONT SCROLL
ESPECIALLY REED
HEYYYY DONT
shhhhhh... dont say reed i wrote this and he prolly wont scroll this much
reed kinda bad compared to lenuxx. lenuxx w tho and reed kinda L. Dont Say Reed That I Wrote This
4a71a2bc4b1563392e90947d4fb54db0007a6554
User talk:Reed Schultz Geo
3
306
779
2023-08-30T12:11:10Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:Reed Schultz Geo]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 12:11, 30 August 2023
61282d13c48f4b792c68b80a8500c365a2b9ae27
User talk:MyniwGuels
3
307
780
2023-08-30T12:12:52Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:MyniwGuels]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 12:12, 30 August 2023
08fff8b9bac192a44a633fc4a244c3e07ac6ccb0
Main Page
0
1
781
662
2023-08-30T12:15:39Z
InsaneX
2
/* Featured Geotuber */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content. Join our [https://discord.gg/aPXQ5ZMjH8 Discord Server] for more Information.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Ahnaf Abrar Khan''' ([[w:Bengali language| Bangla]]: আহনাফ আবরার খান) is a Bangladeshi Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Geographyify'''. Renowned for his in-depth geographical insights and engaging video content, Ahnaf blends his personal experiences and academic curiosity to make geography accessible and enjoyable for a vast audience. [[Geographyify | Read More..]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Explore</h1> -->
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geotubers]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 12, 2023:''' [[Abdullah do it all]] page was created!
* '''August 12, 2023:''' [[Glitch Editz]] page was created!
* '''August 12, 2023:''' [[OfficialEditzPK]] page was created!
* '''August 11, 2023:''' Geotubepedia was officially launched!
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:Copyrights | Geotubpedia Copyrights]]
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Help Desk|Help Desk]]
e709147e6f2a2cbfbcd0e60a469413ee00edb9b9
782
781
2023-08-30T12:15:56Z
InsaneX
2
/* Featured Geotuber */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content. Join our [https://discord.gg/aPXQ5ZMjH8 Discord Server] for more Information.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Ahnaf Abrar Khan''' ([[w:Bengali language| Bangla]]: আহনাফ আবরার খান) is a Bangladeshi Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Geographyify'''. Renowned for his in-depth geographical insights and engaging video content, Ahnaf blends his personal experiences and academic curiosity to make geography accessible and enjoyable for a vast audience. [[Geographyify | Read More..]]
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geotubers]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Recent Changes===
* '''August 12, 2023:''' [[Abdullah do it all]] page was created!
* '''August 12, 2023:''' [[Glitch Editz]] page was created!
* '''August 12, 2023:''' [[OfficialEditzPK]] page was created!
* '''August 11, 2023:''' Geotubepedia was officially launched!
* '''August 10, 2023:''' [[Saif Sheikh Edits]] page was created!
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:Copyrights | Geotubpedia Copyrights]]
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Help Desk|Help Desk]]
0241394a22a3cacf775cb2bdd9760ce59b083e69
Data Channel
0
283
783
729
2023-08-30T15:11:18Z
InsaneX
2
wikitext
text/x-wiki
[[File:Data_Channel_Logo.jpg|thumb|300px|Logo of Data Channel.]]
<translate>
'''Data Channel''' is a Ukrainian-Polish Geotuber with a significant presence on [[w:YouTube|YouTube]], boasting a subscriber count of 136K and accumulating over 98.7 million views on his videos.
== Early Life ==
Data Channel was born in [[w:Novovolynsk | Novovolynsk]], [[w:Volyn Oblast | Volyn Oblast]], [[w:Ukraine | Ukraine]] but currently resides in [[w:Zakerzonia|Zakerzonia]], [[w:Poland | Poland]]. With a mixed Ukrainian-Polish heritage, his content reflects a deep-rooted connection to both nations.
== YouTube Career ==
Data Channel's foray into YouTube was driven by a desire to assist the Ukrainian Army during the [[w:Russian invasion of Ukraine|Russian invasion of Ukraine]]. This fervor led him to become an avid viewer of YouTube Shorts, spurring him to learn video editing via ''CapCut''. He launched his channel in June 2022 and quickly found massive success with a video titled ''How do Greenlanders sleep?'', which alone garnered 50M views within a month.
Primarily using ''CapCut'' for video editing, he occasionally switches to ''Alight Motion'' for specialized edits. For textual overlays and map designs, he uses ''ibis Paint X''. His content ranges from nationalist edits and mapping to informative videos about the ongoing conflict in Ukraine.
== External Links ==
* [https://www.youtube.com/@data_channel/ Data Channel on YouTube]
* [https://www.tiktok.com/@data_channel_ Data Channel on TikTok]
* [https://www.instagram.com/data.channel_/ Data Channel on Instagram]
</translate>
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
18f2b43e972bbbd473b465c2f624cf6cb6e8efc4
784
783
2023-08-30T15:13:00Z
InsaneX
2
Marked this version for translation
wikitext
text/x-wiki
[[File:Data_Channel_Logo.jpg|thumb|300px|Logo of Data Channel.]]
<translate>
<!--T:1-->
'''Data Channel''' is a Ukrainian-Polish Geotuber with a significant presence on [[w:YouTube|YouTube]], boasting a subscriber count of 136K and accumulating over 98.7 million views on his videos.
<!--T:2-->
== Early Life ==
Data Channel was born in [[w:Novovolynsk | Novovolynsk]], [[w:Volyn Oblast | Volyn Oblast]], [[w:Ukraine | Ukraine]] but currently resides in [[w:Zakerzonia|Zakerzonia]], [[w:Poland | Poland]]. With a mixed Ukrainian-Polish heritage, his content reflects a deep-rooted connection to both nations.
<!--T:3-->
== YouTube Career ==
Data Channel's foray into YouTube was driven by a desire to assist the Ukrainian Army during the [[w:Russian invasion of Ukraine|Russian invasion of Ukraine]]. This fervor led him to become an avid viewer of YouTube Shorts, spurring him to learn video editing via ''CapCut''. He launched his channel in June 2022 and quickly found massive success with a video titled ''How do Greenlanders sleep?'', which alone garnered 50M views within a month.
<!--T:4-->
Primarily using ''CapCut'' for video editing, he occasionally switches to ''Alight Motion'' for specialized edits. For textual overlays and map designs, he uses ''ibis Paint X''. His content ranges from nationalist edits and mapping to informative videos about the ongoing conflict in Ukraine.
<!--T:5-->
== External Links ==
* [https://www.youtube.com/@data_channel/ Data Channel on YouTube]
* [https://www.tiktok.com/@data_channel_ Data Channel on TikTok]
* [https://www.instagram.com/data.channel_/ Data Channel on Instagram]
</translate>
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
fc90581b64cd15fe18493569a5992c28f1f8e727
Special:Badtitle/NS1198:Data Channel/1/en
1198
308
785
2023-08-30T15:13:05Z
FuzzyBot
59
Importing a new version from external source
wikitext
text/x-wiki
'''Data Channel''' is a Ukrainian-Polish Geotuber with a significant presence on [[w:YouTube|YouTube]], boasting a subscriber count of 136K and accumulating over 98.7 million views on his videos.
6ae7f7dc58de1e6a8326e83cf335ae6a1760c9b4
Special:Badtitle/NS1198:Data Channel/2/en
1198
311
788
2023-08-30T15:13:05Z
FuzzyBot
59
Importing a new version from external source
wikitext
text/x-wiki
== Early Life ==
Data Channel was born in [[w:Novovolynsk | Novovolynsk]], [[w:Volyn Oblast | Volyn Oblast]], [[w:Ukraine | Ukraine]] but currently resides in [[w:Zakerzonia|Zakerzonia]], [[w:Poland | Poland]]. With a mixed Ukrainian-Polish heritage, his content reflects a deep-rooted connection to both nations.
1bc025bca66854a59e42a878396639a08b6e18ca
Special:Badtitle/NS1198:Data Channel/3/en
1198
312
789
2023-08-30T15:13:05Z
FuzzyBot
59
Importing a new version from external source
wikitext
text/x-wiki
== YouTube Career ==
Data Channel's foray into YouTube was driven by a desire to assist the Ukrainian Army during the [[w:Russian invasion of Ukraine|Russian invasion of Ukraine]]. This fervor led him to become an avid viewer of YouTube Shorts, spurring him to learn video editing via ''CapCut''. He launched his channel in June 2022 and quickly found massive success with a video titled ''How do Greenlanders sleep?'', which alone garnered 50M views within a month.
d13aff4a327a0bc84ae468e14418b29ae06d7566
Special:Badtitle/NS1198:Data Channel/4/en
1198
313
790
2023-08-30T15:13:06Z
FuzzyBot
59
Importing a new version from external source
wikitext
text/x-wiki
Primarily using ''CapCut'' for video editing, he occasionally switches to ''Alight Motion'' for specialized edits. For textual overlays and map designs, he uses ''ibis Paint X''. His content ranges from nationalist edits and mapping to informative videos about the ongoing conflict in Ukraine.
eb39210cabc419c6ca5d325df37137875d5eebaa
Special:Badtitle/NS1198:Data Channel/5/en
1198
314
791
2023-08-30T15:13:06Z
FuzzyBot
59
Importing a new version from external source
wikitext
text/x-wiki
== External Links ==
* [https://www.youtube.com/@data_channel/ Data Channel on YouTube]
* [https://www.tiktok.com/@data_channel_ Data Channel on TikTok]
* [https://www.instagram.com/data.channel_/ Data Channel on Instagram]
b7b06b3c60c6861364b61c34f704f9705c35fa9b
User talk:FuzzyBot
3
309
786
2023-08-30T15:14:11Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:Translations:Data Channel/1/en]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 15:14, 30 August 2023
2e941527368197ec6d986ad3f6400f11f929a98a
User:FuzzyBot
2
310
787
2023-08-30T15:14:11Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
Kurd Mapping
0
316
793
2023-08-30T16:15:26Z
InsaneX
2
Created page with "[[File:Kurd_Mapping_Logo.jpg|thumb|300px|Logo of Kurd Mapping.]] '''Kurd Mapping''' ([[w:Sorani| Sorani Kurdish]]: کورد ماپینگ) is a Kurdish Geotuber primarily known for creating content related to geography, often involving comparisons between countries, empires, and other geographical entities. With a significant following, his channel has gained recognition in the Geo community. == Personal Information == Born in [[w:Erbil | Erbil]], [[w:Iraq|Iraq]], Kurd M..."
wikitext
text/x-wiki
[[File:Kurd_Mapping_Logo.jpg|thumb|300px|Logo of Kurd Mapping.]]
'''Kurd Mapping''' ([[w:Sorani| Sorani Kurdish]]: کورد ماپینگ) is a Kurdish Geotuber primarily known for creating content related to geography, often involving comparisons between countries, empires, and other geographical entities. With a significant following, his channel has gained recognition in the Geo community.
== Personal Information ==
Born in [[w:Erbil | Erbil]], [[w:Iraq|Iraq]], Kurd Mapping continues to reside in the same city. His Kurdish nationality plays a pivotal role in shaping the perspective he brings to his content.
== YouTube Career ==
Kurd Mapping's passion for history and geography was evident early on. During a time when there were no Kurdish editors in the Geo YouTube community, he stumbled upon an app named ''MapChart'', marking the commencement of his YouTube journey in the summer of 2022. The Geo community on YouTube was flourishing during this period, and Kurd Mapping credits the ''Global Armed Strength 1.0'' Discord server as one of his major inspirations for venturing into the platform. Since then, his channel has amassed a following of 58.7K subscribers, making him one of the prominent figures among Geotubers. On 1st August 2023, Kurd Mapping decided to quit his YouTube career due to personal reasons.
== External Links ==
* [https://www.youtube.com/@Kurd_Mapping Kurd Mapping on YouTube]
* [https://twitter.com/Mardokhy Kurd Mapping on Twitter]
* [https://discord.gg/6TKwRFhKaY Kurd Mapping's Discord Server]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
5fd98278f3cb96a7ce11fb78254b34a0a14ec0e7
File:Kurd Mapping Logo.jpg
6
317
794
2023-08-30T16:15:45Z
InsaneX
2
Logo of Kurd Mapping.
wikitext
text/x-wiki
== Summary ==
Logo of Kurd Mapping.
5e98c8194ab5da44a690c7b4010e03ee86c75ec0
Nicolas Productions
0
318
795
2023-08-31T12:36:11Z
InsaneX
2
Created page with "[[File:Nicolas_Productions_Logo.jpg|thumb|300px|Logo of Nicolas Productions.]] '''Trương Bảo Thiên''' (born October 18, 2009 in [[w:An Giang Province|An Giang]], [[w:Vietnam|Vietnam]]) is a Vietnamese Geotuber, best recognized for his YouTube channel, '''Nicolas Productions'''. He is well known for creating videos related to geography, especially comparisons between countries and empires. == Early Life == Trương was born in [[w:An Giang Province|An Giang]], w:V..."
wikitext
text/x-wiki
[[File:Nicolas_Productions_Logo.jpg|thumb|300px|Logo of Nicolas Productions.]]
'''Trương Bảo Thiên''' (born October 18, 2009 in [[w:An Giang Province|An Giang]], [[w:Vietnam|Vietnam]]) is a Vietnamese Geotuber, best recognized for his YouTube channel, '''Nicolas Productions'''. He is well known for creating videos related to geography, especially comparisons between countries and empires.
== Early Life ==
Trương was born in [[w:An Giang Province|An Giang]], [[w:Vietnam|Vietnam]]. He is of Vietnamese nationality.
== YouTube Career ==
Trương's interest in geography began when some of his friends in Vietnam started posting geography-related videos. Inspired by them, Trương started researching geography and calendars. He uploaded his first video in August 2022. He primarily used ''CapCut'' for editing his early videos. For his videos, Trương uses ''CapCut'' and ''Alight Motion''. He employs ''ibis Paint X'' for mapping.
== External Links ==
* [https://youtube.com/@NicolasProductions Nicolas Productions on YouTube]
* [https://www.tiktok.com/@nicolas.productions Nicolas Productions on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
54ceb625ce4a04195ee74c4887cf53d3cc6e6dfd
File:Nicolas Productions Logo.jpg
6
319
796
2023-08-31T12:36:41Z
InsaneX
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:HK ball.jpg
6
320
797
2023-08-31T14:52:18Z
Haydenlol
37
wikitext
text/x-wiki
HK ball's YouTube profile.
422596eec29da99be77556b4fe86494fddb3aa38
File:SunfireMA.jpg
6
326
810
2023-08-31T15:36:17Z
Haydenlol
37
wikitext
text/x-wiki
SunfireMA's YouTube logo.
8d1c541117a79b7ab59a3b9e751b5498851a9f32
User:Haydenlol
2
321
798
2023-08-31T16:49:00Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:Haydenlol
3
322
799
2023-08-31T16:49:00Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:File:HK ball.jpg]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 16:49, 31 August 2023
3389261076f433f83b1e0285d7326109617953d1
File:ColorShorts Logo July 2023-.png
6
394
924
2023-08-31T23:19:53Z
Colormald
67
wikitext
text/x-wiki
youtuber
1285078b0c23ac9fed537acd99f959ca39d41e0d
Reed Schultz Geo
0
332
827
2023-08-31T23:42:34Z
Reed Schultz Geo
57
gefgaergasdfdshteed
wikitext
text/x-wiki
hi mi name is reed schultz geo i amda doafdoyoutuber who poststs geography
7af9ecf3f8ad6cad8078f77deae1d65b6344c620
User:Loceq-Geo
2
336
835
2023-09-01T05:42:27Z
Loceq-Geo
70
Created page with "Je"
wikitext
text/x-wiki
Je
a207fb969fca1b7a340a68db288969a97d7b9ac5
World.Military.Reality
0
238
836
766
2023-09-01T08:46:48Z
World.Military.Reality
49
wikitext
text/x-wiki
[[File:World.Military.Reality_Logo.jpg|thumb|300px|Logo of World.Military.Reality.]]
'''Abdullah''' ([https://en.wikipedia.org/wiki/Urdu Urdu]: عبداللہ ) is a Pakistani Geotuber known for his [https://en.wikipedia.org/wiki/YouTube YouTube] channel '''World.Military.Reality'''. The channel was launched on October 1, 2022, and within nine months has garnered nearly 17,000 subscribers and close to 3.5 million views. World.Military.Reality has gained significant attention in the Geo community due to its distinctive takes on history, geography, and geopolitical topics.
== Early Life ==
Abdullah was born in [https://en.wikipedia.org/wiki/Islamabad Islamabad], [https://en.wikipedia.org/wiki/Pakistan Pakistan]. From an early age, he exhibited a keen interest in military, geography, history, and [https://en.wikipedia.org/wiki/Geopolitics geopolitics].
== YouTube Career ==
Abdullah began his YouTube journey in 2019, focusing primarily on gaming content, especially centered around [https://en.wikipedia.org/wiki/Roblox Roblox]. From 2019 to 2021, despite numerous video uploads, the channel could only manage to amass around 100 subscribers and about 50,000 views.
In 2022, after being introduced to the Geo community and watching content from other Geotubers, Abdullah's passion was rekindled. On October 1, 2023, following a break, he initiated his third YouTube channel dedicated to geopolitics and military-related subjects. Abdullah started by using CapCut for video editing but soon moved to Alight Motion to further enhance his editing capabilities. This transition played a pivotal role in uplifting the quality of his content, resulting in a significant growth spurt for his channel. Such rapid growth affirmed Abdullah's standing in the Geo community, identifying him as a notable Geotuber.
== Editing Styles and Tools ==
Abdullah's distinct editing style and unique subject choices have not only made him popular but have also inspired others to emulate his content. He utilizes a combination of software tools to bring his creative visions to life:
* CapCut
* Alight Motion
* ibis Paint X
* Pixel lab
* [https://en.wikipedia.org/wiki/Adobe_Lightroom Adobe Lightroom]
== External Links ==
* [https://youtube.com/@World.Military.Reality World.Military.Reality on YouTube]
* [https://www.tiktok.com/@world.military.reality._?_t=8enj7uQlkj2&_r=1 World.Military.Reality on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
386d2eca406c5074bd1545088fa8c9ae82c23b50
Geotuber
0
340
840
2023-09-01T14:03:53Z
Haydenlol
37
idisowmssi
wikitext
text/x-wiki
A '''Geotuber''' (sometimes spelled as '''GeoTuber''') is a person who uploads geography content on [https://en.wikipedia.org/wiki/YouTube YouTube]. It is usually only referred to by Shorts creators, and the term is largely unknown in long-form videos.
== Examples ==
A few examples of Geotubers would be:
* [https://geotubepedia.miraheze.org/wiki/WILLY_NICX WILLY NICX]
* [https://geotubepedia.miraheze.org/wiki/Militarizatixn Militarizatixn]
* [https://geotubepedia.miraheze.org/wiki/ HK ball]
* [https://geotubepedia.miraheze.org/wiki/AngryBozo_Geography AngryBozo Geography]
* [https://geotubepedia.miraheze.org/wiki/Amidoch Amidoch]
''(Note that a '''Geotuber is only referred to by Shorts creators''', thats why this list only comprises of Shorts creators.)''
== Origin ==
It is unknown who made the term or when it started to use, but it is speculated that this term was first used in Christmas, and was slowly picked on by fellow Geography shorts creators and used in daily life.
== Discord Servers About Geotubers ==
If you want to interact with Geotubers, there are a lot of famous Discord servers related to them. Here are a few you can join:
* [https://discord.gg/boyz Global Armed Strength] by [https://geotubepedia.miraheze.org/wiki/World.military.king. World.military.king.]
* [https://discord.gg/ZhmjHWad Amidoch Community] by [https://geotubepedia.miraheze.org/wiki/Amidoch Amidoch]
* [https://discord.gg/GPcVaNSEJU Hongkong Ball Crew] by [https://geotubepedia.miraheze.org/wiki/HK_ball HK ball]
7f5d66f595f3c4ead1e59cdbdb3dde0046aeae88
WayWorn Mapping
0
325
803
2023-09-01T17:01:08Z
That muslim kid
9
Created page with "'''Dylan Link''' is a German-British Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''WayWorn Mapping'''. == Early Life == Dylan Link, whose real name is provided, was born on April 21, 2009. == YouTube Career == Dylan Link's journey on YouTube began with creating "Guess the Empire" videos on YouTube Shorts. However, as he explored the platform further, he discovered a thriving community of content creators specializing in country balls animations, m..."
wikitext
text/x-wiki
'''Dylan Link''' is a German-British Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''WayWorn Mapping'''.
== Early Life ==
Dylan Link, whose real name is provided, was born on April 21, 2009.
== YouTube Career ==
Dylan Link's journey on YouTube began with creating "Guess the Empire" videos on YouTube Shorts. However, as he explored the platform further, he discovered a thriving community of content creators specializing in country balls animations, map animations, and various edits. Inspired by this, he decided to dive into creating videos in this genre.
His initial editing attempts may have been humble, but over time, he dedicated himself to honing his editing skills, resulting in a notable improvement in the quality of his content. With a growing subscriber count of 102 and over 50,000 views, Dylan Link has found success as a Geotuber.
Dylan Link's content on YouTube primarily focuses on war edits, using the phonk "murder plot" as well as alliance edits featuring "bumblebee." Additionally, he has ventured into creating long-form content by editing national anthem videos. His content often revolves around the Kaiserreich alternate history scenario, a universe he is passionate about, and enjoys sharing with his audience.
== External Links ==
[https://www.youtube.com/@unionofbritainmapping WayWorn Mapping on YouTube]
== Categories ==
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
06c675a27a967c41d571e1142fe5b15ee7c36e4a
804
803
2023-09-01T17:06:38Z
InsaneX
2
/* Categories */
wikitext
text/x-wiki
'''Dylan Link''' is a German-British Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''WayWorn Mapping'''.
== Early Life ==
Dylan Link, whose real name is provided, was born on April 21, 2009.
== YouTube Career ==
Dylan Link's journey on YouTube began with creating "Guess the Empire" videos on YouTube Shorts. However, as he explored the platform further, he discovered a thriving community of content creators specializing in country balls animations, map animations, and various edits. Inspired by this, he decided to dive into creating videos in this genre.
His initial editing attempts may have been humble, but over time, he dedicated himself to honing his editing skills, resulting in a notable improvement in the quality of his content. With a growing subscriber count of 102 and over 50,000 views, Dylan Link has found success as a Geotuber.
Dylan Link's content on YouTube primarily focuses on war edits, using the phonk "murder plot" as well as alliance edits featuring "bumblebee." Additionally, he has ventured into creating long-form content by editing national anthem videos. His content often revolves around the Kaiserreich alternate history scenario, a universe he is passionate about, and enjoys sharing with his audience.
== External Links ==
[https://www.youtube.com/@unionofbritainmapping WayWorn Mapping on YouTube]
[[Category:List of Geotubers]]
af3febd1244c0f9af59753a452ec5e1ee45e33f0
805
804
2023-09-01T17:07:02Z
InsaneX
2
/* Early Life */
wikitext
text/x-wiki
'''Dylan Link''' is a German-British Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''WayWorn Mapping'''.
== Early Life ==
Dylan Link, whose real name is provided, was born on April 21, 2009 in [[w:England|England]].
== YouTube Career ==
Dylan Link's journey on YouTube began with creating "Guess the Empire" videos on YouTube Shorts. However, as he explored the platform further, he discovered a thriving community of content creators specializing in country balls animations, map animations, and various edits. Inspired by this, he decided to dive into creating videos in this genre.
His initial editing attempts may have been humble, but over time, he dedicated himself to honing his editing skills, resulting in a notable improvement in the quality of his content. With a growing subscriber count of 102 and over 50,000 views, Dylan Link has found success as a Geotuber.
Dylan Link's content on YouTube primarily focuses on war edits, using the phonk "murder plot" as well as alliance edits featuring "bumblebee." Additionally, he has ventured into creating long-form content by editing national anthem videos. His content often revolves around the Kaiserreich alternate history scenario, a universe he is passionate about, and enjoys sharing with his audience.
== External Links ==
[https://www.youtube.com/@unionofbritainmapping WayWorn Mapping on YouTube]
[[Category:List of Geotubers]]
1e1022944fd0ab9722957b65d279699c1393c3b9
806
805
2023-09-01T17:07:53Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
'''Dylan Link''' is a German-British Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''WayWorn Mapping'''.
== Early Life ==
Dylan Link, whose real name is provided, was born on April 21, 2009 in [[w:England|England]].
== YouTube Career ==
Dylan Link's journey on YouTube began with creating "Guess the Empire" videos on YouTube Shorts. However, as he explored the platform further, he discovered a thriving community of content creators specializing in country balls animations, map animations, and various edits. Inspired by this, he decided to dive into creating videos in this genre.
His initial editing attempts may have been humble, but over time, he dedicated himself to honing his editing skills, resulting in a notable improvement in the quality of his content. With a growing subscriber count of 102 and over 50,000 views, Dylan Link has found success as a Geotuber.
== External Links ==
[https://www.youtube.com/@unionofbritainmapping WayWorn Mapping on YouTube]
[[Category:List of Geotubers]]
509f1a11db769554c54a24747eb490d07a34e3b6
807
806
2023-09-01T17:09:45Z
InsaneX
2
wikitext
text/x-wiki
'''Dylan Link''' is a German-British Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''WayWorn Mapping'''. With a unique blend of cartographic visuals and engaging content, he has carved a niche for himself in the mapping community.
== Early Life ==
Dylan Link, whose real name is provided, was born on April 21, 2009 in [[w:England|England]].
== YouTube Career ==
Dylan Link's journey on YouTube began with creating "Guess the Empire" videos on YouTube Shorts. However, as he explored the platform further, he discovered a thriving community of content creators specializing in country balls animations, map animations, and various edits. Inspired by this, he decided to dive into creating videos in this genre.
His initial editing attempts may have been humble, but over time, he dedicated himself to honing his editing skills, resulting in a notable improvement in the quality of his content. With a growing subscriber count of 102 and over 50,000 views, Dylan Link has found success as a Geotuber.
== External Links ==
[https://www.youtube.com/@unionofbritainmapping WayWorn Mapping on YouTube]
[[Category:List of Geotubers]]
7360a4260db794bd23eb9676261197c0f7f2b16c
808
807
2023-09-01T17:15:03Z
InsaneX
2
wikitext
text/x-wiki
'''Dylan Link''' is a German-British Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''WayWorn Mapping'''. With a unique blend of cartographic visuals and engaging content, he has carved a niche for himself in the mapping community.
== Early Life ==
Dylan Link, whose real name is provided, was born on April 21, 2009 in [[w:England|England]].
== YouTube Career ==
Dylan Link's journey on YouTube began with creating "Guess the Empire" videos on [[w:YouTube Shorts|YouTube Shorts]]. However, as he explored the platform further, he discovered a thriving community of content creators specializing in country balls animations, map animations, and various edits. Inspired by this, he decided to dive into creating videos in this genre.
His initial editing attempts may have been humble, but over time, he dedicated himself to honing his editing skills, resulting in a notable improvement in the quality of his content. With a growing subscriber count of 102 and over 50,000 views, Dylan Link has found success as a Geotuber.
== External Links ==
[https://www.youtube.com/@unionofbritainmapping WayWorn Mapping on YouTube]
[[Category:List of Geotubers]]
d0f7c02a1c1fec4ad003860d48807187930376ef
809
808
2023-09-01T17:17:10Z
That muslim kid
9
wikitext
text/x-wiki
[[File:WayWornMapping_Logo.jpg|thumb|300px|Logo of WayWorn Mapping.]]
'''Dylan Link''' is a German-British Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''WayWorn Mapping'''. With a unique blend of cartographic visuals and engaging content, he has carved a niche for himself in the mapping community.
== Early Life ==
Dylan Link, whose real name is provided, was born on April 21, 2009 in [[w:England|England]].
== YouTube Career ==
Dylan Link's journey on YouTube began with creating "Guess the Empire" videos on [[w:YouTube Shorts|YouTube Shorts]]. However, as he explored the platform further, he discovered a thriving community of content creators specializing in country balls animations, map animations, and various edits. Inspired by this, he decided to dive into creating videos in this genre.
His initial editing attempts may have been humble, but over time, he dedicated himself to honing his editing skills, resulting in a notable improvement in the quality of his content. With a growing subscriber count of 102 and over 50,000 views, Dylan Link has found success as a Geotuber.
== External Links ==
[https://www.youtube.com/@unionofbritainmapping WayWorn Mapping on YouTube]
[[Category:List of Geotubers]]
541bf79e034e05290aef81b7b37a2a10b784d7f8
812
809
2023-09-01T17:24:54Z
InsaneX
2
wikitext
text/x-wiki
[[File:WayWorn Mapping logo.jpg|thumb|300px|Logo of WayWorn Mapping.]]
'''Dylan Link''' is a German-British Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''WayWorn Mapping'''. With a unique blend of cartographic visuals and engaging content, he has carved a niche for himself in the mapping community.
== Early Life ==
Dylan Link, whose real name is provided, was born on April 21, 2009 in [[w:England|England]].
== YouTube Career ==
Dylan Link's journey on YouTube began with creating "Guess the Empire" videos on [[w:YouTube Shorts|YouTube Shorts]]. However, as he explored the platform further, he discovered a thriving community of content creators specializing in country balls animations, map animations, and various edits. Inspired by this, he decided to dive into creating videos in this genre.
His initial editing attempts may have been humble, but over time, he dedicated himself to honing his editing skills, resulting in a notable improvement in the quality of his content. With a growing subscriber count of 102 and over 50,000 views, Dylan Link has found success as a Geotuber.
== External Links ==
[https://www.youtube.com/@unionofbritainmapping WayWorn Mapping on YouTube]
[[Category:List of Geotubers]]
46f939ff1cf9100eb9ba90f5a7db890047ebc705
User talk:Pranav Namoju
3
323
801
2023-09-01T17:03:09Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:Reed Schultz Geo]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 17:03, 1 September 2023
ff767f16d315d8223d219f81c007a5524e0c3ab7
User:Pranav Namoju
2
324
802
2023-09-01T17:03:09Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
File:WayWorn Mapping logo.jpg
6
327
811
2023-09-01T17:19:42Z
That muslim kid
9
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Russian Empire Countryball
0
328
813
2023-09-01T17:49:40Z
That muslim kid
9
Created page with "Mohammad Amadh, known professionally as '''Russian Empire Countryball''' (born May 6, 2011), is a Sri Lankan Geotuber specializing in comparative analyses of countries, empires, and various geopolitical topics. He is often recognized for his engaging content on his YouTube channel, == Early Life == Amadh's journey into content creation began in 2022 when he started as a gamer. == YouTube Career == Inspired by a channel called ''Egypt Countryball,'' Amadh ventured into..."
wikitext
text/x-wiki
Mohammad Amadh, known professionally as '''Russian Empire Countryball''' (born May 6, 2011), is a Sri Lankan Geotuber specializing in comparative analyses of countries, empires, and various geopolitical topics. He is often recognized for his engaging content on his YouTube channel,
== Early Life ==
Amadh's journey into content creation began in 2022 when he started as a gamer.
== YouTube Career ==
Inspired by a channel called ''Egypt Countryball,'' Amadh ventured into the world of Geotube content creation. Initially operating under the channel name ''Sri Lankan Countryball,'' he continued this endeavor for a year. However, faced with various challenges, he decided to rebrand and launch a new channel, ''Russian Empire Countryball (R.B.RE).''
As of the latest information available, Mohammad Amadh has garnered a substantial following, boasting 1.1k subscribers and over 300k views on his YouTube channel, ''Russian Empire Countryball.''
== Alliances ==
Amadh is affiliated with the ''PSA - Palestinian Supporting Alliance,'' demonstrating his involvement and collaboration within the Geotuber community.
== Software Used ==
For his video editing endeavors, Mohammad Amadh relies on the software ''CapCut.''
== External Links ==
[https://youtube.com/@RussianEmpcountryball?si=XhSSrTgda7Isw4xU Russian Empire Countryball on YouTube]
== Categories ==
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
3d2d5ed59b99052b841cbc5281bb116a049e7e7a
814
813
2023-09-01T17:57:44Z
InsaneX
2
wikitext
text/x-wiki
'''Mohammad Amadh''' ([[w:Sinhala_language| Sinhala]]: මොහොමඩ් අමාද්; born May 6, 2011) is a Sri Lankan Geotuber, well known for his [[w:YouTube|YouTube]] channel, '''Russian Empire Countryball'''. He is often recognized for his engaging content on his YouTube channel.
== Early Life ==
Amadh's journey into content creation began in 2022 when he started as a gamer.
== YouTube Career ==
Inspired by a channel called ''Egypt Countryball,'' Amadh ventured into the world of Geotube content creation. Initially operating under the channel name ''Sri Lankan Countryball,'' he continued this endeavor for a year. However, faced with various challenges, he decided to rebrand and launch a new channel, ''Russian Empire Countryball''.
As of the latest information available, Mohammad Amadh has garnered a substantial following, boasting 1.1k subscribers and over 300k views on his YouTube channel, ''Russian Empire Countryball''. For his video editing endeavors, Mohammad Amadh relies on ''CapCut''.
== Alliances ==
Amadh is affiliated with the ''PSA - Palestinian Supporting Alliance,'' demonstrating his involvement and collaboration within the Geo community.
== External Links ==
[https://youtube.com/@RussianEmpcountryball?si=XhSSrTgda7Isw4xU Russian Empire Countryball on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
0fc4da935208a9e12988c68e79c60be20fe2a4e0
816
814
2023-09-01T17:59:03Z
InsaneX
2
wikitext
text/x-wiki
[[File:Russian_Empire_Countryball.jpg|thumb|300px|Logo of Russian Empire Countryball.]]
'''Mohammad Amadh''' ([[w:Sinhala_language| Sinhala]]: මොහොමඩ් අමාද්; born May 6, 2011) is a Sri Lankan Geotuber, well known for his [[w:YouTube|YouTube]] channel, '''Russian Empire Countryball'''. He is often recognized for his engaging content on his YouTube channel.
== Early Life ==
Amadh's journey into content creation began in 2022 when he started as a gamer.
== YouTube Career ==
Inspired by a channel called ''Egypt Countryball,'' Amadh ventured into the world of Geotube content creation. Initially operating under the channel name ''Sri Lankan Countryball,'' he continued this endeavor for a year. However, faced with various challenges, he decided to rebrand and launch a new channel, ''Russian Empire Countryball''.
As of the latest information available, Mohammad Amadh has garnered a substantial following, boasting 1.1k subscribers and over 300k views on his YouTube channel, ''Russian Empire Countryball''. For his video editing endeavors, Mohammad Amadh relies on ''CapCut''.
== Alliances ==
Amadh is affiliated with the ''PSA - Palestinian Supporting Alliance,'' demonstrating his involvement and collaboration within the Geo community.
== External Links ==
[https://youtube.com/@RussianEmpcountryball?si=XhSSrTgda7Isw4xU Russian Empire Countryball on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
58961eff44b2ece9242cbfcc1ca27e62cb03440a
817
816
2023-09-01T18:01:11Z
InsaneX
2
/* Alliances */
wikitext
text/x-wiki
[[File:Russian_Empire_Countryball.jpg|thumb|300px|Logo of Russian Empire Countryball.]]
'''Mohammad Amadh''' ([[w:Sinhala_language| Sinhala]]: මොහොමඩ් අමාද්; born May 6, 2011) is a Sri Lankan Geotuber, well known for his [[w:YouTube|YouTube]] channel, '''Russian Empire Countryball'''. He is often recognized for his engaging content on his YouTube channel.
== Early Life ==
Amadh's journey into content creation began in 2022 when he started as a gamer.
== YouTube Career ==
Inspired by a channel called ''Egypt Countryball,'' Amadh ventured into the world of Geotube content creation. Initially operating under the channel name ''Sri Lankan Countryball,'' he continued this endeavor for a year. However, faced with various challenges, he decided to rebrand and launch a new channel, ''Russian Empire Countryball''.
As of the latest information available, Mohammad Amadh has garnered a substantial following, boasting 1.1k subscribers and over 300k views on his YouTube channel, ''Russian Empire Countryball''. For his video editing endeavors, Mohammad Amadh relies on ''CapCut''.
== Alliances ==
Amadh is affiliated with the '''Palestinian Supporting Alliance (P.S.E)''' demonstrating his involvement and collaboration within the Geo community.
== External Links ==
[https://youtube.com/@RussianEmpcountryball?si=XhSSrTgda7Isw4xU Russian Empire Countryball on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
13b70a548af67848d92c0ce09eef9bce4be6cd7a
File:Russian Empire Countryball.jpg
6
329
815
2023-09-01T17:53:56Z
That muslim kid
9
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Ro0v Mapping
0
330
818
2023-09-01T18:25:29Z
That muslim kid
9
Created page with "[[File:Ro0v_Mapping_Logo.jpeg|thumb|300px|Logo of Ro0v Mapping.]] '''Ro0vMapping''' is a Canadian Geotuber known for his contributions to the Geotube community through his YouTube channel. == Introduction == Ro0v Mapping, residing in Oakland, Canada, is a Geotuber who has garnered recognition for his content on his YouTube channel. He is well-regarded for his videos focusing on geography and history. == Personal Information == == Early Life == Ro0v Mapping's interest..."
wikitext
text/x-wiki
[[File:Ro0v_Mapping_Logo.jpeg|thumb|300px|Logo of Ro0v Mapping.]]
'''Ro0vMapping''' is a Canadian Geotuber known for his contributions to the Geotube community through his YouTube channel.
== Introduction == Ro0v Mapping, residing in Oakland, Canada, is a Geotuber who has garnered recognition for his content on his YouTube channel. He is well-regarded for his videos focusing on geography and history.
== Personal Information ==
== Early Life == Ro0v Mapping's interest in geography and history developed relatively recently, over the past few months.
== Alliances == He is a co-owner of the ''League of California Geotubers (LCG)'' and a member of the ''League of American Geotubers (LAG).''
== Software Used ==
Ro0v Mapping employs several software tools for his content creation, including ''Capcut,'' ''Picsart,'' and ''Ibis PaintX.''
== YouTube Career == Ro0v Mapping embarked on his YouTube journey in November 2016. Initially, he posted only two videos, which have since been deleted. His early content centered around low-quality Roblox videos, and he maintained this focus for 1.5 years, gradually growing his channel to 75 subscribers. However, a shift in content occurred approximately four months ago when he started creating geography-related content.
Currently, Ro0v Mapping primarily uses ''CapCut'' for video editing, supplemented by ''Picsart'' and ''Ibis Paint'' for other aspects of content creation. His transition to becoming a Geotuber was sparked by his growing interest in geography-related content.
== External Links ==
[https://youtube.com/@Ro0vMapping LucandoGaming on YouTube]
== Categories == [[Category:List of Geotubers]] [[Category:Top Geotubers]]
47a62d1b4e32bb7071d93eae71fef432e0f82660
820
818
2023-09-02T05:17:05Z
InsaneX
2
wikitext
text/x-wiki
[[File:Ro0v_Mapping_Logo.jpeg|thumb|300px|Logo of Ro0v Mapping.]]
'''Ro0vMapping''' is a Canadian Geotuber known for his contributions to the Geotube community through his YouTube channel.
== Personal Information ==
== Early Life == Ro0v Mapping's interest in geography and history developed relatively recently, over the past few months.
== Alliances == He is a co-owner of the ''League of California Geotubers (LCG)'' and a member of the ''League of American Geotubers (LAG).''
== Software Used ==
Ro0v Mapping employs several software tools for his content creation, including ''Capcut,'' ''Picsart,'' and ''Ibis PaintX.''
== YouTube Career == Ro0v Mapping embarked on his YouTube journey in November 2016. Initially, he posted only two videos, which have since been deleted. His early content centered around low-quality Roblox videos, and he maintained this focus for 1.5 years, gradually growing his channel to 75 subscribers. However, a shift in content occurred approximately four months ago when he started creating geography-related content.
Currently, Ro0v Mapping primarily uses ''CapCut'' for video editing, supplemented by ''Picsart'' and ''Ibis Paint'' for other aspects of content creation. His transition to becoming a Geotuber was sparked by his growing interest in geography-related content.
== External Links ==
[https://youtube.com/@Ro0vMapping LucandoGaming on YouTube]
== Categories == [[Category:List of Geotubers]] [[Category:Top Geotubers]]
f3853866cfef326093ea6907988d64f0530bbcfc
821
820
2023-09-02T05:18:52Z
InsaneX
2
wikitext
text/x-wiki
[[File:Ro0v_Mapping_Logo.jpeg|thumb|300px|Logo of Ro0v Mapping.]]
'''Ro0vMapping''' is a Canadian Geotuber known for his contributions to the Geotube community through his YouTube channel.
== Early Life ==
Ro0v Mapping's interest in geography and history developed relatively recently, over the past few months.
== Software Used ==
Ro0v Mapping employs several software tools for his content creation, including ''Capcut,'' ''Picsart,'' and ''Ibis PaintX.''
== YouTube Career == Ro0v Mapping embarked on his YouTube journey in November 2016. Initially, he posted only two videos, which have since been deleted. His early content centered around low-quality Roblox videos, and he maintained this focus for 1.5 years, gradually growing his channel to 75 subscribers. However, a shift in content occurred approximately four months ago when he started creating geography-related content.
Currently, Ro0v Mapping primarily uses ''CapCut'' for video editing, supplemented by ''Picsart'' and ''Ibis Paint'' for other aspects of content creation. His transition to becoming a Geotuber was sparked by his growing interest in geography-related content.
== External Links ==
[https://youtube.com/@Ro0vMapping LucandoGaming on YouTube]
== Categories == [[Category:List of Geotubers]] [[Category:Top Geotubers]]
1157cc51e19b308b3684480620949bec2ce2e027
822
821
2023-09-02T05:20:12Z
InsaneX
2
wikitext
text/x-wiki
[[File:Ro0v_Mapping_Logo.jpeg|thumb|300px|Logo of Ro0v Mapping.]]
'''Ro0vMapping''' is a Canadian Geotuber known for his contributions to the Geotube community through his YouTube channel.
== Early Life ==
Ro0v Mapping's interest in geography and history developed relatively recently, over the past few months.
== YouTube Career ==
Ro0v Mapping embarked on his YouTube journey in November 2016. Initially, he posted only two videos, which have since been deleted. His early content centered around low-quality Roblox videos, and he maintained this focus for 1.5 years, gradually growing his channel to 75 subscribers. However, a shift in content occurred approximately four months ago when he started creating geography-related content.
Currently, Ro0v Mapping primarily uses ''CapCut'' for video editing, supplemented by ''Picsart'' and ''ibis Paint X'' for other aspects of content creation. His transition to becoming a Geotuber was sparked by his growing interest in geography-related content.
== Alliances ==
He is the co-owner of '''League of California Geotubers (L.C.G)''' and the member of '''League of American Geotubers (L.A.G)'''.
== External Links ==
[https://youtube.com/@Ro0vMapping LucandoGaming on YouTube]
== Categories == [[Category:List of Geotubers]] [[Category:Top Geotubers]]
57277cb7bec6acb0c50aa03340a99ea5fa50c496
File:Ro0v Mapping Logo.jpeg
6
331
819
2023-09-01T18:26:12Z
That muslim kid
9
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Ro0v Mapping
0
330
823
822
2023-09-02T05:20:43Z
InsaneX
2
wikitext
text/x-wiki
[[File:Ro0v_Mapping_Logo.jpeg|thumb|300px|Logo of Ro0v Mapping.]]
'''Ro0vMapping''' is a Canadian Geotuber known for his contributions to the Geotube community through his YouTube channel.
== Early Life ==
Ro0v Mapping's interest in geography and history developed relatively recently, over the past few months.
== YouTube Career ==
Ro0v Mapping embarked on his YouTube journey in November 2016. Initially, he posted only two videos, which have since been deleted. His early content centered around low-quality Roblox videos, and he maintained this focus for 1.5 years, gradually growing his channel to 75 subscribers. However, a shift in content occurred approximately four months ago when he started creating geography-related content.
Currently, Ro0v Mapping primarily uses ''CapCut'' for video editing, supplemented by ''Picsart'' and ''ibis Paint X'' for other aspects of content creation. His transition to becoming a Geotuber was sparked by his growing interest in geography-related content.
== Alliances ==
He is the co-owner of '''League of California Geotubers (L.C.G)''' and the member of '''League of American Geotubers (L.A.G)'''.
== External Links ==
* [https://youtube.com/@Ro0vMapping LucandoGaming on YouTube]
[[Category:List of Geotubers]] [[Category:Top Geotubers]]
35a0e12a5bd19921da1f0f83c0dec92e47c3cb3a
824
823
2023-09-02T07:31:17Z
InsaneX
2
wikitext
text/x-wiki
[[File:Ro0v_Mapping_Logo.jpeg|thumb|300px|Logo of Ro0v Mapping.]]
'''Ro0vMapping''' is a Californian Geotuber known for his contributions to the Geo community through his [[w:YouTube|YouTube]] channel.
== Early Life ==
Ro0v Mapping's interest in geography and history developed relatively recently, over the past few months.
== YouTube Career ==
Ro0v Mapping embarked on his YouTube journey in November 2016. Initially, he posted only two videos, which have since been deleted. His early content centered around low-quality Roblox videos, and he maintained this focus for 1.5 years, gradually growing his channel to 75 subscribers. However, a shift in content occurred approximately four months ago when he started creating geography-related content.
Currently, Ro0v Mapping primarily uses ''CapCut'' for video editing, supplemented by ''Picsart'' and ''ibis Paint X'' for other aspects of content creation. His transition to becoming a Geotuber was sparked by his growing interest in geography-related content.
== Alliances ==
He is the co-owner of '''League of California Geotubers (L.C.G)''' and the member of '''League of American Geotubers (L.A.G)'''.
== External Links ==
* [https://youtube.com/@Ro0vMapping LucandoGaming on YouTube]
[[Category:List of Geotubers]] [[Category:Top Geotubers]]
68f63583806099920856e32d78a8c5bf3b30abcd
825
824
2023-09-02T07:31:32Z
InsaneX
2
wikitext
text/x-wiki
[[File:Ro0v_Mapping_Logo.jpeg|thumb|300px|Logo of Ro0v Mapping.]]
'''Ro0vMapping''' is a Californian Geotuber known for his contributions to the Geo community through his [[w:YouTube|YouTube]] channel.
== Early Life ==
Ro0v Mapping's interest in geography and history developed relatively recently, over the past few months.
== YouTube Career ==
Ro0v Mapping embarked on his YouTube journey in November 2016. Initially, he posted only two videos, which have since been deleted. His early content centered around low-quality Roblox videos, and he maintained this focus for 1.5 years, gradually growing his channel to 75 subscribers. However, a shift in content occurred approximately four months ago when he started creating geography-related content.
Currently, Ro0v Mapping primarily uses ''CapCut'' for video editing, supplemented by ''Picsart'' and ''ibis Paint X'' for other aspects of content creation. His transition to becoming a Geotuber was sparked by his growing interest in geography-related content.
== Alliances ==
He is the co-owner of '''League of California Geotubers (L.C.G)''' and the member of '''League of American Geotubers (L.A.G)'''.
== External Links ==
* [https://youtube.com/@Ro0vMapping LucandoGaming on YouTube]
[[Category:List of Geotubers]]
d0394c717f36b9e09e9ee19692d5a127fc6189e7
826
825
2023-09-02T07:32:45Z
InsaneX
2
wikitext
text/x-wiki
[[File:Ro0v_Mapping_Logo.jpeg|thumb|300px|Logo of Ro0v Mapping.]]
'''Ro0vMapping''' is an American Geotuber known for his contributions to the Geo community through his [[w:YouTube|YouTube]] channel.
== Early Life ==
Ro0v Mapping's interest in geography and history developed relatively recently, over the past few months.
== YouTube Career ==
Ro0v Mapping embarked on his YouTube journey in November 2016. Initially, he posted only two videos, which have since been deleted. His early content centered around low-quality Roblox videos, and he maintained this focus for 1.5 years, gradually growing his channel to 75 subscribers. However, a shift in content occurred approximately four months ago when he started creating geography-related content.
Currently, Ro0v Mapping primarily uses ''CapCut'' for video editing, supplemented by ''Picsart'' and ''ibis Paint X'' for other aspects of content creation. His transition to becoming a Geotuber was sparked by his growing interest in geography-related content.
== Alliances ==
He is the co-owner of '''League of California Geotubers (L.C.G)''' and the member of '''League of American Geotubers (L.A.G)'''.
== External Links ==
* [https://youtube.com/@Ro0vMapping LucandoGaming on YouTube]
[[Category:List of Geotubers]]
c2d6f9f494756cdc35b440753c43e07944bbc686
829
826
2023-09-02T11:03:27Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:Ro0v_Mapping_Logo.jpeg|thumb|300px|Logo of Ro0v Mapping.]]
'''Ro0vMapping''' is an American Geotuber known for his contributions to the Geo community through his [[w:YouTube|YouTube]] channel.
== Early Life ==
Ro0v Mapping's interest in geography and history developed relatively recently, over the past few months.
== YouTube Career ==
Ro0v Mapping embarked on his YouTube journey in November 2016. Initially, he posted only two videos, which have since been deleted. His early content centered around low-quality Roblox videos, and he maintained this focus for 1.5 years, gradually growing his channel to 75 subscribers. However, a shift in content occurred approximately four months ago when he started creating geography-related content.
Currently, Ro0v Mapping primarily uses ''CapCut'' for video editing, supplemented by ''Picsart'' and ''ibis Paint X'' for other aspects of content creation. His transition to becoming a Geotuber was sparked by his growing interest in geography-related content.
== Alliances ==
He is the co-owner of '''League of California Geotubers (L.C.G)''' and the member of '''League of American Geotubers (L.A.G)'''.
== External Links ==
* [https://youtube.com/@Ro0vMapping RoOv Mapping on YouTube]
[[Category:List of Geotubers]]
53d1dc305ddea61fb05a58eef0e2cfd5173f7dd6
830
829
2023-09-02T11:03:47Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:Ro0v_Mapping_Logo.jpeg|thumb|300px|Logo of Ro0v Mapping.]]
'''Ro0vMapping''' is an American Geotuber known for his contributions to the Geo community through his [[w:YouTube|YouTube]] channel.
== Early Life ==
Ro0v Mapping's interest in geography and history developed relatively recently, over the past few months.
== YouTube Career ==
Ro0v Mapping embarked on his YouTube journey in November 2016. Initially, he posted only two videos, which have since been deleted. His early content centered around low-quality Roblox videos, and he maintained this focus for 1.5 years, gradually growing his channel to 75 subscribers. However, a shift in content occurred approximately four months ago when he started creating geography-related content.
Currently, Ro0v Mapping primarily uses ''CapCut'' for video editing, supplemented by ''Picsart'' and ''ibis Paint X'' for other aspects of content creation. His transition to becoming a Geotuber was sparked by his growing interest in geography-related content.
== Alliances ==
He is the co-owner of '''League of California Geotubers (L.C.G)''' and the member of '''League of American Geotubers (L.A.G)'''.
== External Links ==
* [https://youtube.com/@Ro0vMapping Ro0v Mapping on YouTube]
[[Category:List of Geotubers]]
a8774952efd8755517873e66f8cb161be474ab9f
Main Page
0
1
828
782
2023-09-02T10:18:24Z
InsaneX
2
/* Recent Changes */
wikitext
text/x-wiki
__NOTOC__
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Welcome to Geotubepedia</h1> -->
==Welcome to Geotubepedia==
'''Geotubepedia''' is the ultimate source for information on Geotubers, YouTube creators who specialize in Geography and related content. It is the definitive resource for Geotubers, dedicated enthusiasts who produce geography-focused YouTube content. The site offers in-depth profiles of each Geotuber, providing a centralized platform for fans and fellow content creators to explore, collaborate, and celebrate the world of geographical video content. Join our [https://discord.gg/aPXQ5ZMjH8 Discord Server] for more Information.
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Featured Geotuber</h1> -->
==Featured Geotuber==
'''Ahnaf Abrar Khan''' ([[w:Bengali language| Bangla]]: আহনাফ আবরার খান) is a Bangladeshi Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Geographyify'''. Renowned for his in-depth geographical insights and engaging video content, Ahnaf blends his personal experiences and academic curiosity to make geography accessible and enjoyable for a vast audience. [[Geographyify | Read More..]]
==Explore==
Dive in and learn about Geotubers who love making geography related content.
* [[:Category:List of Geotubers]]
* [[:Category:Top Geotubers]]
<!-- <h1 style="text-align: center; background-color: #cef2e0; border: 2px solid #a3b0bf; padding: 5px; border-radius: 7px;">Recent Changes</h1> -->
=== Contributing ===
Interested in helping Geotubepedia grow? Contribute by editing an existing page or create your own!
=== Random Geotuber ===
Click [[Special:Random|here]] to discover a random Geotuber profile!
== Other Links ==
* [[Geotubepedia:Copyrights | Geotubpedia Copyrights]]
* [[Geotubepedia:About | About Geotubepedia]]
* [[Geotubepedia:Policies and Guidelines|Policies and Guidelines]]
* [[Geotubepedia:Help Desk|Help Desk]]
49b3bad57ebea6d55c08848787983b68d29ae996
File:Ro0v Mapping Logo.jpeg
6
331
831
819
2023-09-02T11:04:36Z
InsaneX
2
InsaneX uploaded a new version of [[File:Ro0v Mapping Logo.jpeg]]
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Rüm
0
335
834
2023-09-02T18:41:26Z
76.118.174.208
0
Yes
wikitext
text/x-wiki
Rüm was a Seljuk sultanate yep that’s it
20b4c900025c207ca6545ef83a4f4076e4a27875
User:Indo. FHA Editz20
2
333
832
2023-09-03T10:08:04Z
Indo. FHA Editz20
74
Just Created
wikitext
text/x-wiki
Indo. FHA Edits as known as Indonesian FHA Edits is a capcut geotuber who makes Edits, Comparisions, and Countryball Animation and It's from capcut, he thinks Capcut Is a smaller version of Alight Motion, So instead of using animations, he uses Graphs for Conparisions, Mask for Countryball, and he is the only one who has his own endcap.
15164a96c8af2ca8a9f213591210dfe4f04f02cd
User talk:Indo. FHA Editz20
3
334
833
2023-09-03T13:25:44Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:Indo. FHA Editz20]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 13:25, 3 September 2023
efa9e07e67eff6ba640d42b692a9de99301a9b38
User talk:Loceq-Geo
3
337
837
2023-09-03T13:27:16Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:Loceq-Geo]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 13:27, 3 September 2023
f4828b18a2f803e9cafd85ada468321155c4c09a
User:World.Military.Reality
2
338
838
2023-09-03T13:27:40Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:World.Military.Reality
3
339
839
2023-09-03T13:27:40Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:World.Military.Reality]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 13:27, 3 September 2023
b7849eaa454acaf83c04b18d70147e8d3fa34257
Geotuber
0
340
841
840
2023-09-03T15:43:01Z
InsaneX
2
wikitext
text/x-wiki
'''Geotuber''' (alternatively spelled '''GeoTuber''') is a term used to describe content creators, primarily on [[w:YouTube Shorts | YouTube Shorts]], who focus on producing geography-related videos. Although the term is prevalent among YouTube Shorts creators, it remains less recognized among creators of long-form content on platforms like [[w:YouTube | YouTube]].
== Overview ==
Geotubers specialize in a niche within the vast domain of YouTube Shorts, bringing forward geographic, historic, and geopolitical content in bite-sized formats. The content can range from direct comparisons between countries, their economies, militaries, and political structures to broader themes like historical analyses, mapping exercises, and more.
=== Content Themes ===
* '''Country Vs Country comparisons:''' Geotubers often engage in comparative analyses between two or more countries, discussing factors such as GDP, population, military prowess, etc.
* '''Mapping videos:''' These often visualize historical or political changes, territorial evolutions, or other geographic phenomena.
* '''Top economies and militaries:''' Ranking videos that order countries based on their economic or military strength.
* '''Political leader edits:''' Creative videos focusing on the lives and careers of prominent political figures.
* '''Historical empires comparison:''' Pitting historical empires against each other to determine their strengths, legacies, and influences.
* '''Countries now vs. then:''' Comparing a country's current status to its past, highlighting changes in borders, governance, and global significance.
== Alliances in the Geotuber Community ==
A unique feature of the Geotuber community is the formation of alliances. These alliances serve multiple purposes:
* '''Collaboration:''' Many Geotubers come together to co-create content, leveraging each other's strengths and resources.
* '''Skill Improvement:''' Being part of an alliance offers opportunities for learning and refining video editing skills.
* '''Protection:''' Some alliances form to offer protection against harmful actions. It's been reported that certain alliances engage in disruptive behaviors, such as targeting other alliances' Discord servers or even reporting channels on YouTube. Protective alliances work towards safeguarding their members from these types of antagonistic actions.
However, it's essential to note that not all alliances endorse or participate in such adversarial practices. The broader Geotuber community is characterized by a shared passion for geography and content creation.
== Notable Geotubers ==
A few prominent Geotubers have made a significant impact on the community. Here are some of them:
* ''Geotuber1'': Known for their in-depth historical analyses and engaging visualizations.
* ''Geotuber2'': Renowned for their creative mapping techniques and detailed country comparisons.
* ''Geotuber3'': A rising star who often collaborates with other Geotubers to produce joint content.
== Conclusion ==
The Geotuber community, while niche, has carved a space for itself in the digital content sphere. As more creators join and the audience grows, the influence and relevance of Geotubers will only continue to increase.
a814446ed93421ced48acdd8e609ed7ccf0ef773
842
841
2023-09-03T15:43:14Z
InsaneX
2
/* Alliances in the Geotuber Community */
wikitext
text/x-wiki
'''Geotuber''' (alternatively spelled '''GeoTuber''') is a term used to describe content creators, primarily on [[w:YouTube Shorts | YouTube Shorts]], who focus on producing geography-related videos. Although the term is prevalent among YouTube Shorts creators, it remains less recognized among creators of long-form content on platforms like [[w:YouTube | YouTube]].
== Overview ==
Geotubers specialize in a niche within the vast domain of YouTube Shorts, bringing forward geographic, historic, and geopolitical content in bite-sized formats. The content can range from direct comparisons between countries, their economies, militaries, and political structures to broader themes like historical analyses, mapping exercises, and more.
=== Content Themes ===
* '''Country Vs Country comparisons:''' Geotubers often engage in comparative analyses between two or more countries, discussing factors such as GDP, population, military prowess, etc.
* '''Mapping videos:''' These often visualize historical or political changes, territorial evolutions, or other geographic phenomena.
* '''Top economies and militaries:''' Ranking videos that order countries based on their economic or military strength.
* '''Political leader edits:''' Creative videos focusing on the lives and careers of prominent political figures.
* '''Historical empires comparison:''' Pitting historical empires against each other to determine their strengths, legacies, and influences.
* '''Countries now vs. then:''' Comparing a country's current status to its past, highlighting changes in borders, governance, and global significance.
== Alliances in the Geo Community ==
A unique feature of the Geotuber community is the formation of alliances. These alliances serve multiple purposes:
* '''Collaboration:''' Many Geotubers come together to co-create content, leveraging each other's strengths and resources.
* '''Skill Improvement:''' Being part of an alliance offers opportunities for learning and refining video editing skills.
* '''Protection:''' Some alliances form to offer protection against harmful actions. It's been reported that certain alliances engage in disruptive behaviors, such as targeting other alliances' Discord servers or even reporting channels on YouTube. Protective alliances work towards safeguarding their members from these types of antagonistic actions.
However, it's essential to note that not all alliances endorse or participate in such adversarial practices. The broader Geotuber community is characterized by a shared passion for geography and content creation.
== Notable Geotubers ==
A few prominent Geotubers have made a significant impact on the community. Here are some of them:
* ''Geotuber1'': Known for their in-depth historical analyses and engaging visualizations.
* ''Geotuber2'': Renowned for their creative mapping techniques and detailed country comparisons.
* ''Geotuber3'': A rising star who often collaborates with other Geotubers to produce joint content.
== Conclusion ==
The Geotuber community, while niche, has carved a space for itself in the digital content sphere. As more creators join and the audience grows, the influence and relevance of Geotubers will only continue to increase.
3dd70b72654e2cddac1ad9124006904d6641b582
843
842
2023-09-03T15:44:16Z
InsaneX
2
/* Content Themes */
wikitext
text/x-wiki
'''Geotuber''' (alternatively spelled '''GeoTuber''') is a term used to describe content creators, primarily on [[w:YouTube Shorts | YouTube Shorts]], who focus on producing geography-related videos. Although the term is prevalent among YouTube Shorts creators, it remains less recognized among creators of long-form content on platforms like [[w:YouTube | YouTube]].
== Overview ==
Geotubers specialize in a niche within the vast domain of YouTube Shorts, bringing forward geographic, historic, and geopolitical content in bite-sized formats. The content can range from direct comparisons between countries, their economies, militaries, and political structures to broader themes like historical analyses, mapping exercises, and more.
=== Content Themes ===
* '''Country Vs Country comparisons:''' Geotubers often engage in comparative analyses between two or more countries, discussing factors such as GDP, population, military prowess, etc.
* '''Mapping videos:''' These often visualize historical or political changes, territorial evolutions, or other geographic phenomena.
* '''Top economies and militaries:''' Ranking videos that order countries based on their economic or military strength.
* '''Political leader edits:''' Creative videos focusing on the lives and careers of prominent political figures.
* '''Historical empires comparisons:''' Pitting historical empires against each other to determine their strengths, legacies, and influences.
* '''Countries now Vs then:''' Comparing a country's current status to its past, highlighting changes in borders, governance, and global significance.
== Alliances in the Geo Community ==
A unique feature of the Geotuber community is the formation of alliances. These alliances serve multiple purposes:
* '''Collaboration:''' Many Geotubers come together to co-create content, leveraging each other's strengths and resources.
* '''Skill Improvement:''' Being part of an alliance offers opportunities for learning and refining video editing skills.
* '''Protection:''' Some alliances form to offer protection against harmful actions. It's been reported that certain alliances engage in disruptive behaviors, such as targeting other alliances' Discord servers or even reporting channels on YouTube. Protective alliances work towards safeguarding their members from these types of antagonistic actions.
However, it's essential to note that not all alliances endorse or participate in such adversarial practices. The broader Geotuber community is characterized by a shared passion for geography and content creation.
== Notable Geotubers ==
A few prominent Geotubers have made a significant impact on the community. Here are some of them:
* ''Geotuber1'': Known for their in-depth historical analyses and engaging visualizations.
* ''Geotuber2'': Renowned for their creative mapping techniques and detailed country comparisons.
* ''Geotuber3'': A rising star who often collaborates with other Geotubers to produce joint content.
== Conclusion ==
The Geotuber community, while niche, has carved a space for itself in the digital content sphere. As more creators join and the audience grows, the influence and relevance of Geotubers will only continue to increase.
cb75d70e1457d17723bc8fadb9a6985d3a2ce846
844
843
2023-09-03T15:44:38Z
InsaneX
2
/* Alliances in the Geo Community */
wikitext
text/x-wiki
'''Geotuber''' (alternatively spelled '''GeoTuber''') is a term used to describe content creators, primarily on [[w:YouTube Shorts | YouTube Shorts]], who focus on producing geography-related videos. Although the term is prevalent among YouTube Shorts creators, it remains less recognized among creators of long-form content on platforms like [[w:YouTube | YouTube]].
== Overview ==
Geotubers specialize in a niche within the vast domain of YouTube Shorts, bringing forward geographic, historic, and geopolitical content in bite-sized formats. The content can range from direct comparisons between countries, their economies, militaries, and political structures to broader themes like historical analyses, mapping exercises, and more.
=== Content Themes ===
* '''Country Vs Country comparisons:''' Geotubers often engage in comparative analyses between two or more countries, discussing factors such as GDP, population, military prowess, etc.
* '''Mapping videos:''' These often visualize historical or political changes, territorial evolutions, or other geographic phenomena.
* '''Top economies and militaries:''' Ranking videos that order countries based on their economic or military strength.
* '''Political leader edits:''' Creative videos focusing on the lives and careers of prominent political figures.
* '''Historical empires comparisons:''' Pitting historical empires against each other to determine their strengths, legacies, and influences.
* '''Countries now Vs then:''' Comparing a country's current status to its past, highlighting changes in borders, governance, and global significance.
== Alliances in the Geo Community ==
A unique feature of the Geotuber community is the formation of alliances. These alliances serve multiple purposes:
* '''Collaboration:''' Many Geotubers come together to co-create content, leveraging each other's strengths and resources.
* '''Skill Improvement:''' Being part of an alliance offers opportunities for learning and refining video editing skills.
* '''Protection:''' Some alliances form to offer protection against harmful actions. It's been reported that certain alliances engage in disruptive behaviors, such as targeting other alliances' Discord servers or even reporting channels on YouTube. Protective alliances work towards safeguarding their members from these types of antagonistic actions.
However, it's essential to note that not all alliances endorse or participate in such adversarial practices. The broader Geo community is characterized by a shared passion for geography and content creation.
== Notable Geotubers ==
A few prominent Geotubers have made a significant impact on the community. Here are some of them:
* ''Geotuber1'': Known for their in-depth historical analyses and engaging visualizations.
* ''Geotuber2'': Renowned for their creative mapping techniques and detailed country comparisons.
* ''Geotuber3'': A rising star who often collaborates with other Geotubers to produce joint content.
== Conclusion ==
The Geotuber community, while niche, has carved a space for itself in the digital content sphere. As more creators join and the audience grows, the influence and relevance of Geotubers will only continue to increase.
55dc84434f5cfd20c7a13aaf67d58608906ea233
845
844
2023-09-03T15:45:55Z
InsaneX
2
/* Notable Geotubers */
wikitext
text/x-wiki
'''Geotuber''' (alternatively spelled '''GeoTuber''') is a term used to describe content creators, primarily on [[w:YouTube Shorts | YouTube Shorts]], who focus on producing geography-related videos. Although the term is prevalent among YouTube Shorts creators, it remains less recognized among creators of long-form content on platforms like [[w:YouTube | YouTube]].
== Overview ==
Geotubers specialize in a niche within the vast domain of YouTube Shorts, bringing forward geographic, historic, and geopolitical content in bite-sized formats. The content can range from direct comparisons between countries, their economies, militaries, and political structures to broader themes like historical analyses, mapping exercises, and more.
=== Content Themes ===
* '''Country Vs Country comparisons:''' Geotubers often engage in comparative analyses between two or more countries, discussing factors such as GDP, population, military prowess, etc.
* '''Mapping videos:''' These often visualize historical or political changes, territorial evolutions, or other geographic phenomena.
* '''Top economies and militaries:''' Ranking videos that order countries based on their economic or military strength.
* '''Political leader edits:''' Creative videos focusing on the lives and careers of prominent political figures.
* '''Historical empires comparisons:''' Pitting historical empires against each other to determine their strengths, legacies, and influences.
* '''Countries now Vs then:''' Comparing a country's current status to its past, highlighting changes in borders, governance, and global significance.
== Alliances in the Geo Community ==
A unique feature of the Geotuber community is the formation of alliances. These alliances serve multiple purposes:
* '''Collaboration:''' Many Geotubers come together to co-create content, leveraging each other's strengths and resources.
* '''Skill Improvement:''' Being part of an alliance offers opportunities for learning and refining video editing skills.
* '''Protection:''' Some alliances form to offer protection against harmful actions. It's been reported that certain alliances engage in disruptive behaviors, such as targeting other alliances' Discord servers or even reporting channels on YouTube. Protective alliances work towards safeguarding their members from these types of antagonistic actions.
However, it's essential to note that not all alliances endorse or participate in such adversarial practices. The broader Geo community is characterized by a shared passion for geography and content creation.
== Notable Geotubers ==
A few prominent Geotubers have made a significant impact on the community. Here are some of them:
* '''[[Militarizatixn]]'''
* '''[[Amidoch]]'''
* '''[[Geographyify]]'''
== Conclusion ==
The Geotuber community, while niche, has carved a space for itself in the digital content sphere. As more creators join and the audience grows, the influence and relevance of Geotubers will only continue to increase.
4d607c8659fdf78b45c6b35790920e693ec78e88
User:Coconutz
2
342
847
2023-09-04T03:22:44Z
Coconutz
76
Created page with "<nowiki>[[Coconutz]]</nowiki>"
wikitext
text/x-wiki
<nowiki>[[Coconutz]]</nowiki>
d8d3a28708c2bf0eba089dcb2e055b3f21de81a8
EnfeMapping
0
300
848
773
2023-09-04T12:02:37Z
ThatFlagGuy
61
spelling error
wikitext
text/x-wiki
[[File:EnfeMapping_Logo.jpg|thumb|300px|Logo of EnfeMapping.]]
'''EnfeMapping''' is a well known [[w:YouTube | YouTube]] content creator and Geotuber based in [[w:Turkey|Turkey]]. With a subscriber count nearing 80,000 and over 39.4 million views, the channel focuses on geographical comparisons and historical analyses, primarily revolving around Turkish history.
== YouTube Career ==
Before delving into the world of YouTube, EnfeMapping described himself as an "ordinary student." His initial content concentrated on Turkish history videos. However, he took a hiatus from content creation for three months due to the [[W:2023 Turkey–Syria earthquake|Turkey–Syria earthquake]].
On returning, he was inspired by the channel ''MapOfGeography'' and began his journey into creating mapping videos. Despite facing several challenges in the early phases of his YouTube career, he managed to gain significant popularity. For the creation of his content, EnfeMapping uses a range of software including ''Ibis Paint'', ''Capcut'', [[w:Adobe After Effects | Adobe After Effects]], and [[w:Adobe Photoshop | Adobe Photoshop]].
== External Links ==
* [https://www.youtube.com/@EnfeMapping EnfeMapping on YouTube]
* [https://www.tiktok.com/@enfemapping EnfeMapping on TikTok]
* [https://www.instagram.com/enfe.mapping_/ EnfeMapping on Instagram]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
8048aa3688fdfc8b20482fbc72c84fc6dc9e81c9
User talk:Coconutz
3
343
849
2023-09-06T09:33:19Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:Coconutz]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 09:33, 6 September 2023
266e353f490b078b6b0c35ab60c287146fde79c4
User:ThatFlagGuy
2
344
850
2023-09-06T09:33:35Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:ThatFlagGuy
3
345
851
2023-09-06T09:33:35Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:EnfeMapping]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 09:33, 6 September 2023
a5c226cc8253c23f49e634c8112614ae63282984
File:Abdullahdoitallnew.jpg
6
349
855
2023-09-06T18:58:08Z
UnitedPeople2828
82
new pfp
wikitext
text/x-wiki
== Summary ==
new pfp
555cfd6b9efce153a484733fbde46ebeddd6756b
File:His pfp.jpg
6
356
863
2023-09-08T17:32:06Z
Slovenian mapping
85
wikitext
text/x-wiki
Pfp of Slovenian mapping
b23f801c06ebae57bc2c398ed888ac304a7326aa
Slovenian mapping
0
355
862
2023-09-08T17:34:15Z
Slovenian mapping
85
some changes
wikitext
text/x-wiki
Geotuber from [https://en.wikipedia.org/wiki/Slovenia slovenia]
f08e874af44e46d764e49bcf7ae5fcf9db72dcae
File:Pfp.jpg
6
353
860
2023-09-08T17:37:30Z
Slovenian mapping
85
wikitext
text/x-wiki
my pfp
dba551178f3fef3334d23da84ca86862f48c0ae7
User:Slovenian mapping
2
352
859
2023-09-08T17:38:09Z
Slovenian mapping
85
Text
wikitext
text/x-wiki
Youtube username: Slovenian_mapping
Geotuber from [https://en.wikipedia.org/wiki/Slovenia Slovenia]
Doing edits, country comparisons, maps,...
8ca30f381341afe63af0aaf89737eb44fa2b4a6c
User:UnitedPeople2828
2
350
857
2023-09-09T12:37:08Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:UnitedPeople2828
3
351
858
2023-09-09T12:37:08Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:File:Abdullahdoitallnew.jpg]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 12:37, 9 September 2023
bcf3e608c342d5e75903c15d8213afc76b9e2009
Abdullah do it all
0
219
856
742
2023-09-09T12:37:45Z
InsaneX
2
wikitext
text/x-wiki
[[File:Abdullahdoitallnew.jpg|thumb|300px|Logo of Abdullah do it all.]]
'''Muhammad Abdullah Nasir''' ([[W:Urdu | Urdu]]: محمد عبداللہ ناصر) is a Bahraini-Pakistani Geotuber, well known for his [[w:YouTube|YouTube]] channel, '''Abdullah do it all'''. Born and residing in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]] Abdullah has gained significant attention in the Geo Community for his unique takes on history, geography, geo-political topics, as well as football and Islamic-themed video edits.
==Early Life==
Muhammad Abdullah Bin Nasir was born in [[w:Lahore | Lahore]], [[w:Pakistan | Pakistan]]. From a young age, he showcased a keen interest in various subjects that later translated into his YouTube endeavors. He is a devout follower of [[w:Islam | Islam]], and supports a range of countries, namely Palestine, Iran, Turkey, Iraq, Azerbaijan, Indonesia, Russia, Malaysia, Morocco, Nigeria, Maldives, and his homeland Pakistan.
==YouTube Career==
Abdullah's journey on [[w:YouTube | YouTube]] started in 2018 with the channel primarily focused on gaming content, especially around the game [[w:Geometry Dash | Geometry Dash]]. Despite producing numerous videos between 2018 to 2021, the channel didn't gain much traction, garnering only about 33 subscribers with his most viewed video reaching around 35k views.
In October 2022, taking inspiration from notable YouTuber ''World.military.king1'', Abdullah pivoted his channel's focus towards editing. These edits ranged from football highlights to more nuanced geo-political content. With a quest for continuous improvement, he transitioned from using the editing software ''Capcut'' to ''Alight Motion'' in February 2023. This switch proved beneficial for the quality of his content, and subsequently, the growth of his channel. In a short span of 11 months, "Abdullah do it all" witnessed a rapid surge in subscribers, hitting the 1.1k mark. This growth solidified Abdullah's position as a significant figure in the Geo Community, proudly identifying himself as a Geotuber.
==Editing Style and Tools==
Abdullah is known for his diverse editing style, which encapsulates a mix of historical events, geographical phenomena, geo-political narratives, football highlights, and Islamic themes. To achieve the desired effects in his videos, Abdullah employs a variety of software, including:
* Capcut
* FilmoraGo
* Alight Motion
* [[w:Adobe After Effects | Adobe After Effects]]
* [[w:Adobe Premiere Pro | Adobe Premiere Pro]]
==Alliances==
Beyond his individual YouTube career, Abdullah holds a co-ownership position in the '''Pakistan Youtube Shorts Editors Club (P.Y.S.E.C)''' alliance, further emphasizing his influence and commitment to the Geo community.
==External Links==
* [https://www.youtube.com/@abdullahdoitall/ Abdullah do it all on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
60d8fb5f86f51eb33775c84f6236f23b49b2cfc3
User talk:Slovenian mapping
3
354
861
2023-09-09T12:38:31Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:Slovenian mapping]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 12:38, 9 September 2023
68b8300b538a351364b8e29340eabef03602277a
GokTurk Edits
0
357
864
2023-09-09T18:13:36Z
InsaneX
2
Created page with "'''Mehmet''' (born 15 August 2007 in [[w:Isparta | Isparta]], [[w:Turkey | Turkey]]) is a Turkish [[Geotuber]], better known by his channel name '''GokTurk Edits'''. He mainly focuses on producing content related to geography, history, and the comparative study of countries. As of September 9th, his channel has garnered 155K subscribers and nearly 61 million views. == Early Life == Mehmet has been passionate about history and geography from a young age. His formative ye..."
wikitext
text/x-wiki
'''Mehmet''' (born 15 August 2007 in [[w:Isparta | Isparta]], [[w:Turkey | Turkey]]) is a Turkish [[Geotuber]], better known by his channel name '''GokTurk Edits'''. He mainly focuses on producing content related to geography, history, and the comparative study of countries. As of September 9th, his channel has garnered 155K subscribers and nearly 61 million views.
== Early Life ==
Mehmet has been passionate about history and geography from a young age. His formative years were marked by reading numerous books and watching various videos in these domains. Outside of these academic interests, he has a fondness for plants, animals, cycling, and politics. Mehmet has expressed a desire to pursue a career aligned with his childhood passions in the future.
== YouTube Career ==
Mehmet began his journey on [[w:YouTube | YouTube]] during the COVID-19 pandemic with a channel dedicated to ''Brawl Stars''. However, due to violations, this channel was closed, leading to a hiatus from the platform. In January 2022, spurred by a mix of curiosity and boredom, he uploaded content focused on countries that have a favorable view of Turkey. This content was well-received, prompting him to continue creating series on related topics.
As his channel grew, Mehmet discovered that his audience was not just Turkish but international. This encouraged him to craft original content in English related to geography. Not all his series found success. One such example is the ''Country Now and Then'' series. However, he found a significant audience with his ''Countryhuman Now and Then'' series. Over time, Mehmet honed his video editing skills, but expressed concerns about monetization issues on YouTube affecting his motivation to produce content.
He primarily uses ''CapCut'' for video editing, and ''ibisPaint'' and ''Alight Motion'' for image manipulation. Most of his content is in Turkish, centered around edits related to geography and history. Recently, he diversified his portfolio by venturing into Mapping content on his secondary channel, ''GökTürk Mapping''. He identifies as a Muslim and is a proud nationalist Turkish.
== External Links ==
* [https://www.youtube.com/@gokturk_edits/ GokTurk Edits on YouTube]
* [https://www.youtube.com/@GokTurk_Mapping GokTurk Mapping on YouTube]
* [https://www.tiktok.com/@gokturk_edits_32 GokTurk Edits on TikTok]
* [https://www.instagram.com/gokturk_edits_32/ GokTurk Edits on Instagram]
* [https://discord.gg/gokturk-birligi-993594092854452264 GokTuk Edit's Discord Server]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
8e33f83044dc3434926605628d3c27c9b6cdf088
866
864
2023-09-09T18:14:56Z
InsaneX
2
wikitext
text/x-wiki
[[File:GokTurk Edits_Logo.jpg|thumb|300px|Logo of GokTurk Edits.]]
'''Mehmet''' (born 15 August 2007 in [[w:Isparta | Isparta]], [[w:Turkey | Turkey]]) is a Turkish [[Geotuber]], better known by his channel name '''GokTurk Edits'''. He mainly focuses on producing content related to geography, history, and the comparative study of countries. As of September 9th, his channel has garnered 155K subscribers and nearly 61 million views.
== Early Life ==
Mehmet has been passionate about history and geography from a young age. His formative years were marked by reading numerous books and watching various videos in these domains. Outside of these academic interests, he has a fondness for plants, animals, cycling, and politics. Mehmet has expressed a desire to pursue a career aligned with his childhood passions in the future.
== YouTube Career ==
Mehmet began his journey on [[w:YouTube | YouTube]] during the COVID-19 pandemic with a channel dedicated to ''Brawl Stars''. However, due to violations, this channel was closed, leading to a hiatus from the platform. In January 2022, spurred by a mix of curiosity and boredom, he uploaded content focused on countries that have a favorable view of Turkey. This content was well-received, prompting him to continue creating series on related topics.
As his channel grew, Mehmet discovered that his audience was not just Turkish but international. This encouraged him to craft original content in English related to geography. Not all his series found success. One such example is the ''Country Now and Then'' series. However, he found a significant audience with his ''Countryhuman Now and Then'' series. Over time, Mehmet honed his video editing skills, but expressed concerns about monetization issues on YouTube affecting his motivation to produce content.
He primarily uses ''CapCut'' for video editing, and ''ibisPaint'' and ''Alight Motion'' for image manipulation. Most of his content is in Turkish, centered around edits related to geography and history. Recently, he diversified his portfolio by venturing into Mapping content on his secondary channel, ''GökTürk Mapping''. He identifies as a Muslim and is a proud nationalist Turkish.
== External Links ==
* [https://www.youtube.com/@gokturk_edits/ GokTurk Edits on YouTube]
* [https://www.youtube.com/@GokTurk_Mapping GokTurk Mapping on YouTube]
* [https://www.tiktok.com/@gokturk_edits_32 GokTurk Edits on TikTok]
* [https://www.instagram.com/gokturk_edits_32/ GokTurk Edits on Instagram]
* [https://discord.gg/gokturk-birligi-993594092854452264 GokTuk Edit's Discord Server]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
0249ce7e5df9778cedc5b3eb82ac35b927973ef6
867
866
2023-09-10T11:03:16Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
[[File:GokTurk Edits_Logo.jpg|thumb|300px|Logo of GokTurk Edits.]]
'''Mehmet''' (born 15 August 2007 in [[w:Isparta | Isparta]], [[w:Turkey | Turkey]]) is a Turkish [[Geotuber]], better known by his channel name '''GokTurk Edits'''. He mainly focuses on producing content related to geography, history, and the comparative study of countries. As of September 9th, his channel has garnered 155K subscribers and nearly 61 million views.
== Early Life ==
Mehmet has been passionate about history and geography from a young age. His formative years were marked by reading numerous books and watching various videos in these domains. Outside of these academic interests, he has a fondness for plants, animals, cycling, and politics. Mehmet has expressed a desire to pursue a career aligned with his childhood passions in the future.
== YouTube Career ==
Mehmet began his journey on [[w:YouTube | YouTube]] during the COVID-19 pandemic with a channel dedicated to ''Brawl Stars''. However, due to violations, this channel was closed, leading to a hiatus from the platform. In January 2022, spurred by a mix of curiosity and boredom, he uploaded content focused on countries that have a favorable view of Turkey. This content was well-received, prompting him to continue creating series on related topics.
As his channel grew, Mehmet discovered that his audience was not just Turkish but international. This encouraged him to craft original content in English related to geography. Not all his series found success. One such example is the ''Country Now and Then'' series. However, he found a significant audience with his ''Countryhuman Now and Then'' series. Over time, Mehmet honed his video editing skills, but expressed concerns about monetization issues on YouTube affecting his motivation to produce content.
He primarily uses ''CapCut'' for video editing, and ''ibisPaint'' and ''Alight Motion'' for image manipulation. Most of his content is in Turkish, centered around edits related to geography and history. Recently, he diversified his portfolio by venturing into Mapping content on his secondary channel, '''GokTurk Mapping'''. He identifies as a Muslim and is a proud nationalist Turkish.
== External Links ==
* [https://www.youtube.com/@gokturk_edits/ GokTurk Edits on YouTube]
* [https://www.youtube.com/@GokTurk_Mapping GokTurk Mapping on YouTube]
* [https://www.tiktok.com/@gokturk_edits_32 GokTurk Edits on TikTok]
* [https://www.instagram.com/gokturk_edits_32/ GokTurk Edits on Instagram]
* [https://discord.gg/gokturk-birligi-993594092854452264 GokTuk Edit's Discord Server]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
90edca1577da9a7177196fe62d85091f6a6f8692
868
867
2023-09-10T11:05:52Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
[[File:GokTurk Edits_Logo.jpg|thumb|300px|Logo of GokTurk Edits.]]
'''Mehmet''' (born 15 August 2007 in [[w:Isparta | Isparta]], [[w:Turkey | Turkey]]) is a Turkish [[Geotuber]], better known by his channel name '''GokTurk Edits'''. He mainly focuses on producing content related to geography, history, and the comparative study of countries. As of September 9th, his channel has garnered 155K subscribers and nearly 61 million views.
== Early Life ==
Mehmet has been passionate about history and geography from a young age. His formative years were marked by reading numerous books and watching various videos in these domains. Outside of these academic interests, he has a fondness for plants, animals, cycling, and politics. Mehmet has expressed a desire to pursue a career aligned with his childhood passions in the future.
== YouTube Career ==
Mehmet began his journey on [[w:YouTube | YouTube]] during the [[w:COVID-19 pandemic|COVID-19 pandemic]] with a channel dedicated to ''Brawl Stars''. However, due to violations, this channel was closed, leading to a hiatus from the platform. In January 2022, spurred by a mix of curiosity and boredom, he uploaded content focused on countries that have a favorable view of Turkey. This content was well-received, prompting him to continue creating series on related topics.
As his channel grew, Mehmet discovered that his audience was not just Turkish but international. This encouraged him to craft original content in English related to geography. Not all his series found success. One such example is the ''Country Now and Then'' series. However, he found a significant audience with his ''Countryhuman Now and Then'' series. Over time, Mehmet honed his video editing skills, but expressed concerns about monetization issues on YouTube affecting his motivation to produce content.
He primarily uses ''CapCut'' for video editing, and ''ibisPaint'' and ''Alight Motion'' for image manipulation. Most of his content is in Turkish, centered around edits related to geography and history. Recently, he diversified his portfolio by venturing into Mapping content on his secondary channel, '''GokTurk Mapping'''. He identifies as a Muslim and is a proud nationalist Turkish.
== External Links ==
* [https://www.youtube.com/@gokturk_edits/ GokTurk Edits on YouTube]
* [https://www.youtube.com/@GokTurk_Mapping GokTurk Mapping on YouTube]
* [https://www.tiktok.com/@gokturk_edits_32 GokTurk Edits on TikTok]
* [https://www.instagram.com/gokturk_edits_32/ GokTurk Edits on Instagram]
* [https://discord.gg/gokturk-birligi-993594092854452264 GokTuk Edit's Discord Server]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
b70e0c3c57cfd5fd442b24aa751438239c91d5d9
File:GokTurk Edits Logo.jpg
6
358
865
2023-09-09T18:14:17Z
InsaneX
2
Logo of GokTurk Edits.
wikitext
text/x-wiki
== Summary ==
Logo of GokTurk Edits.
9947b2cc696ac3b69bac9b7dc6a470ace0894039
R2X Mapping
0
359
869
2023-09-10T11:12:58Z
InsaneX
2
Created page with "'''R2X Mapping''' is an American [[Geotuber]], well known for producing videos related to geography, often comparing countries, empires, and various geographical themes. As of 10 September 2023, the channel boasts 142K subscribers and has garnered over 55 million views. == Biography == Born on March 25, 2008, in [[w:New York | New York]], [[w:United_States|USA]], R2X Mapping currently resides in [[w:Louisiana | Louisiana]], [[w:United_States|USA]]. He holds American nat..."
wikitext
text/x-wiki
'''R2X Mapping''' is an American [[Geotuber]], well known for producing videos related to geography, often comparing countries, empires, and various geographical themes. As of 10 September 2023, the channel boasts 142K subscribers and has garnered over 55 million views.
== Biography ==
Born on March 25, 2008, in [[w:New York | New York]], [[w:United_States|USA]], R2X Mapping currently resides in [[w:Louisiana | Louisiana]], [[w:United_States|USA]]. He holds American nationality.
== YouTube Career ==
R2X Mapping began his foray into the [[w:YouTube | YouTube]] world inspired by the content from another creator, '''ExploitHistory'''. Launching his channel on July 12, 2022, his initial focus was a series titled "Europe v Asia". However, it was a video titled “never!” released in December 2022 that truly brought attention to his channel, rapidly amassing over 600,000 views. Furthering this success, a video related to [[w:MrBeast | MrBeast]], although not directly related to geography, propelled his channel even further, becoming his most viewed video with 14 million hits. Another successful venture of his was the video titled "Meet the World Leaders".
Despite facing a brief period of inactivity, R2X Mapping revived his channel with the "Rise of Empires" series in May and June 2023. To date, the series comprises five parts that have collectively garnered over 6 million views. Throughout his content creation journey, he has utilized various software and applications such as ''Alight Motion'', ''ibis Paint X'', ''CapCut'', and ''Picsart'' to create and edit his videos. Presently, he specializes in map animation videos and historical edits.
In addition to his [[w:YouTube | YouTube]] presence, R2X Mapping expanded his digital footprint by launching a [[w:TikTok | TikTok]] account in May 2023.
== External Links ==
* [https://youtube.com/@r2x_mapping R2X Mapping on YouTube]
* [https://www.tiktok.com/@r2x_editz R2X Mapping on TikTok]
* [https://www.youtube.com/@R2XCB R2X CB on YouTube]
[[Category:Top Geotubers]]
[[Category:List of Geotubers]]
685ae4764393380e2781874f357ae50e34ecf8c0
871
869
2023-09-10T11:16:54Z
InsaneX
2
wikitext
text/x-wiki
[[File:R2X Mapping_Logo.jpg|thumb|300px|Logo of R2X Mapping.]]
'''R2X Mapping''' is an American [[Geotuber]], well known for producing videos related to geography, often comparing countries, empires, and various geographical themes. As of 10 September 2023, the channel boasts 142K subscribers and has garnered over 55 million views.
== Biography ==
Born on March 25, 2008, in [[w:New York | New York]], [[w:United_States|USA]], R2X Mapping currently resides in [[w:Louisiana | Louisiana]], [[w:United_States|USA]]. He holds American nationality.
== YouTube Career ==
R2X Mapping began his foray into the [[w:YouTube | YouTube]] world inspired by the content from another creator, '''ExploitHistory'''. Launching his channel on July 12, 2022, his initial focus was a series titled "Europe v Asia". However, it was a video titled “never!” released in December 2022 that truly brought attention to his channel, rapidly amassing over 600,000 views. Furthering this success, a video related to [[w:MrBeast | MrBeast]], although not directly related to geography, propelled his channel even further, becoming his most viewed video with 14 million hits. Another successful venture of his was the video titled "Meet the World Leaders".
Despite facing a brief period of inactivity, R2X Mapping revived his channel with the "Rise of Empires" series in May and June 2023. To date, the series comprises five parts that have collectively garnered over 6 million views. Throughout his content creation journey, he has utilized various software and applications such as ''Alight Motion'', ''ibis Paint X'', ''CapCut'', and ''Picsart'' to create and edit his videos. Presently, he specializes in map animation videos and historical edits.
In addition to his [[w:YouTube | YouTube]] presence, R2X Mapping expanded his digital footprint by launching a [[w:TikTok | TikTok]] account in May 2023.
== External Links ==
* [https://youtube.com/@r2x_mapping R2X Mapping on YouTube]
* [https://www.tiktok.com/@r2x_editz R2X Mapping on TikTok]
* [https://www.youtube.com/@R2XCB R2X CB on YouTube]
[[Category:Top Geotubers]]
[[Category:List of Geotubers]]
2414a4b9bc4f32d93ffc34b3b227d6e15c34d11d
File:R2X Mapping Logo.jpg
6
360
870
2023-09-10T11:16:12Z
InsaneX
2
Logo of R2X Mapping.
wikitext
text/x-wiki
== Summary ==
Logo of R2X Mapping.
8285ce306b40ecf2016237dc90dca1ea504c61fb
Turkiyeball Edits
0
361
872
2023-09-10T12:27:50Z
InsaneX
2
Created page with "'''Turkiyeball Edits''' is a Turkish Geotuber based in [[w:Istanbul | Istanbul]], [[w:Turkey|Turkey]]. As of September 10th, the channel has amassed a following of more than 400 subscribers and has received more than 74K views. == YouTube Career == Turkiyeball Edits initially ventured into the [[w:YouTube | YouTube]] realm with a focus on gaming content. However, reflecting on the initial videos as "cringe", they were subsequently removed as the creator matured. The tra..."
wikitext
text/x-wiki
'''Turkiyeball Edits''' is a Turkish Geotuber based in [[w:Istanbul | Istanbul]], [[w:Turkey|Turkey]]. As of September 10th, the channel has amassed a following of more than 400 subscribers and has received more than 74K views.
== YouTube Career ==
Turkiyeball Edits initially ventured into the [[w:YouTube | YouTube]] realm with a focus on gaming content. However, reflecting on the initial videos as "cringe", they were subsequently removed as the creator matured. The transformation to becoming a Geotuber began after watching Geo-themed videos during the summer of 2022. With this newfound inspiration, Turkiyeball Edits established a Geo-focused channel on 8 August 2022.
The primary content includes animations and geographical edits. While occasional map content is produced, Turkiyeball Edits self-admittedly finds challenges in creating them. For content creation, tools like ''CapCut'' and [[w:Paint.net |Paint.NET]] play a pivotal role. The editing process is streamlined using an HP Victus 16 laptop and an iPhone 11 Pro.
== External Links ==
* [https://www.youtube.com/@Turkiyeball1453 Turkiyeball Edits on YouTube]
* [https://www.roblox.com/users/3447230332/profile Turkiyeball Edits on Roblox]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
59845b0c26c404f506c1492905b53851d8e29c91
874
872
2023-09-10T12:30:25Z
InsaneX
2
wikitext
text/x-wiki
[[File:Turkiyeball_Edits_Logo.jpg|thumb|300px|Logo of Turkiyeball Edits.]]
'''Turkiyeball Edits''' is a Turkish Geotuber based in [[w:Istanbul | Istanbul]], [[w:Turkey|Turkey]]. As of September 10th, the channel has amassed a following of more than 400 subscribers and has received more than 74K views.
== YouTube Career ==
Turkiyeball Edits initially ventured into the [[w:YouTube | YouTube]] realm with a focus on gaming content. However, reflecting on the initial videos as "cringe", they were subsequently removed as the creator matured. The transformation to becoming a Geotuber began after watching Geo-themed videos during the summer of 2022. With this newfound inspiration, Turkiyeball Edits established a Geo-focused channel on 8 August 2022.
The primary content includes animations and geographical edits. While occasional map content is produced, Turkiyeball Edits self-admittedly finds challenges in creating them. For content creation, tools like ''CapCut'' and [[w:Paint.net |Paint.NET]] play a pivotal role. The editing process is streamlined using an HP Victus 16 laptop and an iPhone 11 Pro.
== External Links ==
* [https://www.youtube.com/@Turkiyeball1453 Turkiyeball Edits on YouTube]
* [https://www.roblox.com/users/3447230332/profile Turkiyeball Edits on Roblox]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
c9a94a707a62f0b62b1c2acd49ad1b95454e1a6e
875
874
2023-09-10T12:33:25Z
InsaneX
2
wikitext
text/x-wiki
[[File:Turkiyeball_Edits_Logo.jpg|thumb|300px|Logo of Turkiyeball Edits.]]
'''Turkiyeball Edits''' is a Turkish Geotuber based in [[w:Istanbul | Istanbul]], [[w:Turkey|Turkey]]. As of September 10th, the channel has amassed a following of more than 400 subscribers and has received more than 74K views.
== YouTube Career ==
Turkiyeball Edits initially ventured into the [[w:YouTube | YouTube]] realm with a focus on gaming content. However, reflecting on the initial videos as "cringe", they were subsequently removed as the creator matured. The transformation to becoming a Geotuber began after watching Geo-themed videos during the summer of 2022. With this newfound inspiration, Turkiyeball Edits established a Geo-focused channel on 8 August 2022.
The primary content includes animations and geographical edits. While occasional map content is produced, Turkiyeball Edits self-admittedly finds challenges in creating them. For content creation, tools like ''CapCut'' and [[w:Paint.net |Paint.NET]] play a pivotal role. The editing process is streamlined using an HP Victus 16 laptop and an [[w:iPhone 11 Pro|iPhone 11 Pro]].
== External Links ==
* [https://www.youtube.com/@Turkiyeball1453 Turkiyeball Edits on YouTube]
* [https://www.roblox.com/users/3447230332/profile Turkiyeball Edits on Roblox]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
ee3d5e7fd2eb1598f963714cf66a7f1588cda1ec
File:Turkiyeball Edits Logo.jpg
6
362
873
2023-09-10T12:29:29Z
InsaneX
2
Logo of Turkiyeball Edits.
wikitext
text/x-wiki
== Summary ==
Logo of Turkiyeball Edits.
9effb1b012c04b7a60660a91695c917472a61678
User:German edits
2
371
891
2023-09-10T18:59:12Z
German edits
93
Historical edits and mapping.
wikitext
text/x-wiki
German Mapper was born in 2007 , 15 January in München , Germany .
Started mapping in 20 February,2023
da291779c8dcf6e5c54e609dfc4c687d0aaadeac
File:Turkiye-Editz Pfp.jpg
6
370
890
2023-09-10T22:02:15Z
Türkiye-Editz
95
wikitext
text/x-wiki
Maker:Turkiye-Editz
4c992aa0611f202810e0fda29e72115680c63d36
AHZ
0
246
887
686
2023-09-13T11:10:16Z
61.247.177.198
0
removed an extra space between ''to'' and ''canada''
wikitext
text/x-wiki
[[File:AHZ_Logo.jpg|thumb|300px|Logo of AHZ.]]
'''Ahmet''' is an Azerbaijani Geotuber known for his YouTube channel '''AHZ'''. Born in 2007 in [[w:Azerbaijan|Azerbaijan]], Ahmet later moved to[[w:Canada| Canada]].
== Early Life ==
Ahmet's early life was marked by challenges, as he was born into a low-income family in Azerbaijan. Despite these hardships, Ahmet found solace and passion in the digital world.
== YouTube Career ==
Ahmet's journey on [[W:YouTube| YouTube]] began as a mapper, inspired by creators like Balkan Mapping. However, his interests soon shifted to the Geotuber community, intrigued by the advanced edits and creative potential. In his videos, Ahmet primarily creates Islamic and [[W:Turanism | Turanist]] edits, reflecting his personal beliefs as both an Islamist and a pan-Turanist. To create these edits, he often uses software tools like ''Capcut'' and ''Picsart''.
Ahmet's contributions and unique style have earned him a dedicated following, boasting 19.3K subscribers and nearly 8.8 million views on his channel.
== Alliances ==
Ahmet is an active member of the '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)''', an alliance within the Geo community that focuses on collaborative content creation.
== External Links ==
* [https://youtube.com/@ahz_editz.53 AHZ on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
aa5b73e26fca7c5424f121118fa621b47c493d3f
File:Coconutz Logo.jpg
6
369
886
2023-09-14T09:24:24Z
Coconutz
76
wikitext
text/x-wiki
Logo of CoconutzEdit
45f87f0992077d621bee9dc486df5f92720dae7e
User:ArmenianSerb
2
365
882
2023-09-14T12:52:13Z
ArmenianSerb
99
Some details
wikitext
text/x-wiki
ArmenianSerb Mapper
Koryun(22.05.) is an Armenian geoyoutuber , a member of APL and a proud Armenian
Start and early years.
He started an account in 2016 he had many channels (gaming, nature and e.t.c.), but he chose history in 2022.His first videos were maps in MapChart App , but now he uses CapCuT and IbisPaint X for edits . He uses an iPhone 12 Mini.
0a7c0c3147914873f4b126f3d3b8bd631dc34206
Mr Geography
0
363
876
2023-09-14T17:06:53Z
That muslim kid
9
Created page with "[[File:Mr_Geography.jpg|thumb|300px|Logo of Mr Geography.]] ''''''Mrgeography2011'''''' is a Moroccan Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Mrgeography2011'''. == Overview == Mrgeography2011 is a prominent Geotuber with 262 subscribers and over 51,455 views on his YouTube channel. He has gained recognition for his content, which primarily focuses on mapping, national, and geography-related topics. == Biography == Mrgeography2011 was born i..."
wikitext
text/x-wiki
[[File:Mr_Geography.jpg|thumb|300px|Logo of Mr Geography.]]
''''''Mrgeography2011'''''' is a Moroccan Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Mrgeography2011'''.
== Overview ==
Mrgeography2011 is a prominent Geotuber with 262 subscribers and over 51,455 views on his YouTube channel. He has gained recognition for his content, which primarily focuses on mapping, national, and geography-related topics.
== Biography ==
Mrgeography2011 was born in Greece.
== YouTube Career ==
Mrgeography2011 embarked on his YouTube journey in June 2033, specializing in creating informative and engaging content related to geography, including country comparisons and historical empires.
== Software Used ==
For his video editing, Mrgeography2011 employs a variety of software tools, including Capcut, Mapchart, World Provinces, Travel Boast, and Xrecorder.
== External Links ==
* [https://www.tiktok.com/@mrgeography2011?_t=8fdUzpFHQEC&_r=1 TikTok Profile]
* [https://youtube.com/@Mrgeography2011?si=Zk98X1lGhXmnvD52 YouTube Channel]
== Categories ==
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
1d8b8892c63873a55f15b4ca7054e22e40ac2377
878
876
2023-09-14T17:26:10Z
InsaneX
2
wikitext
text/x-wiki
[[File:Mr_Geography.jpg|thumb|300px|Logo of Mr Geography.]]
'''Mrgeography2011''' is a Greek-Moroccan Geotuber, best recognized for his content, which primarily focuses on mapping, national, and geography-related topics.
== Biography ==
Mrgeography2011 was born in Greece. He is a prominent Geotuber with more than 250 subscribers and over 51K views on his YouTube channel.
== YouTube Career ==
Mrgeography2011 embarked on his YouTube journey in June 2023, specializing in creating informative and engaging content related to geography, including country comparisons and historical empires. For his video editing, Mrgeography2011 employs a variety of software tools, including ''CapCut'', ''MapChart'', ''World Provinces'', ''TravelBoast'', and ''XRecorder''.
== External Links ==
* [https://www.tiktok.com/@mrgeography2011 Mrgeography2011 on TikTok]
* [https://youtube.com/@Mrgeography2011 Mrgeography2011 on YouTube]
== Categories ==
[[Category:List of Geotubers]]
d741ffdd93f7042573c67e5c510525efcaca0712
879
878
2023-09-14T17:29:20Z
InsaneX
2
wikitext
text/x-wiki
[[File:Mr_Geography.jpg|thumb|300px|Logo of Mr Geography.]]
'''Mr Geography''' is a Greek-Moroccan Geotuber, best recognized for his content, which primarily focuses on mapping, national, and geography-related topics.
== Biography ==
Mr Geography was born in Greece. He is a prominent Geotuber with more than 250 subscribers and over 51K views on his YouTube channel.
== YouTube Career ==
Mr Geography embarked on his YouTube journey in June 2023, specializing in creating informative and engaging content related to geography, including country comparisons and historical empires. For his video editing, he employs a variety of software tools, including ''CapCut'', ''MapChart'', ''World Provinces'', ''TravelBoast'', and ''XRecorder''.
== External Links ==
* [https://www.tiktok.com/@mrgeography2011 Mrgeography2011 on TikTok]
* [https://youtube.com/@Mrgeography2011 Mrgeography2011 on YouTube]
== Categories ==
[[Category:List of Geotubers]]
c7ca320a1c36fadb281de7f003b8b0346b2f8826
880
879
2023-09-14T17:29:40Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:Mr_Geography.jpg|thumb|300px|Logo of Mr Geography.]]
'''Mr Geography''' is a Greek-Moroccan Geotuber, best recognized for his content, which primarily focuses on mapping, national, and geography-related topics.
== Biography ==
Mr Geography was born in Greece. He is a prominent Geotuber with more than 250 subscribers and over 51K views on his YouTube channel.
== YouTube Career ==
Mr Geography embarked on his YouTube journey in June 2023, specializing in creating informative and engaging content related to geography, including country comparisons and historical empires. For his video editing, he employs a variety of software tools, including ''CapCut'', ''MapChart'', ''World Provinces'', ''TravelBoast'', and ''XRecorder''.
== External Links ==
* [https://www.tiktok.com/@mrgeography2011 Mrgeography on TikTok]
* [https://youtube.com/@Mrgeography2011 Mrgeography on YouTube]
== Categories ==
[[Category:List of Geotubers]]
a750fe03f2121a467d11f12ce743f79e64b27ada
881
880
2023-09-14T17:29:58Z
InsaneX
2
/* External Links */
wikitext
text/x-wiki
[[File:Mr_Geography.jpg|thumb|300px|Logo of Mr Geography.]]
'''Mr Geography''' is a Greek-Moroccan Geotuber, best recognized for his content, which primarily focuses on mapping, national, and geography-related topics.
== Biography ==
Mr Geography was born in Greece. He is a prominent Geotuber with more than 250 subscribers and over 51K views on his YouTube channel.
== YouTube Career ==
Mr Geography embarked on his YouTube journey in June 2023, specializing in creating informative and engaging content related to geography, including country comparisons and historical empires. For his video editing, he employs a variety of software tools, including ''CapCut'', ''MapChart'', ''World Provinces'', ''TravelBoast'', and ''XRecorder''.
== External Links ==
* [https://www.tiktok.com/@mrgeography2011 Mr Geography on TikTok]
* [https://youtube.com/@Mrgeography2011 Mr Geography on YouTube]
== Categories ==
[[Category:List of Geotubers]]
85595578a1d6974fab782a6d85e8f5c8815b203f
899
881
2023-09-15T15:00:10Z
Mrgeography
101
wikitext
text/x-wiki
[[File:Mr_Geography.jpg|thumb|300px|Logo of Mr Geography.]]
'''Mr Geography''' is a Moroccan Geotuber, best recognized for his content, which primarily focuses on mapping, national, and geography-related topics.
== Biography ==
Mr Geography was born in Greece. He is a prominent Geotuber with more than 250 subscribers and over 51K views on his YouTube channel.
== YouTube Career ==
Mr Geography embarked on his YouTube journey in June 2023, specializing in creating informative and engaging content related to geography, including country comparisons and historical empires. For his video editing, he employs a variety of software tools, including ''CapCut'', ''MapChart'', ''World Provinces'', ''TravelBoast'', and ''XRecorder''.
== External Links ==
* [https://www.tiktok.com/@mrgeography2011 Mr Geography on TikTok]
* [https://youtube.com/@Mrgeography2011 Mr Geography on YouTube]
== Categories ==
[[Category:List of Geotubers]]
66dd138317ee4f31e484baa75e86d8d094a221c7
905
899
2023-09-27T15:29:28Z
Mrgeography
101
/* Biography */
wikitext
text/x-wiki
[[File:Mr_Geography.jpg|thumb|300px|Logo of Mr Geography.]]
'''Mr Geography''' is a Moroccan Geotuber, best recognized for his content, which primarily focuses on mapping, national, and geography-related topics.
== Biography ==
Mr Geography was born in Greece. He is a prominent Geotuber with more than 250 subscribers and over 78K views on his YouTube channel.
== YouTube Career ==
Mr Geography embarked on his YouTube journey in June 2023, specializing in creating informative and engaging content related to geography, including country comparisons and historical empires. For his video editing, he employs a variety of software tools, including ''CapCut'', ''MapChart'', ''World Provinces'', ''TravelBoast'', and ''XRecorder''.
== External Links ==
* [https://www.tiktok.com/@mrgeography2011 Mr Geography on TikTok]
* [https://youtube.com/@Mrgeography2011 Mr Geography on YouTube]
== Categories ==
[[Category:List of Geotubers]]
7b3dbb911818620ad6967eba30396674e3ab4cdd
File:Mr Geography.jpg
6
364
877
2023-09-14T17:07:21Z
That muslim kid
9
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Krokroasan Edits Mapping
0
368
885
2023-09-14T17:17:14Z
That muslim kid
9
Created page with "File:Krokroasan Edits Mapping.jpg|thumb|300px|Logo of Kroakroason Editz Mapping.]] '''Krokroasan Edits Mapping''' is a Bosnian-Croatian Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Krokroasan Edits Mapping'''. == Overview == Krokroasan Edits Mapping is a Geotuber with over 4.83K subscribers and more than 1.2 million views on his YouTube channel. He is well-known for his content related to geography, mapping, and historical topics. == Biography ==..."
wikitext
text/x-wiki
File:Krokroasan Edits Mapping.jpg|thumb|300px|Logo of Kroakroason Editz Mapping.]]
'''Krokroasan Edits Mapping''' is a Bosnian-Croatian Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Krokroasan Edits Mapping'''.
== Overview ==
Krokroasan Edits Mapping is a Geotuber with over 4.83K subscribers and more than 1.2 million views on his YouTube channel. He is well-known for his content related to geography, mapping, and historical topics.
== Biography ==
Krokroasan Edits Mapping, whose real name is Ivan, was born on June 23, 2010, in Zagreb, Croatia. He currently resides in Sesvete, Croatia.
== YouTube Career ==
Ivan began his YouTube career by uploading Minecraft videos on February 27, 2023. However, he shifted his focus to geography-related content after being inspired by other Geotubers, particularly ''History World 54''. He started uploading maps created using ''MapChart'' and later expanded his skills to include ''ibis Paint X'' and ''CapCut'', becoming a Geotuber.
== Software Used ==
For his video editing and map creation, Ivan utilizes ''CapCut'' and ''ibis Paint X''.
== External Links ==
* [https://youtube.com/@krokroasan Krokroasan Edits Mapping on YouTube]
* [https://discord.gg/GXa4DDdXbh Krokroasan Edits Mapping's Discord Server]
== Categories ==
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
82ac4c95a9a059b94da4b67024974a9d93f434bf
895
885
2023-09-14T17:46:43Z
InsaneX
2
wikitext
text/x-wiki
[[File:Krokroasan Edits Mapping.jpg|thumb|300px|Logo of Kroakroason Editz Mapping.]]
'''Ivan''' is a Bosnian-Croatian Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Krokroasan Edits Mapping'''. As of September 14th, the channel has 4.83K subscribers and has received more than 1.2 million views. He is well-known for his content related to geography, mapping, and historical topics.
== Biography ==
Ivan, whose real name is Ivan, was born on June 23, 2010, in Zagreb, Croatia. He currently resides in [[w:Sesvete|Sesvete]], [[w:Croatia|Croatia]].
== YouTube Career ==
Ivan began his YouTube career by uploading Minecraft videos on February 27, 2023. However, he shifted his focus to geography-related content after being inspired by other [[Geotubers]], particularly ''History World 54''. He started uploading maps created using ''MapChart'' and later expanded his skills to include ''ibis Paint X'' and ''CapCut'', becoming a [[Geotuber]]. For his video editing and map creation, Ivan utilizes ''CapCut'' and ''ibis Paint X''.
== External Links ==
* [https://youtube.com/@krokroasan Krokroasan Edits Mapping on YouTube]
* [https://discord.gg/GXa4DDdXbh Krokroasan Edits Mapping's Discord Server]
== Categories ==
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
a344961bc9e3f354c1c267927e5af776c35334dc
896
895
2023-09-14T17:47:11Z
InsaneX
2
wikitext
text/x-wiki
[[File:Krokroasan Edits Mapping.jpg|thumb|300px|Logo of Kroakroason Editz Mapping.]]
'''Ivan''' is a Bosnian-Croatian Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Krokroasan Edits Mapping'''. As of September 14th, the channel has 4.83K subscribers and has received more than 1.2 million views. He is well-known for his content related to geography, mapping, and historical topics.
== Biography ==
Ivan, whose real name is Ivan, was born on June 23, 2010, in Zagreb, Croatia. He currently resides in [[w:Sesvete|Sesvete]], [[w:Croatia|Croatia]].
== YouTube Career ==
Ivan began his YouTube career by uploading Minecraft videos on February 27, 2023. However, he shifted his focus to geography-related content after being inspired by other [[Geotuber|Geotubers]], particularly ''History World 54''. He started uploading maps created using ''MapChart'' and later expanded his skills to include ''ibis Paint X'' and ''CapCut'', becoming a [[Geotuber]]. For his video editing and map creation, Ivan utilizes ''CapCut'' and ''ibis Paint X''.
== External Links ==
* [https://youtube.com/@krokroasan Krokroasan Edits Mapping on YouTube]
* [https://discord.gg/GXa4DDdXbh Krokroasan Edits Mapping's Discord Server]
== Categories ==
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
ec765f8ecf0f1f2fb65bc543c6d8b5dfee145e40
897
896
2023-09-14T17:47:29Z
InsaneX
2
/* YouTube Career */
wikitext
text/x-wiki
[[File:Krokroasan Edits Mapping.jpg|thumb|300px|Logo of Kroakroason Editz Mapping.]]
'''Ivan''' is a Bosnian-Croatian Geotuber, best recognized for his [[w:YouTube|YouTube]] channel, '''Krokroasan Edits Mapping'''. As of September 14th, the channel has 4.83K subscribers and has received more than 1.2 million views. He is well-known for his content related to geography, mapping, and historical topics.
== Biography ==
Ivan, whose real name is Ivan, was born on June 23, 2010, in Zagreb, Croatia. He currently resides in [[w:Sesvete|Sesvete]], [[w:Croatia|Croatia]].
== YouTube Career ==
Ivan began his YouTube career by uploading Minecraft videos on February 27, 2023. However, he shifted his focus to geography-related content after being inspired by other [[Geotuber|Geotubers]], particularly ''History World 54''. He started uploading maps created using ''MapChart'' and later expanded his skills to include ''ibis Paint X'' and ''CapCut'', becoming a [[Geotuber]].
== External Links ==
* [https://youtube.com/@krokroasan Krokroasan Edits Mapping on YouTube]
* [https://discord.gg/GXa4DDdXbh Krokroasan Edits Mapping's Discord Server]
== Categories ==
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
ecc591f96323d2d42ad3f815735007bf0c81878f
File:Krokroasan Edits Mapping.jpg
6
367
884
2023-09-14T17:17:59Z
That muslim kid
9
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
User talk:ArmenianSerb
3
366
883
2023-09-14T17:32:10Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:ArmenianSerb]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 17:32, 14 September 2023
929f6932d6d5a7f0d64b6cb501a62ac816752cb6
AHZ
0
246
888
887
2023-09-14T17:38:42Z
InsaneX
2
wikitext
text/x-wiki
[[File:AHZ_Logo.jpg|thumb|300px|Logo of AHZ.]]
'''Ahmet''' is an Azerbaijani Geotuber known for his YouTube channel '''AHZ'''. Born in 2007 in[[w:Azerbaijan|Azerbaijan]], Ahmet later moved to[[w:Canada| Canada]].
== Early Life ==
Ahmet's early life was marked by challenges, as he was born into a low-income family in Azerbaijan. Despite these hardships, Ahmet found solace and passion in the digital world.
== YouTube Career ==
Ahmet's journey on [[W:YouTube| YouTube]] began as a mapper, inspired by creators like Balkan Mapping. However, his interests soon shifted to the Geotuber community, intrigued by the advanced edits and creative potential. In his videos, Ahmet primarily creates Islamic and [[W:Turanism | Turanist]] edits, reflecting his personal beliefs as both an Islamist and a pan-Turanist. To create these edits, he often uses software tools like ''Capcut'' and ''Picsart''.
Ahmet's contributions and unique style have earned him a dedicated following, boasting 19.3K subscribers and nearly 8.8 million views on his channel.
== Alliances ==
Ahmet is an active member of the '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)''', an alliance within the Geo community that focuses on collaborative content creation.
== External Links ==
* [https://youtube.com/@ahz_editz.53 AHZ on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
ec2c5516b3674188cd7b1e2edf131296679a22dd
889
888
2023-09-14T17:38:52Z
InsaneX
2
wikitext
text/x-wiki
[[File:AHZ_Logo.jpg|thumb|300px|Logo of AHZ.]]
'''Ahmet''' is an Azerbaijani Geotuber known for his YouTube channel '''AHZ'''. Born in 2007 in [[w:Azerbaijan|Azerbaijan]], Ahmet later moved to[[w:Canada| Canada]].
== Early Life ==
Ahmet's early life was marked by challenges, as he was born into a low-income family in Azerbaijan. Despite these hardships, Ahmet found solace and passion in the digital world.
== YouTube Career ==
Ahmet's journey on [[W:YouTube| YouTube]] began as a mapper, inspired by creators like Balkan Mapping. However, his interests soon shifted to the Geotuber community, intrigued by the advanced edits and creative potential. In his videos, Ahmet primarily creates Islamic and [[W:Turanism | Turanist]] edits, reflecting his personal beliefs as both an Islamist and a pan-Turanist. To create these edits, he often uses software tools like ''Capcut'' and ''Picsart''.
Ahmet's contributions and unique style have earned him a dedicated following, boasting 19.3K subscribers and nearly 8.8 million views on his channel.
== Alliances ==
Ahmet is an active member of the '''Pakistan YouTube Shorts Editors Club (P.Y.S.E.C)''', an alliance within the Geo community that focuses on collaborative content creation.
== External Links ==
* [https://youtube.com/@ahz_editz.53 AHZ on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
aa5b73e26fca7c5424f121118fa621b47c493d3f
User:Türkiye-Editz
2
372
892
2023-09-14T17:39:11Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:Türkiye-Editz
3
373
893
2023-09-14T17:39:11Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:File:Turkiye-Editz Pfp.jpg]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 17:39, 14 September 2023
20547ad1fa8ec751a5fc05927fa366cab57b6435
User talk:German edits
3
374
894
2023-09-14T17:39:24Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:German edits]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 17:39, 14 September 2023
31a2ce0216e2e6b5b87c7d105cb054846b75c693
User:Marocball
2
375
898
2023-09-15T13:25:23Z
Marocball
100
Created page with "AM [🇲🇦] Or Moroccoball (Arabic:مغوكوبول) It's a Mapper With a 390 Sub , And It's Part Of "Anti LGBTQ+" And "Anti Furry" And "Anti Israel Action""
wikitext
text/x-wiki
AM [🇲🇦] Or Moroccoball (Arabic:مغوكوبول) It's a Mapper With a 390 Sub , And It's Part Of "Anti LGBTQ+" And "Anti Furry" And "Anti Israel Action"
d9f21049acc486d83c7b416e433b19d3a97c46c9
User talk:Marocball
3
376
900
2023-09-15T16:57:59Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:Marocball]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 16:57, 15 September 2023
69c5fa9fb2ec32d2fb8e97d08d6ff7bb25a15d80
User:Mrgeography
2
377
901
2023-09-15T16:58:18Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:Mrgeography
3
378
902
2023-09-15T16:58:18Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:Mr Geography]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 16:58, 15 September 2023
78f9279b3a53707fcb5272081fce3b2e34aa5e70
Nicolas Productions
0
318
934
795
2023-09-17T01:52:52Z
Coconutz
76
wikitext
text/x-wiki
[[File:Nicolas_Productions_Logo.jpg|thumb|300px|Logo of Nicolas Productions.]]
'''Trương Bảo Thiên''' (born October 18, 2009 in [[w:An Giang Province|An Giang]], [[w:Vietnam|Vietnam]]) is a Vietnamese Geotuber, best recognized for his YouTube channel, '''Nicolas Productions'''. He is well known for creating videos related to geography, especially comparisons between countries and empires.
== Early Life ==
Thiên was born in [[w:An Giang Province|An Giang]], [[w:Vietnam|Vietnam]]. He is of Vietnamese nationality.
== YouTube Career ==
Thiên's interest in geography began when some of his friends in Vietnam started posting geography-related videos. Inspired by them, Trương started researching geography and calendars. He uploaded his first video in August 2022. He primarily used ''CapCut'' for editing his early videos. For his videos, Trương uses ''CapCut'' and ''Alight Motion''. He employs ''ibis Paint X'' for mapping.
== External Links ==
* [https://youtube.com/@NicolasProductions Nicolas Productions on YouTube]
* [https://www.tiktok.com/@nicolas.productions Nicolas Productions on TikTok]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
925563fcd884265e77dc9117716006cffc2f7e2a
User:Coconutz
2
342
923
847
2023-09-17T06:47:18Z
Coconutz
76
wikitext
text/x-wiki
a lazy guy in all things💀
457f24836c88bd9e4a2b7fbf3826f73ca86d454f
OtterMapping
0
250
930
643
2023-09-18T02:05:38Z
OtterMapping
104
/* Early Life */
wikitext
text/x-wiki
[[File:OtterMapping_Logo.jpg|thumb|300px|Logo of OtterMapping.]]
'''OtterMapping''' is an American Geotuber, known for producing videos related to geography and historical subjects. As of September 17th 2023 the channel has garnered over 435k views and has a subscriber count of 806.
== Early Life ==
Born on January 16, 2009, in the USA, Justice has always been inclined towards geography and history.
== YouTube Career ==
OtterMapping started their YouTube journey with a desire to both establish a presence in the digital community and to educate the audience about geography—a subject they felt was not well-understood by many. Over time, the content on their channel has delved into a blend of geographical insights and historical events or phenomena.
== Alliances ==
OtterMapping is one of the co-founders of '''League of American Geotubers (L.A.G)''', an alliance within the Geo community where creators collaborate on content creation and editing.
== External Links ==
* [https://youtube.com/@OtterMapping OtterMapping on YouTube]
[[Category:List of Geotubers]]
06e241a0bc43e00b938e94a6fadfb81709fd7120
ArizonaBallYT
0
234
903
602
2023-09-20T06:49:12Z
86.25.117.199
0
New update on subscriber count
wikitext
text/x-wiki
[[File:ArizonaBallYT_Logo.jpg|thumb|300px|Logo of ArizonaBallYT.]]
'''ArizonaBallYT''' is an American Geotuber well known for creating videos mainly related to Geography, comparing countries, empires, and other geographical themes. As of the latest update, ArizonaBallYT has amassed a following of 8.64K subscribers and a total of 4.44 million views on his YouTube channel.
== Early Life ==
ArizonaBallYT was born in [https://en.wikipedia.org/wiki/Aurora,_Colorado Aurora], [https://en.wikipedia.org/wiki/Colorado Colorado], USA. At the age of 3, he moved to [https://en.wikipedia.org/wiki/Mexico Mexico] and lived there until he was 9. He then relocated to [https://en.wikipedia.org/wiki/Phoenix,_Arizona Phoenix], [https://en.wikipedia.org/wiki/Arizona Arizona], USA. Adapting to the new environment within the USA after living in Mexico was a unique experience for him, which he describes as "kinda awkward".
== YouTube Career ==
ArizonaBallYT initially began his YouTube journey as an animator, focusing on Countryball videos. However, with only about 9 subscribers garnered from this endeavor, he decided to pivot to creating geography-related content. This change in content proved to be a turning point for his channel. Not only did he feel more passionate and positive about uploading, but it also led to him growing a substantial subscriber base and making many friends within the community.
== Softwares Used ==
* '''CapCut'''
* '''Alight Motion'''
* '''Ibis Paint X'''
== External Links ==
* [https://www.youtube.com/channel/UC4AcoWHC2zpYcRshihP_8DA ArizonaBallYT on YouTube]
72d764a78035e4fa9994f01771fee28520d8335d
User:Commanderawsum
2
379
906
2023-09-20T14:26:59Z
Commanderawsum
108
Created page with "'''ENXIVITY''' ENXIVITY is a Mongolian geo-Tiktoker, known for creating nationalist edits on TikTok video"
wikitext
text/x-wiki
'''ENXIVITY'''
ENXIVITY is a Mongolian geo-Tiktoker, known for creating nationalist edits on TikTok video
9be4e86820f3a8904ba8f867df317a3893c85b02
User:Russian.Cat.8
2
392
921
2023-09-21T10:00:01Z
Russian.Cat.8
109
idk
wikitext
text/x-wiki
idk
4ab1108ce6284ad7e517314bb7290c48a3a97ef9
User:Tendra Federation
2
393
922
2023-09-22T20:03:23Z
Tendra Federation
114
Created page with "Tendra Federation"
wikitext
text/x-wiki
Tendra Federation
3357cb4045c4e819c4a6394fae38d693b7bcd337
User:Zglitch
2
391
920
2023-09-23T05:41:47Z
Zglitch
115
Created page with "uhh idk i need to sleep i'm glitch_editz aka zgxh, zglitchh, zglitch_editz, glitch, glitchh, glitchhh, z, zg, and zgx this is like my third acc cause this shit is fucked up but ima try to be editing some shit for yall"
wikitext
text/x-wiki
uhh idk i need to sleep i'm glitch_editz aka zgxh, zglitchh, zglitch_editz, glitch, glitchh, glitchhh, z, zg, and zgx this is like my third acc cause this shit is fucked up but ima try to be editing some shit for yall
c77b6408225b48faa8a1851accf1bc2905971fcc
User:ShahenShahEmo
2
383
912
2023-09-23T08:23:03Z
ShahenShahEmo
117
...
wikitext
text/x-wiki
Hi I am '''ShahenShah'''. I am a YouTuber. I have 14 years old. I born in Ganja, Azerbaijan.
I have 330+ subscribers in YouTube
Please subscribe me. O share historical videosu. I think you like my videos....
092ce3846059b00d77c1c78006a0fa04faf679ee
User:ProHeckerFan1
2
385
914
2023-09-23T19:58:52Z
ProHeckerFan1
120
Balls
wikitext
text/x-wiki
I'm pro -ProHeckerFan
7c910a610d6ab8ce8a98b1da378c830a229b2e14
File:Ava.jpg
6
384
913
2023-09-24T12:51:32Z
GINARID
122
wikitext
text/x-wiki
Фото профиля канала.
fa87818c7e622a91bfdc4f6df76e6bc4a1d7f2ea
File:Mint-eggy-pfp.png
6
266
911
695
2023-09-24T18:09:55Z
Mint eggy93
33
Mint eggy93 uploaded a new version of [[File:Mint-eggy-pfp.png]]
wikitext
text/x-wiki
== Summary ==
This is the current pfp of mint eggy the geotuber
849b8dc034bddd831d07437bb9c0dcbdbe6b42c9
Braslezian
0
230
910
690
2023-09-24T19:30:21Z
83.250.102.89
0
wikitext
text/x-wiki
[[File:Braslezian_Logo.jpg|thumb|300px|Logo of Braslezian.]]
'''Braslezian''' is a Brazilian Geotuber known for his content primarily focused on comparing countries, empires, and other geographical elements. His work on [[w:YouTube|YouTube]] began after being inspired by other creators in the Geotuber community, most notably ''Cornunist''. As of August 13th, the channel boasts over 700 subscribers and has accumulated over 134K views.
== Biography ==
Braslezian was born on October 1st, 2011, in [[w:Brazil | Brazil]]. He discovered his passion for geography-related content on YouTube, which later drove him to create his own videos.
== YouTube Career ==
Braslezian's journey into the world of Geotubing started when he began watching videos related to geography, countryball animations, and edits. One of the first channels that he watched using his account was ''Cornunist''. Influenced by Cornunist's content, Braslezian produced his debut video. Over the course of his YouTube career, he has utilized software such as ''Capcut'' for most of his video edits. However, he occasionally experiments and makes edits with ''Adobe Premiere Pro''.
== Alliances ==
Braslezian is a part of the ''S.A.T.O'' and ''Nationalitia'' alliances within the Geo community.
== External Links ==
* [https://www.youtube.com/@Braslezian Braslezian on YouTube]
* [https://discord.gg/7W6x9JhAMs Braslezian's Discord Server]
[[Category: List of Geotubers]]
8e05e83e6d1df59006e41f03ea8cdd9df46b968f
R2X Mapping
0
359
904
871
2023-09-29T17:46:50Z
Endies878
125
His subs and view count
wikitext
text/x-wiki
[[File:R2X Mapping_Logo.jpg|thumb|300px|Logo of R2X Mapping.]]
'''R2X Mapping''' is an American [[Geotuber]], well known for producing videos related to geography, often comparing countries, empires, and various geographical themes. As of 10 September 2023, the channel boasts 144K subscribers and has garnered over 56,8 million views.
== Biography ==
Born on March 25, 2008, in [[w:New York | New York]], [[w:United_States|USA]], R2X Mapping currently resides in [[w:Louisiana | Louisiana]], [[w:United_States|USA]]. He holds American nationality.
== YouTube Career ==
R2X Mapping began his foray into the [[w:YouTube | YouTube]] world inspired by the content from another creator, '''ExploitHistory'''. Launching his channel on July 12, 2022, his initial focus was a series titled "Europe v Asia". However, it was a video titled “never!” released in December 2022 that truly brought attention to his channel, rapidly amassing over 600,000 views. Furthering this success, a video related to [[w:MrBeast | MrBeast]], although not directly related to geography, propelled his channel even further, becoming his most viewed video with 14 million hits. Another successful venture of his was the video titled "Meet the World Leaders".
Despite facing a brief period of inactivity, R2X Mapping revived his channel with the "Rise of Empires" series in May and June 2023. To date, the series comprises five parts that have collectively garnered over 6 million views. Throughout his content creation journey, he has utilized various software and applications such as ''Alight Motion'', ''ibis Paint X'', ''CapCut'', and ''Picsart'' to create and edit his videos. Presently, he specializes in map animation videos and historical edits.
In addition to his [[w:YouTube | YouTube]] presence, R2X Mapping expanded his digital footprint by launching a [[w:TikTok | TikTok]] account in May 2023.
== External Links ==
* [https://youtube.com/@r2x_mapping R2X Mapping on YouTube]
* [https://www.tiktok.com/@r2x_editz R2X Mapping on TikTok]
* [https://www.youtube.com/@R2XCB R2X CB on YouTube]
[[Category:Top Geotubers]]
[[Category:List of Geotubers]]
87b2a936832c0a5c12983f32209118822ee92efe
User:Endies878
2
380
907
2023-10-06T11:29:10Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:Endies878
3
381
908
2023-10-06T11:29:10Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:R2X Mapping]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 11:29, 6 October 2023
f7fba79264ee3ca5ddf5f338ff536d9bf9270631
User talk:Commanderawsum
3
382
909
2023-10-06T11:31:17Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:Commanderawsum]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 11:31, 6 October 2023
abc937616c3551597121c1b89c33e2fc7ce44181
User talk:ShahenShahEmo
3
386
915
2023-10-06T11:32:35Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:ShahenShahEmo]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 11:32, 6 October 2023
b38bcfe1bde660123a3c07e7e3c8d260bcbe982a
User:GINARID
2
387
916
2023-10-06T11:32:50Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:GINARID
3
388
917
2023-10-06T11:32:50Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:File:Ava.jpg]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 11:32, 6 October 2023
17a25734217f3ac2d9fc2af2d7ca8473e7c12e05
User talk:ProHeckerFan1
3
389
918
2023-10-06T11:33:07Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:ProHeckerFan1]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 11:33, 6 October 2023
6893ba1997a3db7187e1b0a4909a38b410052f78
User talk:Zglitch
3
395
925
2023-10-06T11:35:12Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:Zglitch]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 11:35, 6 October 2023
90de1a7fb491d8d5ef8684b62da29aa630ba8477
User talk:Russian.Cat.8
3
396
926
2023-10-06T11:36:44Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:Russian.Cat.8]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 11:36, 6 October 2023
0bf59cc6ef55b80911ddb5acd1cfaefecc13afa3
User talk:Tendra Federation
3
397
927
2023-10-06T11:36:53Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:Tendra Federation]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 11:36, 6 October 2023
ef4a3cb00940290d7e32ea74eeeb03570d569845
User:Colormald
2
398
928
2023-10-06T11:37:59Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:Colormald
3
399
929
2023-10-06T11:37:59Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:File:ColorShorts Logo July 2023-.png]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 11:37, 6 October 2023
d8d940d154f737b660b6f75692cdca4a78aa7f4f
User:OtterMapping
2
400
932
2023-10-06T11:38:41Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:OtterMapping
3
401
933
2023-10-06T11:38:41Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:OtterMapping]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 11:38, 6 October 2023
e752c36b680c438a48f4d240c421e3c53fc79840
OtterMapping
0
250
931
930
2023-10-06T11:39:23Z
InsaneX
2
wikitext
text/x-wiki
[[File:OtterMapping_Logo.jpg|thumb|300px|Logo of OtterMapping.]]
'''OtterMapping''' is an American Geotuber, known for producing videos related to geography and historical subjects. As of September 17th 2023 the channel has garnered over 435k views and has a subscriber count of 806.
== Early Life ==
Born on January 16, 2009, in the USA, OtterMapping has always been inclined towards geography and history.
== YouTube Career ==
OtterMapping started their YouTube journey with a desire to both establish a presence in the digital community and to educate the audience about geography—a subject they felt was not well-understood by many. Over time, the content on their channel has delved into a blend of geographical insights and historical events or phenomena.
== Alliances ==
OtterMapping is one of the co-founders of '''League of American Geotubers (L.A.G)''', an alliance within the Geo community where creators collaborate on content creation and editing.
== External Links ==
* [https://youtube.com/@OtterMapping OtterMapping on YouTube]
[[Category:List of Geotubers]]
e2011c57002cabcc444dedf8c5a56fe6c8a55425
User:FourTran
2
411
945
2023-10-08T08:11:55Z
FourTran
133
Created page with "My Name Is Rafay Salman, I was a Grotuber"
wikitext
text/x-wiki
My Name Is Rafay Salman, I was a Grotuber
ac5616ae974b7398e4c3a379c5b573d82b02b85b
File:Memoryball edits.jpg
6
408
942
2023-10-10T10:44:20Z
PlutiaLoveDudeTLewd
135
wikitext
text/x-wiki
Profile picture of Memoryball edits.
f6c7f62cf5321144a03c4820eafe9b8fe2fa0d2d
User:Paisgeo
2
403
936
2023-10-12T16:48:55Z
Paisgeo
136
He is a geotuber who has born in country in Africa
wikitext
text/x-wiki
Paisgeo
2e4b70ffdbc1ea09ee34a57a5c67ce07171c5934
Prism Geography
0
402
935
2023-10-14T13:24:35Z
InsaneX
2
Created page with "'''Victor Chetroeșu''' (born 27 October 2009 in [[w:Bucharest|Bucharest]], [[w:Romania|Romania]]) is a Romanian Geotuber, popularly known by his YouTube channel name, '''Prism Geography'''. He is noted for his content relating to geography, history, and mapping. === Early Life === Chetroeșu was born and currently resides in [[w:Bucharest|Bucharest]], [[w:Romania|Romania]]. At the age of 4, he moved to [[w:Cluj-Napoca|Cluj-Napoca]] due to his parents' occupational requ..."
wikitext
text/x-wiki
'''Victor Chetroeșu''' (born 27 October 2009 in [[w:Bucharest|Bucharest]], [[w:Romania|Romania]]) is a Romanian Geotuber, popularly known by his YouTube channel name, '''Prism Geography'''. He is noted for his content relating to geography, history, and mapping.
=== Early Life ===
Chetroeșu was born and currently resides in [[w:Bucharest|Bucharest]], [[w:Romania|Romania]]. At the age of 4, he moved to [[w:Cluj-Napoca|Cluj-Napoca]] due to his parents' occupational requirements, although this relocation was short-lived as he subsequently moved back to Bucharest.
=== YouTube Career ===
Chetroeșu's journey on [[w:YouTube|YouTube]] began with a channel named ''Vanonimul'', where he primarily uploaded gaming videos until reaching a milestone of 100 subscribers. Seeking a fresh start and intending to create content that reflected his interests yet was also a popular niche, Chetroeșu ventured into the realm of geography. His revamped channel, initially named ''Vanonimul Shorts'', saw daily uploads until it achieved a subscriber count of 50.
Due to being colloquially known as Prism among his friends, Chetroeșu rebranded his channel with this nickname. His motivation and inspiration were notably drawn from other Geotubers, such as Geography Guy, who experienced significant growth from uploading daily comparison videos between countries. Fueled by the desire to become a prominent Youtuber, Chetroeșu began crafting content related to geography and history, occasionally interspersing his uploads with mapping videos. His editing is done on [[w:CapCut|CapCut]].
== External Links ==
* [https://tiktok.com/@prismgeography69 Prism Geography on TikTok]
* [https://youtube.com/@PrismGeography69 Prism Geography on YouTube]
* [https://discord.com/invite/tUkPecGrrm Prism Geography's Discord Server]
22176f7d894e9e5a5b12a5cf2445ad8eba992647
938
935
2023-10-14T13:32:30Z
InsaneX
2
wikitext
text/x-wiki
[[File:Prism Geography Logo.jpg|thumb|300px|Logo of Prism Geography.]]
'''Victor Chetroeșu''' (born 27 October 2009 in [[w:Bucharest|Bucharest]], [[w:Romania|Romania]]) is a Romanian Geotuber, popularly known by his YouTube channel name, '''Prism Geography'''. He is noted for his content relating to geography, history, and mapping.
== Early Life ==
Chetroeșu was born and currently resides in [[w:Bucharest|Bucharest]], [[w:Romania|Romania]]. At the age of 4, he moved to [[w:Cluj-Napoca|Cluj-Napoca]] due to his parents' occupational requirements, although this relocation was short-lived as he subsequently moved back to Bucharest.
== YouTube Career ==
Chetroeșu's journey on [[w:YouTube|YouTube]] began with a channel named ''Vanonimul'', where he primarily uploaded gaming videos until reaching a milestone of 100 subscribers. Seeking a fresh start and intending to create content that reflected his interests yet was also a popular niche, Chetroeșu ventured into the realm of geography. His revamped channel, initially named ''Vanonimul Shorts'', saw daily uploads until it achieved a subscriber count of 50.
Due to being colloquially known as Prism among his friends, Chetroeșu rebranded his channel with this nickname. His motivation and inspiration were notably drawn from other Geotubers, such as Geography Guy, who experienced significant growth from uploading daily comparison videos between countries. Fueled by the desire to become a prominent Youtuber, Chetroeșu began crafting content related to geography and history, occasionally interspersing his uploads with mapping videos. His editing is done on [[w:CapCut|CapCut]].
== External Links ==
* [https://tiktok.com/@prismgeography69 Prism Geography on TikTok]
* [https://youtube.com/@PrismGeography69 Prism Geography on YouTube]
* [https://discord.com/invite/tUkPecGrrm Prism Geography's Discord Server]
[[Category:List of Geotubers]]
fe84f309944c0e4fbc060b024fbbec7762af3282
User talk:Paisgeo
3
407
941
2023-10-14T13:25:27Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:Paisgeo]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 13:25, 14 October 2023
f82ee4a5ba2bcad3cc71a1d23eb3a8497a6d982d
File:Prism Geography Logo.jpg
6
404
937
2023-10-14T13:32:23Z
InsaneX
2
Logo of Prism Geography.
wikitext
text/x-wiki
== Summary ==
Logo of Prism Geography.
76b077a55409f4523f76d61cce84bfcc6f58b6c3
File:Shadow Blaze Logo.jpg
6
405
939
2023-10-17T16:29:01Z
InsaneX
2
Logo of Shadow Blaze.
wikitext
text/x-wiki
== Summary ==
Logo of Shadow Blaze.
23529d4bee5c3e4643aa161b65d4b7628e714e64
Shadow Blaze
0
406
940
2023-10-17T16:29:12Z
InsaneX
2
Created page with "[[File:Shadow Blaze Logo.jpg|thumb|300px|Logo of Shadow Blaze.]] '''George R''' (born Oct 7, [[w:Illinois | Illinois]], United States) is an American [[Geotuber]], better known by his YouTube channel '''Shadow Blaze'''. He makes in-depth videos on geography, including country comparisons, mapping videos, and more. As of now, he has amassed over 10.5K subscribers and has garnered more than 2 million views on his videos. == Early Life == George R was born in Illinois, Uni..."
wikitext
text/x-wiki
[[File:Shadow Blaze Logo.jpg|thumb|300px|Logo of Shadow Blaze.]]
'''George R''' (born Oct 7, [[w:Illinois | Illinois]], United States) is an American [[Geotuber]], better known by his YouTube channel '''Shadow Blaze'''. He makes in-depth videos on geography, including country comparisons, mapping videos, and more. As of now, he has amassed over 10.5K subscribers and has garnered more than 2 million views on his videos.
== Early Life ==
George R was born in Illinois, United States, and currently resides in [[w:Chicago | Chicago]]. He had an early exposure to international cultures; at the age of 5, he visited both [[w:Germany | Germany]] and [[w:Greece | Greece]], fueling his curiosity about the world.
== YouTube Career ==
In his early days, George had aspirations to start a YouTube channel. This ambition saw its first light with the creation of a channel named ''George Plays''. Although he did not initially upload content on this channel, it eventually transformed into what is now known as ''Shadow Blaze''. Before focusing on geography, he primarily uploaded content related to the game [[w:Fall_Guys|Fall Guys]].
However, after a ban on his ''Shadow Blaze'' channel, he made ''George Plays'' his main channel and renamed it as ''Shadow Blaze2''. Roughly 18 months ago from the present, George's interest pivoted towards geography. Even though he ceased uploading ''Fall Guys'' content on his main channel, his passion for the game persisted. This led him to create a separate channel exclusively for [[w:Fall_Guys|Fall Guys]] content, solidifying his position as a [[Geotuber]]. His choice of editing apps includes ''CapCut'', ''Picsart'', ''Alight Motion'' and ''ibis Paint X''.
== External Links ==
* [https://youtube.com/@Shadow_Blaze2 Shadow Blaze on YouTube]
* [https://youtube.com/@ShadowBlaze-FG Shadow Blaze-FG (2nd channel) on YouTube]
[[Category:List of Geotubers]]
[[Category:Top Geotubers]]
6bcc5d5ac53faf54ab3ebcf873cae399441cf317
User:PlutiaLoveDudeTLewd
2
409
943
2023-10-17T16:33:57Z
HAWelcome
0
Created page with "==About me== ''This is your user page. Please edit this page to tell the community about yourself!'' ==My contributions== *[[Special:Contributions/Badtitle/Parser|User contributions]] ==My favorite pages== *Add links to your favorite pages on the wiki here! *Favorite page #2 *Favorite page #3"
wikitext
text/x-wiki
==About me==
''This is your user page. Please edit this page to tell the community about yourself!''
==My contributions==
*[[Special:Contributions/Badtitle/Parser|User contributions]]
==My favorite pages==
*Add links to your favorite pages on the wiki here!
*Favorite page #2
*Favorite page #3
c246cf6bdc6399d3adaa97fdbe717bc996e9ed78
User talk:PlutiaLoveDudeTLewd
3
410
944
2023-10-17T16:33:57Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:File:Memoryball edits.jpg]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 16:33, 17 October 2023
147dfdf44e456864140501a16855fd1d53e00f73
User talk:FourTran
3
412
946
2023-10-17T16:34:26Z
HAWelcome
0
welcoming new contributor
wikitext
text/x-wiki
Hi, welcome to Geotubepedia! Thanks for your edit to the [[:User:FourTran]] page.
Please leave a message on [[User talk:InsaneX|my talk page]] if I can help with anything! -- [[User:InsaneX|InsaneX]] ([[User talk:InsaneX|talk]]) 16:34, 17 October 2023
088df609c7d03c46722ed983335d64cdbf680320